Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

rust: 1.22.1 -> 1.24.0

authored by Jörg Thalheim and committed by GitHub f61e8d98 e46553bc

+64 -64
+22 -8
pkgs/build-support/rust/default.nix
··· 4 4 inherit stdenv cacert git rust cargo-vendor; 5 5 }; 6 6 in 7 - { name, cargoSha256 7 + { name, cargoSha256 ? null 8 8 , src ? null 9 9 , srcs ? null 10 10 , sourceRoot ? null ··· 13 13 , cargoUpdateHook ? "" 14 14 , cargoDepsHook ? "" 15 15 , cargoBuildFlags ? [] 16 + 17 + , cargoVendorDir ? null 16 18 , ... } @ args: 17 19 20 + assert cargoVendorDir == null -> cargoSha256 != null; 21 + 18 22 let 19 23 lib = stdenv.lib; 20 24 21 - cargoDeps = fetchcargo { 22 - inherit name src srcs sourceRoot cargoUpdateHook; 23 - sha256 = cargoSha256; 24 - }; 25 + cargoDeps = if cargoVendorDir == null 26 + then fetchcargo { 27 + inherit name src srcs sourceRoot cargoUpdateHook; 28 + sha256 = cargoSha256; 29 + } 30 + else null; 31 + 32 + setupVendorDir = if cargoVendorDir == null 33 + then '' 34 + unpackFile "$cargoDeps" 35 + cargoDepsCopy=$(stripHash $(basename $cargoDeps)) 36 + chmod -R +w "$cargoDepsCopy" 37 + '' 38 + else '' 39 + cargoDepsCopy="$sourceRoot/${cargoVendorDir}" 40 + ''; 25 41 26 42 in stdenv.mkDerivation (args // { 27 43 inherit cargoDeps; ··· 39 55 postUnpack = '' 40 56 eval "$cargoDepsHook" 41 57 42 - unpackFile "$cargoDeps" 43 - cargoDepsCopy=$(stripHash $(basename $cargoDeps)) 44 - chmod -R +w "$cargoDepsCopy" 58 + ${setupVendorDir} 45 59 46 60 mkdir .cargo 47 61 cat >.cargo/config <<-EOF
+9 -5
pkgs/development/compilers/rust/binaryBuild.nix
··· 1 - { stdenv, fetchurl, makeWrapper, cacert, zlib, buildRustPackage, curl, darwin 1 + { stdenv, fetchurl, makeWrapper, bash, cacert, zlib, buildRustPackage, curl, darwin 2 2 , version 3 3 , src 4 4 , platform ··· 34 34 license = [ licenses.mit licenses.asl20 ]; 35 35 }; 36 36 37 - phases = ["unpackPhase" "installPhase" "fixupPhase"]; 37 + buildInputs = [ bash ] ++ stdenv.lib.optional stdenv.isDarwin Security; 38 38 39 - buildInputs = stdenv.lib.optional stdenv.isDarwin Security; 39 + postPatch = '' 40 + patchShebangs . 41 + ''; 40 42 41 43 installPhase = '' 42 44 ./install.sh --prefix=$out \ ··· 86 88 license = [ licenses.mit licenses.asl20 ]; 87 89 }; 88 90 89 - phases = ["unpackPhase" "installPhase" "fixupPhase"]; 91 + buildInputs = [ makeWrapper bash ] ++ stdenv.lib.optional stdenv.isDarwin Security; 90 92 91 - buildInputs = [ makeWrapper ] ++ stdenv.lib.optional stdenv.isDarwin Security; 93 + postPatch = '' 94 + patchShebangs . 95 + ''; 92 96 93 97 installPhase = '' 94 98 patchShebangs ./install.sh
+8 -8
pkgs/development/compilers/rust/bootstrap.nix
··· 3 3 let 4 4 # Note: the version MUST be one version prior to the version we're 5 5 # building 6 - version = "1.21.0"; 6 + version = "1.23.0"; 7 7 8 - # fetch hashes by running `print-hashes.sh 1.21.0` 8 + # fetch hashes by running `print-hashes.sh 1.23.0` 9 9 hashes = { 10 - i686-unknown-linux-gnu = "b7caed0f602cdb8ef22e0bfa9125a65bec411e15c0b8901d937e43303ec7dbee"; 11 - x86_64-unknown-linux-gnu = "b41e70e018402bc04d02fde82f91bea24428e6be432f0df12ac400cfb03108e8"; 12 - armv7-unknown-linux-gnueabihf = "416fa6f107ad9e386002e6af1aec495472e2ee489c842183dd429a25b07488d6"; 13 - aarch64-unknown-linux-gnu = "491ee6c43cc672006968d665bd34c94cc2219ef3592d93d38097c97eaaa864c3"; 14 - i686-apple-darwin = "c8b0fabeebcde66b683f3a871187e614e07305adda414c2862cb332aecb2b3bf"; 15 - x86_64-apple-darwin = "75a7f4bd7c72948030bb9e421df27e8a650dea826fb5b836cf59d23d6f985a0d"; 10 + i686-unknown-linux-gnu = "dc5bd0ef47e1036c8ca64676d8967102cb86ce4bf50b90a9845951c3e940423f"; 11 + x86_64-unknown-linux-gnu = "9a34b23a82d7f3c91637e10ceefb424539dcfa327c2dcd292ff10c047b1fdc7e"; 12 + armv7-unknown-linux-gnueabihf = "587027899267f1961520438c2c7f6775fe224160d43ddf07332b9b943a26b08e"; 13 + aarch64-unknown-linux-gnu = "38379fbd976d2286cb73f21466db40a636a583b9f8a80af5eea73617c7912bc7"; 14 + i686-apple-darwin = "4709eb1ad2fb871fdaee4b3449569cef366b0d170453cf17484a12286564f2ad"; 15 + x86_64-apple-darwin = "9274e977322bb4b153f092255ac9bd85041142c73eaabf900cb2ef3d3abb2eba"; 16 16 }; 17 17 18 18 platform =
+8 -12
pkgs/development/compilers/rust/cargo.nix
··· 1 1 { stdenv, fetchFromGitHub, file, curl, pkgconfig, python, openssl, cmake, zlib 2 2 , makeWrapper, libiconv, cacert, rustPlatform, rustc, libgit2, darwin 3 - , version, srcSha, cargoSha256 4 - , patches ? [] }: 3 + , version 4 + , patches ? [] 5 + , src }: 5 6 6 7 let 7 8 inherit (darwin.apple_sdk.frameworks) CoreFoundation; ··· 9 10 10 11 rustPlatform.buildRustPackage rec { 11 12 name = "cargo-${version}"; 12 - inherit version; 13 - 14 - src = fetchFromGitHub { 15 - owner = "rust-lang"; 16 - repo = "cargo"; 17 - rev = version; 18 - sha256 = srcSha; 19 - }; 13 + inherit version src patches; 20 14 21 - inherit cargoSha256; 22 - inherit patches; 15 + # the rust source tarball already has all the dependencies vendored, no need to fetch them again 16 + cargoVendorDir = "src/vendor"; 17 + preBuild = "cd src; pushd tools/cargo"; 18 + postBuild = "popd"; 23 19 24 20 passthru.rustc = rustc; 25 21
+10 -13
pkgs/development/compilers/rust/default.nix
··· 6 6 7 7 let 8 8 rustPlatform = recurseIntoAttrs (makeRustPlatform (callPackage ./bootstrap.nix {})); 9 - version = "1.22.1"; 10 - in 11 - rec { 9 + version = "1.24.0"; 10 + cargoVersion = "0.24.0"; 11 + src = fetchurl { 12 + url = "https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"; 13 + sha256 = "17v3jpyky8vkkgai5yd2zr8zl87qpgj6dx99gx27x1sf0kv7d0mv"; 14 + }; 15 + in rec { 12 16 rustc = callPackage ./rustc.nix { 13 - inherit llvm targets targetPatches targetToolchains rustPlatform version; 17 + inherit llvm targets targetPatches targetToolchains rustPlatform version src; 14 18 15 19 forceBundledLLVM = true; 16 20 17 21 configureFlags = [ "--release-channel=stable" ]; 18 22 19 - src = fetchurl { 20 - url = "https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"; 21 - sha256 = "1lrzzp0nh7s61wgfs2h6ilaqi6iq89f1pd1yaf65l87bssyl4ylb"; 22 - }; 23 - 24 23 patches = [ 25 24 ./patches/0001-Disable-fragile-tests-libstd-net-tcp-on-Darwin-Linux.patch 26 25 ] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch ··· 30 29 }; 31 30 32 31 cargo = callPackage ./cargo.nix rec { 33 - version = "0.23.0"; 34 - srcSha = "14b2n1msxma19ydchj54hd7f2zdsr524fg133dkmdn7j65f1x6aj"; 35 - cargoSha256 = "1sj59z0w172qvjwg1ma5fr5am9dgw27086xwdnrvlrk4hffcr7y7"; 36 - 32 + version = cargoVersion; 33 + inherit src; 37 34 inherit rustc; # the rustc that will be wrapped by cargo 38 35 inherit rustPlatform; # used to build cargo 39 36 };
+3 -3
pkgs/development/compilers/rust/patches/aarch64-disable-test_loading_cosine.patch
··· 1 - diff --git a/src/librustc_back/dynamic_lib.rs b/src/librustc_back/dynamic_lib.rs 1 + diff --git a/src/librustc_metadata/dynamic_lib.rs b/src/librustc_metadata/dynamic_lib.rs 2 2 index 1b42fa0..92256dc 100644 3 - --- a/src/librustc_back/dynamic_lib.rs 4 - +++ b/src/librustc_back/dynamic_lib.rs 3 + --- a/src/librustc_metadata/dynamic_lib.rs 4 + +++ b/src/librustc_metadata/dynamic_lib.rs 5 5 @@ -80,6 +80,7 @@ mod tests { 6 6 use std::mem; 7 7
+4 -15
pkgs/development/compilers/rust/rustc.nix
··· 57 57 # We need rust to build rust. If we don't provide it, configure will try to download it. 58 58 configureFlags = configureFlags 59 59 ++ [ "--enable-local-rust" "--local-rust-root=${rustPlatform.rust.rustc}" "--enable-rpath" ] 60 - ++ [ "--enable-vendor" "--disable-locked-deps" ] 60 + ++ [ "--enable-vendor" ] 61 61 # ++ [ "--jemalloc-root=${jemalloc}/lib" 62 - ++ [ "--default-linker=${targetPackages.stdenv.cc}/bin/cc" "--default-ar=${targetPackages.stdenv.cc.bintools}/bin/ar" ] 62 + ++ [ "--default-linker=${targetPackages.stdenv.cc}/bin/cc" ] 63 63 ++ optional (!forceBundledLLVM) [ "--enable-llvm-link-shared" ] 64 64 ++ optional (targets != []) "--target=${target}" 65 65 ++ optional (!forceBundledLLVM) "--llvm-root=${llvmShared}"; ··· 72 72 passthru.target = target; 73 73 74 74 postPatch = '' 75 + patchShebangs src/etc 76 + 75 77 # Fix dynamic linking against llvm 76 78 #${optionalString (!forceBundledLLVM) ''sed -i 's/, kind = \\"static\\"//g' src/etc/mklldeps.py''} 77 79 ··· 97 99 98 100 # On Hydra: `TcpListener::bind(&addr)`: Address already in use (os error 98)' 99 101 sed '/^ *fn fast_rebind()/i#[ignore]' -i src/libstd/net/tcp.rs 100 - 101 - # Disable some failing gdb tests. Try re-enabling these when gdb 102 - # is updated past version 7.12. 103 - rm src/test/debuginfo/basic-types-globals.rs 104 - rm src/test/debuginfo/basic-types-mut-globals.rs 105 - rm src/test/debuginfo/c-style-enum.rs 106 - rm src/test/debuginfo/lexical-scopes-in-block-expression.rs 107 - rm src/test/debuginfo/limited-debuginfo.rs 108 - rm src/test/debuginfo/simple-struct.rs 109 - rm src/test/debuginfo/simple-tuple.rs 110 - rm src/test/debuginfo/union-smoke.rs 111 - rm src/test/debuginfo/vec-slices.rs 112 - rm src/test/debuginfo/vec.rs 113 102 114 103 # Useful debugging parameter 115 104 # export VERBOSE=1