summary refs log tree commit diff
path: root/pkgs/development/compilers/rust
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/rust')
-rw-r--r--pkgs/development/compilers/rust/binaryBuild.nix14
-rw-r--r--pkgs/development/compilers/rust/bootstrap.nix16
-rw-r--r--pkgs/development/compilers/rust/cargo.nix20
-rw-r--r--pkgs/development/compilers/rust/default.nix23
-rw-r--r--pkgs/development/compilers/rust/patches/aarch64-disable-test_loading_cosine.patch6
-rw-r--r--pkgs/development/compilers/rust/rustc.nix19
6 files changed, 42 insertions, 56 deletions
diff --git a/pkgs/development/compilers/rust/binaryBuild.nix b/pkgs/development/compilers/rust/binaryBuild.nix
index 6c6f6b55e1e..1904c12dfdc 100644
--- a/pkgs/development/compilers/rust/binaryBuild.nix
+++ b/pkgs/development/compilers/rust/binaryBuild.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, cacert, zlib, buildRustPackage, curl, darwin
+{ stdenv, fetchurl, makeWrapper, bash, cacert, zlib, buildRustPackage, curl, darwin
 , version
 , src
 , platform
@@ -34,9 +34,11 @@ rec {
       license = [ licenses.mit licenses.asl20 ];
     };
 
-    phases = ["unpackPhase" "installPhase" "fixupPhase"];
+    buildInputs = [ bash ] ++ stdenv.lib.optional stdenv.isDarwin Security;
 
-    buildInputs = stdenv.lib.optional stdenv.isDarwin Security;
+    postPatch = ''
+      patchShebangs .
+    '';
 
     installPhase = ''
       ./install.sh --prefix=$out \
@@ -86,9 +88,11 @@ rec {
       license = [ licenses.mit licenses.asl20 ];
     };
 
-    phases = ["unpackPhase" "installPhase" "fixupPhase"];
+    buildInputs = [ makeWrapper bash ] ++ stdenv.lib.optional stdenv.isDarwin Security;
 
-    buildInputs = [ makeWrapper ] ++ stdenv.lib.optional stdenv.isDarwin Security;
+    postPatch = ''
+      patchShebangs .
+    '';
 
     installPhase = ''
       patchShebangs ./install.sh
diff --git a/pkgs/development/compilers/rust/bootstrap.nix b/pkgs/development/compilers/rust/bootstrap.nix
index 034334f5850..9b488bab5b3 100644
--- a/pkgs/development/compilers/rust/bootstrap.nix
+++ b/pkgs/development/compilers/rust/bootstrap.nix
@@ -3,16 +3,16 @@
 let
   # Note: the version MUST be one version prior to the version we're
   # building
-  version = "1.21.0";
+  version = "1.23.0";
 
-  # fetch hashes by running `print-hashes.sh 1.21.0`
+  # fetch hashes by running `print-hashes.sh 1.23.0`
   hashes = {
-    i686-unknown-linux-gnu = "b7caed0f602cdb8ef22e0bfa9125a65bec411e15c0b8901d937e43303ec7dbee";
-    x86_64-unknown-linux-gnu = "b41e70e018402bc04d02fde82f91bea24428e6be432f0df12ac400cfb03108e8";
-    armv7-unknown-linux-gnueabihf = "416fa6f107ad9e386002e6af1aec495472e2ee489c842183dd429a25b07488d6";
-    aarch64-unknown-linux-gnu = "491ee6c43cc672006968d665bd34c94cc2219ef3592d93d38097c97eaaa864c3";
-    i686-apple-darwin = "c8b0fabeebcde66b683f3a871187e614e07305adda414c2862cb332aecb2b3bf";
-    x86_64-apple-darwin = "75a7f4bd7c72948030bb9e421df27e8a650dea826fb5b836cf59d23d6f985a0d";
+    i686-unknown-linux-gnu = "dc5bd0ef47e1036c8ca64676d8967102cb86ce4bf50b90a9845951c3e940423f";
+    x86_64-unknown-linux-gnu = "9a34b23a82d7f3c91637e10ceefb424539dcfa327c2dcd292ff10c047b1fdc7e";
+    armv7-unknown-linux-gnueabihf = "587027899267f1961520438c2c7f6775fe224160d43ddf07332b9b943a26b08e";
+    aarch64-unknown-linux-gnu = "38379fbd976d2286cb73f21466db40a636a583b9f8a80af5eea73617c7912bc7";
+    i686-apple-darwin = "4709eb1ad2fb871fdaee4b3449569cef366b0d170453cf17484a12286564f2ad";
+    x86_64-apple-darwin = "9274e977322bb4b153f092255ac9bd85041142c73eaabf900cb2ef3d3abb2eba";
   };
 
   platform =
diff --git a/pkgs/development/compilers/rust/cargo.nix b/pkgs/development/compilers/rust/cargo.nix
index 4c397c8c1a4..fecf80a4485 100644
--- a/pkgs/development/compilers/rust/cargo.nix
+++ b/pkgs/development/compilers/rust/cargo.nix
@@ -1,7 +1,8 @@
 { stdenv, fetchFromGitHub, file, curl, pkgconfig, python, openssl, cmake, zlib
 , makeWrapper, libiconv, cacert, rustPlatform, rustc, libgit2, darwin
-, version, srcSha, cargoSha256
-, patches ? [] }:
+, version
+, patches ? []
+, src }:
 
 let
   inherit (darwin.apple_sdk.frameworks) CoreFoundation;
