diff options
Diffstat (limited to 'pkgs/development/compilers/rust')
-rw-r--r-- | pkgs/development/compilers/rust/1_43.nix | 42 | ||||
-rw-r--r-- | pkgs/development/compilers/rust/cargo.nix | 3 | ||||
-rw-r--r-- | pkgs/development/compilers/rust/clippy.nix | 3 | ||||
-rwxr-xr-x | pkgs/development/compilers/rust/print-hashes.sh | 1 | ||||
-rw-r--r-- | pkgs/development/compilers/rust/rls/default.nix | 14 | ||||
-rw-r--r-- | pkgs/development/compilers/rust/rustfmt.nix | 9 |
6 files changed, 54 insertions, 18 deletions
diff --git a/pkgs/development/compilers/rust/1_43.nix b/pkgs/development/compilers/rust/1_43.nix new file mode 100644 index 000000000000..a1a9d17fcd55 --- /dev/null +++ b/pkgs/development/compilers/rust/1_43.nix @@ -0,0 +1,42 @@ +# New rust versions should first go to staging. +# Things to check after updating: +# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin: +# i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github +# This testing can be also done by other volunteers as part of the pull +# request review, in case platforms cannot be covered. +# 2. The LLVM version used for building should match with rust upstream. +# 3. Firefox and Thunderbird should still build on x86_64-linux. + +{ stdenv, lib +, buildPackages +, newScope, callPackage +, CoreFoundation, Security +, llvmPackages_5 +, pkgsBuildTarget, pkgsBuildBuild +} @ args: + +import ./default.nix { + rustcVersion = "1.43.0"; + rustcSha256 = "18akhk0wz1my6y9vhardriy2ysc482z0fnjdcgs9gy59kmnarxkm"; + + # Note: the version MUST be one version prior to the version we're + # building + bootstrapVersion = "1.42.0"; + + # fetch hashes by running `print-hashes.sh 1.43.0` + bootstrapHashes = { + i686-unknown-linux-gnu = "1c89c12c8fc1a45dcbcb9ee2e21cc634b8453f1d4cdd658269263de686aab4e4"; + x86_64-unknown-linux-gnu = "7d1e07ad9c8a33d8d039def7c0a131c5917aa3ea0af3d0cc399c6faf7b789052"; + arm-unknown-linux-gnueabihf = "6cf776b910d08fb0d1f88be94464e7b20a50f9d8b2ec6372c3c385aec0b70e7a"; + armv7-unknown-linux-gnueabihf = "a36e7f2bd148e325a7b8e7131b4226266cf522b1a2b12d585dad9c38ef68f4d9"; + aarch64-unknown-linux-gnu = "fdd39f856a062af265012861949ff6654e2b7103be034d046bec84ebe46e8d2d"; + x86_64-apple-darwin = "db1055c46e0d54b99da05e88c71fea21b3897e74a4f5ff9390e934f3f050c0a8"; + }; + + selectRustPackage = pkgs: pkgs.rust_1_43; + + rustcPatches = [ + ]; +} + +(builtins.removeAttrs args [ "fetchpatch" ]) diff --git a/pkgs/development/compilers/rust/cargo.nix b/pkgs/development/compilers/rust/cargo.nix index 65614b9480e7..dfea7f6c8ef6 100644 --- a/pkgs/development/compilers/rust/cargo.nix +++ b/pkgs/development/compilers/rust/cargo.nix @@ -9,8 +9,7 @@ rustPlatform.buildRustPackage { # the rust source tarball already has all the dependencies vendored, no need to fetch them again cargoVendorDir = "vendor"; - preBuild = "pushd src/tools/cargo"; - postBuild = "popd"; + buildAndTestSubdir = "src/tools/cargo"; passthru.rustc = rustc; diff --git a/pkgs/development/compilers/rust/clippy.nix b/pkgs/development/compilers/rust/clippy.nix index 4857b587847e..0546ad9bac1a 100644 --- a/pkgs/development/compilers/rust/clippy.nix +++ b/pkgs/development/compilers/rust/clippy.nix @@ -5,8 +5,7 @@ rustPlatform.buildRustPackage { # the rust source tarball already has all the dependencies vendored, no need to fetch them again cargoVendorDir = "vendor"; - preBuild = "pushd src/tools/clippy"; - postBuild = "popd"; + buildAndTestSubdir = "src/tools/clippy"; # changes hash of vendor directory otherwise dontUpdateAutotoolsGnuConfigScripts = true; diff --git a/pkgs/development/compilers/rust/print-hashes.sh b/pkgs/development/compilers/rust/print-hashes.sh index 1d46fe376d4b..957011fad376 100755 --- a/pkgs/development/compilers/rust/print-hashes.sh +++ b/pkgs/development/compilers/rust/print-hashes.sh @@ -13,7 +13,6 @@ PLATFORMS=( arm-unknown-linux-gnueabihf armv7-unknown-linux-gnueabihf aarch64-unknown-linux-gnu - i686-apple-darwin x86_64-apple-darwin ) BASEURL=https://static.rust-lang.org/dist diff --git a/pkgs/development/compilers/rust/rls/default.nix b/pkgs/development/compilers/rust/rls/default.nix index 4cf507fbf5c7..63a3c96a8f92 100644 --- a/pkgs/development/compilers/rust/rls/default.nix +++ b/pkgs/development/compilers/rust/rls/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, rustPlatform +{ stdenv, makeWrapper, fetchFromGitHub, rustPlatform , openssh, openssl, pkgconfig, cmake, zlib, curl, libiconv , CoreFoundation, Security }: @@ -10,8 +10,9 @@ rustPlatform.buildRustPackage { dontUpdateAutotoolsGnuConfigScripts = true; cargoVendorDir = "vendor"; + buildAndTestSubdir = "src/tools/rls"; + preBuild = '' - pushd src/tools/rls # client tests are flaky rm tests/client.rs ''; @@ -23,18 +24,21 @@ rustPlatform.buildRustPackage { CARGO_BUILD_RUSTFLAGS = if stdenv.isDarwin then "-C rpath" else null; nativeBuildInputs = [ pkgconfig cmake ]; - buildInputs = [ openssh openssl curl zlib libiconv rustPlatform.rust.rustc.llvm ] + buildInputs = [ openssh openssl curl zlib libiconv makeWrapper rustPlatform.rust.rustc.llvm ] ++ (stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation Security ]); doCheck = true; - preInstall = "popd"; - doInstallCheck = true; installCheckPhase = '' $out/bin/rls --version ''; + RUST_SRC_PATH = rustPlatform.rustcSrc; + postInstall = '' + wrapProgram $out/bin/rls --set-default RUST_SRC_PATH ${rustPlatform.rustcSrc} + ''; + meta = with stdenv.lib; { description = "Rust Language Server - provides information about Rust programs to IDEs and other tools"; homepage = "https://github.com/rust-lang/rls/"; diff --git a/pkgs/development/compilers/rust/rustfmt.nix b/pkgs/development/compilers/rust/rustfmt.nix index f8ed0bce2e0d..66a18f40ad42 100644 --- a/pkgs/development/compilers/rust/rustfmt.nix +++ b/pkgs/development/compilers/rust/rustfmt.nix @@ -6,8 +6,7 @@ rustPlatform.buildRustPackage rec { # the rust source tarball already has all the dependencies vendored, no need to fetch them again cargoVendorDir = "vendor"; - preBuild = "pushd src/tools/rustfmt"; - preInstall = "popd"; + buildAndTestSubdir = "src/tools/rustfmt"; # changes hash of vendor directory otherwise dontUpdateAutotoolsGnuConfigScripts = true; @@ -17,12 +16,6 @@ rustPlatform.buildRustPackage rec { # As of 1.0.0 and rustc 1.30 rustfmt requires a nightly compiler RUSTC_BOOTSTRAP = 1; - # we run tests in debug mode so tests look for a debug build of - # rustfmt. Anyway this adds nearly no compilation time. - preCheck = '' - cargo build - ''; - meta = with stdenv.lib; { description = "A tool for formatting Rust code according to style guidelines"; homepage = "https://github.com/rust-lang-nursery/rustfmt"; |