Add rust 1.57.0
This commit is contained in:
parent
6161997f49
commit
a739cff448
|
@ -1,5 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
curl -OL "https://static.rust-lang.org/dist/rust-1.50.0-x86_64-unknown-linux-gnu.tar.gz"
|
|
||||||
tar xzvf rust-1.50.0-x86_64-unknown-linux-gnu.tar.gz
|
|
||||||
rm rust-1.50.0-x86_64-unknown-linux-gnu.tar.gz
|
|
|
@ -1,6 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# https://stackoverflow.com/questions/38041331/rust-compiler-cant-find-crate-for-std
|
|
||||||
# Rust compiler needs to find the stdlib to link against
|
|
||||||
rustc -o binary -L ${RUST_INSTALL_LOC}/rustc/lib -L ${RUST_INSTALL_LOC}/rust-std-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib "$@"
|
|
||||||
chmod +x binary
|
|
|
@ -1,5 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Put 'export' statements here for environment variables
|
|
||||||
export PATH=$PWD/rust-1.50.0-x86_64-unknown-linux-gnu/rustc/bin/:$PATH
|
|
||||||
export RUST_INSTALL_LOC=$PWD/rust-1.50.0-x86_64-unknown-linux-gnu
|
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
"language": "rust",
|
|
||||||
"version": "1.50.0",
|
|
||||||
"aliases": ["rs"]
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
shift
|
|
||||||
./binary "$@"
|
|
|
@ -1,3 +0,0 @@
|
||||||
fn main() {
|
|
||||||
println!("OK");
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
curl -OL "https://static.rust-lang.org/dist/rust-1.56.1-x86_64-unknown-linux-gnu.tar.gz"
|
|
||||||
tar xzvf rust-1.56.1-x86_64-unknown-linux-gnu.tar.gz
|
|
||||||
rm rust-1.56.1-x86_64-unknown-linux-gnu.tar.gz
|
|
|
@ -1,6 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# https://stackoverflow.com/questions/38041331/rust-compiler-cant-find-crate-for-std
|
|
||||||
# Rust compiler needs to find the stdlib to link against
|
|
||||||
rustc -o binary -L ${RUST_INSTALL_LOC}/rustc/lib -L ${RUST_INSTALL_LOC}/rust-std-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib "$@"
|
|
||||||
chmod +x binary
|
|
|
@ -1,5 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Put 'export' statements here for environment variables
|
|
||||||
export PATH=$PWD/rust-1.56.1-x86_64-unknown-linux-gnu/rustc/bin/:$PATH
|
|
||||||
export RUST_INSTALL_LOC=$PWD/rust-1.56.1-x86_64-unknown-linux-gnu
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"language": "rust",
|
|
||||||
"version": "1.56.1",
|
|
||||||
"aliases": [
|
|
||||||
"rs"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
shift
|
|
||||||
./binary "$@"
|
|
|
@ -1,3 +0,0 @@
|
||||||
fn main() {
|
|
||||||
println!("OK");
|
|
||||||
}
|
|
|
@ -52,4 +52,5 @@ args: {
|
||||||
"yabasic" = import ./yabasic.nix args;
|
"yabasic" = import ./yabasic.nix args;
|
||||||
"emacs" = import ./emacs.nix args;
|
"emacs" = import ./emacs.nix args;
|
||||||
"gnat-ada" = import ./gnat-ada.nix args;
|
"gnat-ada" = import ./gnat-ada.nix args;
|
||||||
|
"rust" = import ./rust.nix args;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
{pkgs, piston, ...}:
|
||||||
|
let
|
||||||
|
gccPackage = pkgs.gcc; # gcc is required for the linker
|
||||||
|
pkg = pkgs.rustc;
|
||||||
|
in piston.mkRuntime {
|
||||||
|
language = "rust";
|
||||||
|
version = pkg.version;
|
||||||
|
|
||||||
|
aliases = [
|
||||||
|
"rs"
|
||||||
|
];
|
||||||
|
|
||||||
|
compile = ''
|
||||||
|
${pkg}/bin/rustc -o binary -C linker=${gccPackage}/bin/gcc $1
|
||||||
|
chmod +x binary
|
||||||
|
'';
|
||||||
|
|
||||||
|
run = ''
|
||||||
|
shift
|
||||||
|
./binary "$@"
|
||||||
|
'';
|
||||||
|
|
||||||
|
tests = [
|
||||||
|
(piston.mkTest {
|
||||||
|
files = {
|
||||||
|
"test.rs" = ''
|
||||||
|
pub mod helper;
|
||||||
|
use std::env;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let args: Vec<String> = env::args().collect();
|
||||||
|
helper::print_something(args[1].to_string());
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
"helper.rs" = ''
|
||||||
|
pub fn print_something(what: String) -> () {
|
||||||
|
println!("{}", what);
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
args = ["OK"];
|
||||||
|
stdin = "";
|
||||||
|
packages = [];
|
||||||
|
main = "test.rs";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
Loading…
Reference in New Issue