@@ -9,17 +10,12 @@ in
 
 rustPlatform.buildRustPackage rec {
   name = "cargo-${version}";
-  inherit version;
+  inherit version src patches;
 
-  src = fetchFromGitHub {
-    owner  = "rust-lang";
-    repo   = "cargo";
-    rev    = version;
-    sha256 = srcSha;
-  };
-
-  inherit cargoSha256;
-  inherit patches;
+  # the rust source tarball already has all the dependencies vendored, no need to fetch them again
+  cargoVendorDir = "src/vendor";
+  preBuild = "cd src; pushd tools/cargo";
+  postBuild = "popd";
 
   passthru.rustc = rustc;
 
diff --git a/pkgs/development/compilers/rust/default.nix b/pkgs/development/compilers/rust/default.nix
index 413751cf255..dd15580c11b 100644
--- a/pkgs/development/compilers/rust/default.nix
+++ b/pkgs/development/compilers/rust/default.nix
@@ -6,21 +6,20 @@
 
 let
   rustPlatform = recurseIntoAttrs (makeRustPlatform (callPackage ./bootstrap.nix {}));
-  version = "1.22.1";
-in
-rec {
+  version = "1.24.0";
+  cargoVersion = "0.24.0";
+  src = fetchurl {
+    url = "https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz";
+    sha256 = "17v3jpyky8vkkgai5yd2zr8zl87qpgj6dx99gx27x1sf0kv7d0mv";
+  };
+in rec {
   rustc = callPackage ./rustc.nix {
-    inherit stdenv llvm targets targetPatches targetToolchains rustPlatform version;
+    inherit stdenv llvm targets targetPatches targetToolchains rustPlatform version src;
 
     forceBundledLLVM = true;
 
     configureFlags = [ "--release-channel=stable" ];
 
-    src = fetchurl {
-      url = "https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz";
-      sha256 = "1lrzzp0nh7s61wgfs2h6ilaqi6iq89f1pd1yaf65l87bssyl4ylb";
-    };
-
     patches = [
       ./patches/0001-Disable-fragile-tests-libstd-net-tcp-on-Darwin-Linux.patch
     ] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch
@@ -30,10 +29,8 @@ rec {
   };
 
   cargo = callPackage ./cargo.nix rec {
-    version = "0.23.0";
-    srcSha = "14b2n1msxma19ydchj54hd7f2zdsr524fg133dkmdn7j65f1x6aj";
-    cargoSha256 = "1sj59z0w172qvjwg1ma5fr5am9dgw27086xwdnrvlrk4hffcr7y7";
-
+    version = cargoVersion;
+    inherit src;
     inherit stdenv;
     inherit rustc; # the rustc that will be wrapped by cargo
     inherit rustPlatform; # used to build cargo
diff --git a/pkgs/development/compilers/rust/patches/aarch64-disable-test_loading_cosine.patch b/pkgs/development/compilers/rust/patches/aarch64-disable-test_loading_cosine.patch
index d29eb16cfe5..bafab0e9ef7 100644
--- a/pkgs/development/compilers/rust/patches/aarch64-disable-test_loading_cosine.patch
+++ b/pkgs/development/compilers/rust/patches/aarch64-disable-test_loading_cosine.patch
@@ -1,7 +1,7 @@
-diff --git a/src/librustc_back/dynamic_lib.rs b/src/librustc_back/dynamic_lib.rs
+diff --git a/src/librustc_metadata/dynamic_lib.rs b/src/librustc_metadata/dynamic_lib.rs
 index 1b42fa0..92256dc 100644
---- a/src/librustc_back/dynamic_lib.rs
-+++ b/src/librustc_back/dynamic_lib.rs
+--- a/src/librustc_metadata/dynamic_lib.rs
++++ b/src/librustc_metadata/dynamic_lib.rs
 @@ -80,6 +80,7 @@ mod tests {
      use std::mem;
  
diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix
index efed388ce4c..92b149865fa 100644
--- a/pkgs/development/compilers/rust/rustc.nix
+++ b/pkgs/development/compilers/rust/rustc.nix
@@ -57,9 +57,9 @@ stdenv.mkDerivation {
   # We need rust to build rust. If we don't provide it, configure will try to download it.
   configureFlags = configureFlags
                 ++ [ "--enable-local-rust" "--local-rust-root=${rustPlatform.rust.rustc}" "--enable-rpath" ]
-                ++ [ "--enable-vendor" "--disable-locked-deps" ]
+                ++ [ "--enable-vendor" ]
                 # ++ [ "--jemalloc-root=${jemalloc}/lib"
-                ++ [ "--default-linker=${targetPackages.stdenv.cc}/bin/cc" "--default-ar=${targetPackages.stdenv.cc.bintools}/bin/ar" ]
+                ++ [ "--default-linker=${targetPackages.stdenv.cc}/bin/cc" ]
                 ++ optional (!forceBundledLLVM) [ "--enable-llvm-link-shared" ]
                 ++ optional (targets != []) "--target=${target}"
                 ++ optional (!forceBundledLLVM) "--llvm-root=${llvmShared}";
@@ -72,6 +72,8 @@ stdenv.mkDerivation {
   passthru.target = target;
 
   postPatch = ''
+    patchShebangs src/etc
+
     # Fix dynamic linking against llvm
     #${optionalString (!forceBundledLLVM) ''sed -i 's/, kind = \\"static\\"//g' src/etc/mklldeps.py''}
 
@@ -98,19 +100,6 @@ stdenv.mkDerivation {
     # On Hydra: `TcpListener::bind(&addr)`: Address already in use (os error 98)'
     sed '/^ *fn fast_rebind()/i#[ignore]' -i src/libstd/net/tcp.rs
 
-    # Disable some failing gdb tests. Try re-enabling these when gdb
-    # is updated past version 7.12.
-    rm src/test/debuginfo/basic-types-globals.rs
-    rm src/test/debuginfo/basic-types-mut-globals.rs
-    rm src/test/debuginfo/c-style-enum.rs
-    rm src/test/debuginfo/lexical-scopes-in-block-expression.rs
-    rm src/test/debuginfo/limited-debuginfo.rs
-    rm src/test/debuginfo/simple-struct.rs
-    rm src/test/debuginfo/simple-tuple.rs
-    rm src/test/debuginfo/union-smoke.rs
-    rm src/test/debuginfo/vec-slices.rs
-    rm src/test/debuginfo/vec.rs
-
     # Useful debugging parameter
     # export VERBOSE=1
   ''