lol

Merge pull request #26275 from anderspapitto/rust-updates

rust: 1.15.0 -> 1.17.0

authored by

Daiderd Jordan and committed by
GitHub
a3317da9 86da6d44

+283 -288
+33
pkgs/applications/networking/browsers/firefox/cargo-fix.patch
··· 1 + diff --git a/media/libstagefright/binding/mp4parse-cargo.patch b/media/libstagefright/binding/mp4parse-cargo.patch 2 + index 1dd13d2..f98b722 100644 3 + --- a/media/libstagefright/binding/mp4parse-cargo.patch 4 + +++ b/media/libstagefright/binding/mp4parse-cargo.patch 5 + @@ -27,12 +27,13 @@ diff --git a/media/libstagefright/binding/mp4parse_capi/Cargo.toml b/media/libst 6 + index aeeebc65..5c0836a 100644 7 + --- a/media/libstagefright/binding/mp4parse_capi/Cargo.toml 8 + +++ b/media/libstagefright/binding/mp4parse_capi/Cargo.toml 9 + -@@ -18,18 +18,10 @@ exclude = [ 10 + +@@ -18,17 +18,12 @@ exclude = [ 11 + "*.mp4", 12 + ] 13 + 14 + -build = "build.rs" 15 + -- 16 + ++build = false 17 + ++ 18 + [dependencies] 19 + byteorder = "1.0.0" 20 + "mp4parse" = {version = "0.6.0", path = "../mp4parse"} 21 + diff --git a/media/libstagefright/binding/mp4parse_capi/Cargo.toml b/media/libstagefright/binding/mp4parse_capi/Cargo.toml 22 + index aee7ee9..d7e3f55 100644 23 + --- a/media/libstagefright/binding/mp4parse_capi/Cargo.toml 24 + +++ b/media/libstagefright/binding/mp4parse_capi/Cargo.toml 25 + @@ -18,6 +18,8 @@ exclude = [ 26 + "*.mp4", 27 + ] 28 + 29 + +build = false 30 + + 31 + [dependencies] 32 + byteorder = "1.0.0" 33 + "mp4parse" = {version = "0.6.0", path = "../mp4parse"}
+2
pkgs/applications/networking/browsers/firefox/packages.nix
··· 12 12 sha512 = "cef5de1e9d6ddf6509a80cd30169fdce701b2fed022979ba5931ccea7b8f77cb644b01984dae028d350e32321cfe2eefc0236c0731bf5a2be12a994fc3fc1118"; 13 13 }; 14 14 15 + patches = [ ./cargo-fix.patch ]; 16 + 15 17 meta = { 16 18 description = "A web browser built from Firefox source tree"; 17 19 homepage = http://www.mozilla.com/en-US/firefox/;
+26 -45
pkgs/development/compilers/rust/beta.nix
··· 1 - { stdenv, callPackage, rustPlatform, cacert, gdb, 2 - targets ? [], targetToolchains ? [], targetPatches ? [] }: 1 + { stdenv, callPackage, recurseIntoAttrs, makeRustPlatform, llvm, fetchurl 2 + , targets ? [] 3 + , targetToolchains ? [] 4 + , targetPatches ? [] 5 + }: 3 6 7 + let 8 + rustPlatform = recurseIntoAttrs (makeRustPlatform (callPackage ./bootstrap.nix {})); 9 + in 4 10 rec { 5 - rustc = stdenv.lib.overrideDerivation (callPackage ./rustc.nix { 6 - shortVersion = "beta-2017-01-07"; 7 - forceBundledLLVM = true; # TODO: figure out why linking fails without this 11 + rustc = callPackage ./rustc.nix { 12 + inherit llvm targets targetPatches targetToolchains rustPlatform; 13 + 14 + version = "beta-2017-05-27"; 15 + 8 16 configureFlags = [ "--release-channel=beta" ]; 9 - srcRev = "a035041ba450ce3061d78a2bdb9c446eb5321d0d"; 10 - srcSha = "12xsm0yp1y39fvf9j218gxv73j8hhahc53jyv3q58kiriyqvfc1s"; 17 + 18 + src = fetchurl { 19 + url = "https://static.rust-lang.org/dist/2017-05-27/rustc-beta-src.tar.gz"; 20 + sha256 = "9f3f92efef7fb2b4bf38e57e4ff1f416dc221880b90841c4bdaee350801c0b57"; 21 + }; 22 + 11 23 patches = [ 12 - ./patches/disable-lockfile-check-nightly.patch 24 + ./patches/darwin-disable-fragile-tcp-tests.patch 13 25 ] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch; 14 - inherit targets; 15 - inherit targetPatches; 16 - inherit targetToolchains; 17 - inherit rustPlatform; 18 - }) (oldAttrs: { 19 - nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ gdb rustPlatform.rust.cargo ]; 20 - postUnpack = '' 21 - export CARGO_HOME="$(realpath deps)" 22 - export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt 23 - ''; 24 - postPatch = '' 25 - ${oldAttrs.postPatch} 26 26 27 - # Remove failing debuginfo tests because of old gdb version: https://github.com/rust-lang/rust/issues/38948#issuecomment-271443596 28 - rm -vr src/test/debuginfo/borrowed-enum.rs || true 29 - rm -vr src/test/debuginfo/generic-struct-style-enum.rs || true 30 - rm -vr src/test/debuginfo/generic-tuple-style-enum.rs || true 31 - rm -vr src/test/debuginfo/packed-struct.rs || true 32 - rm -vr src/test/debuginfo/recursive-struct.rs || true 33 - rm -vr src/test/debuginfo/struct-in-enum.rs || true 34 - rm -vr src/test/debuginfo/struct-style-enum.rs || true 35 - rm -vr src/test/debuginfo/tuple-style-enum.rs || true 36 - rm -vr src/test/debuginfo/union-smoke.rs || true 37 - rm -vr src/test/debuginfo/unique-enum.rs || true 38 - 39 - # make external cargo work until https://github.com/rust-lang/rust/issues/38950 is fixed 40 - sed -i "s# def cargo(self):# def cargo(self):\n return \"${rustPlatform.rust.cargo}/bin/cargo\"#g" src/bootstrap/bootstrap.py 41 - substituteInPlace \ 42 - src/bootstrap/config.rs \ 43 - --replace \ 44 - 'self.cargo = Some(push_exe_path(path, &["bin", "cargo"]));' \ 45 - ''$'self.cargo = Some(\n "${rustPlatform.rust.cargo}\\\n /bin/cargo".into());' 46 - ''; 47 - }); 27 + doCheck = false; 28 + }; 48 29 49 30 cargo = callPackage ./cargo.nix rec { 50 - version = "beta-2017-01-10"; 51 - srcRev = "6dd4ff0f5b59fff524762c4a7b65882adda713c0"; 52 - srcSha = "1x6d42qq2zhr1iaw0m0nslhv6c1w6x6schmd96max0p9xb47l9zj"; 53 - depsSha256 = "1sywnhzgambmqsjs2xlnzracfv7vjljha55hgf8wca2marafr5dp"; 31 + version = "0.18.0"; 32 + srcRev = "fe7b0cdcf5ca7aab81630706ce40b70f6aa2e666"; 33 + srcSha = "164iywv1l3v87b0pznf5kkzxigd6w19myv9d7ka4c65zgrk9n9px"; 34 + depsSha256 = "1mrgd8ib48vxxbhkvsqqq4p19sc6b74x3cd8p6lhhlm6plrajrvm"; 54 35 55 36 inherit rustc; # the rustc that will be wrapped by cargo 56 37 inherit rustPlatform; # used to build cargo
+99
pkgs/development/compilers/rust/binaryBuild.nix
··· 1 + { stdenv, fetchurl, makeWrapper, cacert, zlib, buildRustPackage, curl 2 + , version 3 + , src 4 + , platform 5 + , versionType 6 + }: 7 + 8 + let 9 + inherit (stdenv.lib) optionalString; 10 + 11 + needsPatchelf = stdenv.isLinux; 12 + 13 + bootstrapping = versionType == "bootstrap"; 14 + 15 + installComponents 16 + = "rustc,rust-std-${platform}" 17 + + (optionalString bootstrapping ",rust-docs,cargo") 18 + ; 19 + in 20 + 21 + rec { 22 + inherit buildRustPackage; 23 + 24 + rustc = stdenv.mkDerivation rec { 25 + name = "rustc-${versionType}-${version}"; 26 + 27 + inherit version; 28 + inherit src; 29 + 30 + meta = with stdenv.lib; { 31 + homepage = http://www.rust-lang.org/; 32 + description = "A safe, concurrent, practical language"; 33 + maintainers = with maintainers; [ qknight ]; 34 + license = [ licenses.mit licenses.asl20 ]; 35 + }; 36 + 37 + phases = ["unpackPhase" "installPhase"]; 38 + 39 + installPhase = '' 40 + ./install.sh --prefix=$out \ 41 + --components=${installComponents} 42 + 43 + ${optionalString (needsPatchelf && bootstrapping) '' 44 + patchelf \ 45 + --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 46 + "$out/bin/rustdoc" 47 + patchelf \ 48 + --set-rpath "${stdenv.lib.makeLibraryPath [ curl zlib ]}" \ 49 + --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 50 + "$out/bin/cargo" 51 + ''} 52 + 53 + ${optionalString needsPatchelf '' 54 + patchelf \ 55 + --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 56 + "$out/bin/rustc" 57 + 58 + # Do NOT, I repeat, DO NOT use `wrapProgram` on $out/bin/rustc 59 + # (or similar) here. It causes strange effects where rustc loads 60 + # the wrong libraries in a bootstrap-build causing failures that 61 + # are very hard to track dow. For details, see 62 + # https://github.com/rust-lang/rust/issues/34722#issuecomment-232164943 63 + ''} 64 + ''; 65 + 66 + }; 67 + 68 + cargo = stdenv.mkDerivation rec { 69 + name = "cargo-${versionType}-${version}"; 70 + 71 + inherit version; 72 + inherit src; 73 + 74 + meta = with stdenv.lib; { 75 + homepage = http://www.rust-lang.org/; 76 + description = "A safe, concurrent, practical language"; 77 + maintainers = with maintainers; [ qknight ]; 78 + license = [ licenses.mit licenses.asl20 ]; 79 + }; 80 + 81 + buildInputs = [ makeWrapper ]; 82 + phases = ["unpackPhase" "installPhase"]; 83 + 84 + installPhase = '' 85 + ./install.sh --prefix=$out \ 86 + --components=cargo 87 + 88 + ${optionalString needsPatchelf '' 89 + patchelf \ 90 + --set-rpath "${stdenv.lib.makeLibraryPath [ curl zlib ]}" \ 91 + --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 92 + "$out/bin/cargo" 93 + ''} 94 + 95 + wrapProgram "$out/bin/cargo" \ 96 + --suffix PATH : "${rustc}/bin" 97 + ''; 98 + }; 99 + }
+13 -65
pkgs/development/compilers/rust/bootstrap.nix
··· 1 - { stdenv, fetchurl, makeWrapper, cacert, zlib }: 1 + { stdenv, fetchurl, makeWrapper, cacert, zlib, curl }: 2 2 3 3 let 4 - inherit (stdenv.lib) optionalString; 5 - 6 4 platform = 7 5 if stdenv.system == "i686-linux" 8 6 then "i686-unknown-linux-gnu" ··· 14 12 then "x86_64-apple-darwin" 15 13 else throw "missing bootstrap url for platform ${stdenv.system}"; 16 14 17 - # fetch hashes by running `print-hashes.sh 1.14.0` 15 + # fetch hashes by running `print-hashes.sh 1.17.0` 18 16 bootstrapHash = 19 17 if stdenv.system == "i686-linux" 20 - then "8d5c75728b44468216f99651dfae9d60ae0696a77105dd2b02942d75f3256840" 18 + then "39d16ce0f618ba37ee1024b83e4822a2d38e6ba9f341ff2020d34df94c7a6beb" 21 19 else if stdenv.system == "x86_64-linux" 22 - then "c71325cfea1b6f0bdc5189fa4c50ff96f828096ff3f7b5056367f9685d6a4d04" 20 + then "bbb0e249a7a3e8143b569706c7d2e7e5f51932c753b7fd26c58ccd2015b02c6b" 23 21 else if stdenv.system == "i686-darwin" 24 - then "fe1b3d67329a22d67e3b8db8858a43022e2e746dde60ef4a2db3f2cac16ea9bd" 22 + then "308132b33d4002f95a725c2d31b975ff37905e3644894ed86e614b03ded70265" 25 23 else if stdenv.system == "x86_64-darwin" 26 - then "3381341524b0184da5ed2cdcddc2a25e2e335e87f1cf676f64d98ee5e6479f20" 24 + then "1689060c07ec727e9756f19c9373045668471ab56fd8f53e92701150bbe2032b" 27 25 else throw "missing bootstrap hash for platform ${stdenv.system}"; 28 26 29 - needsPatchelf = stdenv.isLinux; 30 - 31 27 src = fetchurl { 32 28 url = "https://static.rust-lang.org/dist/rust-${version}-${platform}.tar.gz"; 33 29 sha256 = bootstrapHash; 34 30 }; 35 31 36 - version = "1.14.0"; 37 - in 38 - 39 - rec { 40 - rustc = stdenv.mkDerivation rec { 41 - name = "rustc-bootstrap-${version}"; 42 - 43 - inherit version; 44 - inherit src; 45 - 46 - buildInputs = [ makeWrapper ]; 47 - phases = ["unpackPhase" "installPhase"]; 48 - 49 - installPhase = '' 50 - ./install.sh --prefix=$out \ 51 - --components=rustc,rust-std-${platform},rust-docs 52 - 53 - ${optionalString needsPatchelf '' 54 - patchelf \ 55 - --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 56 - "$out/bin/rustc" 57 - ''} 58 - 59 - # Do NOT, I repeat, DO NOT use `wrapProgram` on $out/bin/rustc 60 - # (or similar) here. It causes strange effects where rustc loads 61 - # the wrong libraries in a bootstrap-build causing failures that 62 - # are very hard to track dow. For details, see 63 - # https://github.com/rust-lang/rust/issues/34722#issuecomment-232164943 64 - ''; 65 - }; 66 - 67 - cargo = stdenv.mkDerivation rec { 68 - name = "cargo-bootstrap-${version}"; 69 - 70 - inherit version; 71 - inherit src; 72 - 73 - buildInputs = [ makeWrapper zlib rustc ]; 74 - phases = ["unpackPhase" "installPhase"]; 75 - 76 - installPhase = '' 77 - ./install.sh --prefix=$out \ 78 - --components=cargo 79 - 80 - ${optionalString needsPatchelf '' 81 - patchelf \ 82 - --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 83 - "$out/bin/cargo" 84 - ''} 85 - 86 - wrapProgram "$out/bin/cargo" \ 87 - --suffix PATH : "${rustc}/bin" 88 - ''; 89 - }; 90 - } 32 + version = "1.17.0"; 33 + in import ./binaryBuild.nix 34 + { inherit stdenv fetchurl makeWrapper cacert zlib curl; 35 + buildRustPackage = null; 36 + inherit version src platform; 37 + versionType = "bootstrap"; 38 + }
+13 -15
pkgs/development/compilers/rust/default.nix
··· 1 - { stdenv, callPackage, recurseIntoAttrs, makeRustPlatform, llvm 1 + { stdenv, callPackage, recurseIntoAttrs, makeRustPlatform, llvm, fetchurl 2 2 , targets ? [] 3 3 , targetToolchains ? [] 4 4 , targetPatches ? [] ··· 6 6 7 7 let 8 8 rustPlatform = recurseIntoAttrs (makeRustPlatform (callPackage ./bootstrap.nix {})); 9 + version = "1.17.0"; 9 10 in 10 11 rec { 11 12 rustc = callPackage ./rustc.nix { 12 - shortVersion = "1.15.1"; 13 - isRelease = true; 14 - forceBundledLLVM = false; 13 + inherit llvm targets targetPatches targetToolchains rustPlatform version; 14 + 15 15 configureFlags = [ "--release-channel=stable" ]; 16 - srcRev = "021bd294c039bd54aa5c4aa85bcdffb0d24bc892"; 17 - srcSha = "1dp7cjxj8nv960jxkq3p18agh9bpfb69ac14x284jmhwyksim3y7"; 16 + 17 + src = fetchurl { 18 + url = "https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"; 19 + sha256 = "4baba3895b75f2492df6ce5a28a916307ecd1c088dc1fd02dbfa8a8e86174f87"; 20 + }; 18 21 19 22 patches = [ 20 23 ./patches/darwin-disable-fragile-tcp-tests.patch 21 24 ] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch; 22 25 23 - inherit llvm; 24 - inherit targets; 25 - inherit targetPatches; 26 - inherit targetToolchains; 27 - inherit rustPlatform; 28 26 }; 29 27 30 28 cargo = callPackage ./cargo.nix rec { 31 - version = "0.16.0"; 32 - srcRev = "6e0c18cccc8b0c06fba8a8d76486f81a792fb420"; 33 - srcSha = "117ivvs9wz848mwf8bw797n10qpn77agd353z8b0hxgbxhpribya"; 34 - depsSha256 = "11s2xpgfhl4mb4wa2nk4mzsypr7m9daxxc7l0vraiz5cr77gk7qq"; 29 + version = "0.18.0"; 30 + srcRev = "fe7b0cdcf5ca7aab81630706ce40b70f6aa2e666"; 31 + srcSha = "164iywv1l3v87b0pznf5kkzxigd6w19myv9d7ka4c65zgrk9n9px"; 32 + depsSha256 = "1mrgd8ib48vxxbhkvsqqq4p19sc6b74x3cd8p6lhhlm6plrajrvm"; 35 33 36 34 inherit rustc; # the rustc that will be wrapped by cargo 37 35 inherit rustPlatform; # used to build cargo
+23 -45
pkgs/development/compilers/rust/nightly.nix
··· 1 - { stdenv, callPackage, rustPlatform, cacert, gdb, 2 - targets ? [], targetToolchains ? [], targetPatches ? [] }: 1 + { stdenv, callPackage, rustPlatform, llvm, fetchurl 2 + , targets ? [] 3 + , targetToolchains ? [] 4 + , targetPatches ? [] 5 + }: 3 6 4 7 rec { 5 - rustc = stdenv.lib.overrideDerivation (callPackage ./rustc.nix { 6 - shortVersion = "nightly-2017-01-10"; 7 - forceBundledLLVM = true; # TODO: figure out why linking fails without this 8 + rustc = callPackage ./rustc.nix { 9 + inherit llvm targets targetPatches targetToolchains rustPlatform; 10 + 11 + version = "nightly-2017-05-30"; 12 + 8 13 configureFlags = [ "--release-channel=nightly" ]; 9 - srcRev = "7bffede97cf58f7159e261eac592f9cf88ce209d"; 10 - srcSha = "1784jvsf9g03cglwask1zhjmba4ghycbin3rw0hmhb41cz2y4q8v"; 14 + 15 + src = fetchurl { 16 + url = "https://static.rust-lang.org/dist/2017-05-30/rustc-nightly-src.tar.gz"; 17 + sha256 = "90ce76db56a93f1b4532f2e62bbf12c243c4d156662b0d80c25319211ee7d0e0"; 18 + }; 19 + 11 20 patches = [ 12 - ./patches/disable-lockfile-check-nightly.patch 21 + ./patches/darwin-disable-fragile-tcp-tests.patch 13 22 ] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch; 14 - inherit targets; 15 - inherit targetPatches; 16 - inherit targetToolchains; 17 - inherit rustPlatform; 18 - }) (oldAttrs: { 19 - nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ gdb rustPlatform.rust.cargo ]; 20 - postUnpack = '' 21 - export CARGO_HOME="$(realpath deps)" 22 - export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt 23 - ''; 24 - postPatch = '' 25 - ${oldAttrs.postPatch} 26 23 27 - # Remove failing debuginfo tests because of old gdb version: https://github.com/rust-lang/rust/issues/38948#issuecomment-271443596 28 - rm -vr src/test/debuginfo/borrowed-enum.rs || true 29 - rm -vr src/test/debuginfo/generic-struct-style-enum.rs || true 30 - rm -vr src/test/debuginfo/generic-tuple-style-enum.rs || true 31 - rm -vr src/test/debuginfo/packed-struct.rs || true 32 - rm -vr src/test/debuginfo/recursive-struct.rs || true 33 - rm -vr src/test/debuginfo/struct-in-enum.rs || true 34 - rm -vr src/test/debuginfo/struct-style-enum.rs || true 35 - rm -vr src/test/debuginfo/tuple-style-enum.rs || true 36 - rm -vr src/test/debuginfo/union-smoke.rs || true 37 - rm -vr src/test/debuginfo/unique-enum.rs || true 38 - 39 - # make external cargo work until https://github.com/rust-lang/rust/issues/38950 is fixed 40 - sed -i "s# def cargo(self):# def cargo(self):\n return \"${rustPlatform.rust.cargo}/bin/cargo\"#g" src/bootstrap/bootstrap.py 41 - substituteInPlace \ 42 - src/bootstrap/config.rs \ 43 - --replace \ 44 - 'self.cargo = Some(push_exe_path(path, &["bin", "cargo"]));' \ 45 - ''$'self.cargo = Some(\n "${rustPlatform.rust.cargo}\\\n /bin/cargo".into());' 46 - ''; 47 - }); 24 + doCheck = false; 25 + }; 48 26 49 27 cargo = callPackage ./cargo.nix rec { 50 - version = "nightly-2017-01-10"; 51 - srcRev = "6dd4ff0f5b59fff524762c4a7b65882adda713c0"; 52 - srcSha = "1x6d42qq2zhr1iaw0m0nslhv6c1w6x6schmd96max0p9xb47l9zj"; 53 - depsSha256 = "1sywnhzgambmqsjs2xlnzracfv7vjljha55hgf8wca2marafr5dp"; 28 + version = "0.18.0"; 29 + srcRev = "fe7b0cdcf5ca7aab81630706ce40b70f6aa2e666"; 30 + srcSha = "164iywv1l3v87b0pznf5kkzxigd6w19myv9d7ka4c65zgrk9n9px"; 31 + depsSha256 = "1mrgd8ib48vxxbhkvsqqq4p19sc6b74x3cd8p6lhhlm6plrajrvm"; 54 32 55 33 inherit rustc; # the rustc that will be wrapped by cargo 56 34 inherit rustPlatform; # used to build cargo
+7 -71
pkgs/development/compilers/rust/nightlyBin.nix
··· 1 1 { stdenv, fetchurl, makeWrapper, cacert, zlib, buildRustPackage, curl }: 2 2 3 3 let 4 - inherit (stdenv.lib) optionalString; 5 - 6 4 platform = if stdenv.system == "x86_64-linux" 7 5 then "x86_64-unknown-linux-gnu" 8 6 else throw "missing bootstrap url for platform ${stdenv.system}"; 9 7 10 8 bootstrapHash = 11 9 if stdenv.system == "x86_64-linux" 12 - then "1d5h34dkm1r1ff562szygn9xk2qll1pjryvypl0lazzanxdh5gv5" 10 + then "21f38f46bf16373d3240a38b775e1acff9bb429f1570a4d4da8b3000315d0085" 13 11 else throw "missing bootstrap hash for platform ${stdenv.system}"; 14 12 15 - needsPatchelf = stdenv.isLinux; 16 - 17 13 src = fetchurl { 18 14 url = "https://static.rust-lang.org/dist/${version}/rust-nightly-${platform}.tar.gz"; 19 15 sha256 = bootstrapHash; 20 16 }; 21 17 22 - version = "2017-03-16"; 23 - in 24 - 25 - rec { 26 - inherit buildRustPackage; 27 - 28 - rustc = stdenv.mkDerivation rec { 29 - name = "rustc-nightly-${version}"; 30 - 31 - inherit version; 32 - inherit src; 33 - 34 - meta = with stdenv.lib; { 35 - homepage = http://www.rust-lang.org/; 36 - description = "A safe, concurrent, practical language"; 37 - maintainers = with maintainers; [ qknight ]; 38 - license = [ licenses.mit licenses.asl20 ]; 39 - }; 40 - 41 - buildInputs = [ makeWrapper ]; 42 - phases = ["unpackPhase" "installPhase"]; 43 - 44 - installPhase = '' 45 - ./install.sh --prefix=$out \ 46 - --components=rustc,rust-std-x86_64-unknown-linux-gnu 47 - 48 - ${optionalString needsPatchelf '' 49 - patchelf \ 50 - --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 51 - "$out/bin/rustc" 52 - patchelf \ 53 - --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 54 - "$out/bin/rustdoc" 55 - ''} 56 - ''; 57 - 58 - }; 59 - cargo = stdenv.mkDerivation rec { 60 - name = "cargo-nightly-${version}"; 61 - 62 - inherit version; 63 - inherit src; 64 - 65 - meta = with stdenv.lib; { 66 - homepage = http://www.rust-lang.org/; 67 - description = "A safe, concurrent, practical language"; 68 - maintainers = with maintainers; [ qknight ]; 69 - license = [ licenses.mit licenses.asl20 ]; 70 - }; 71 - 72 - buildInputs = [ makeWrapper curl ]; 73 - phases = ["unpackPhase" "installPhase"]; 74 - 75 - installPhase = '' 76 - ./install.sh --prefix=$out \ 77 - --components=cargo 78 - 79 - ${optionalString needsPatchelf '' 80 - patchelf \ 81 - --set-rpath "${stdenv.lib.makeLibraryPath [ curl zlib ]}" \ 82 - --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 83 - "$out/bin/cargo" 84 - ''} 85 - ''; 86 - }; 87 - } 18 + version = "2017-05-30"; 19 + in import ./binaryBuild.nix 20 + { inherit stdenv fetchurl makeWrapper cacert zlib buildRustPackage curl; 21 + inherit version src platform; 22 + versionType = "nightly"; 23 + }
+16 -3
pkgs/development/compilers/rust/print-hashes.sh
··· 1 - #!/bin/sh 1 + #!/usr/bin/env bash 2 + 3 + # All rust-related downloads can be found at 4 + # https://static.rust-lang.org/dist/index.html. To find the date on 5 + # which a particular thing was last updated, look for the *-date.txt 6 + # file, e.g. 7 + # https://static.rust-lang.org/dist/channel-rust-beta-date.txt 2 8 3 9 PLATFORMS="i686-unknown-linux-gnu x86_64-unknown-linux-gnu i686-apple-darwin x86_64-apple-darwin" 4 10 BASEURL="https://static.rust-lang.org/dist" 5 - VERSION=$1 11 + DATE=$1 12 + VERSION=$2 13 + 14 + if [[ -z $DATE ]] 15 + then 16 + echo "No date supplied" 17 + exit -1 18 + fi 6 19 7 20 if [[ -z $VERSION ]] 8 21 then ··· 12 25 13 26 for PLATFORM in $PLATFORMS 14 27 do 15 - URL="$BASEURL/rust-$VERSION-$PLATFORM.tar.gz.sha256" 28 + URL="$BASEURL/$DATE/rust-$VERSION-$PLATFORM.tar.gz.sha256" 16 29 curl $URL 17 30 done
+37 -37
pkgs/development/compilers/rust/rustc.nix
··· 1 1 { stdenv, fetchurl, fetchgit, fetchzip, file, python2, tzdata, procps 2 2 , llvm, jemalloc, ncurses, darwin, binutils, rustPlatform, git, cmake, curl 3 - 4 - , isRelease ? false 5 - , shortVersion 3 + , which, libffi, gdb 4 + , version 6 5 , forceBundledLLVM ? false 7 - , srcSha, srcRev 6 + , src 8 7 , configureFlags ? [] 9 8 , patches 10 9 , targets 11 10 , targetPatches 12 11 , targetToolchains 12 + , doCheck ? true 13 13 } @ args: 14 14 15 15 let 16 16 inherit (stdenv.lib) optional optionalString; 17 17 18 - version = if isRelease then 19 - "${shortVersion}" 20 - else 21 - "${shortVersion}-g${builtins.substring 0 7 srcRev}"; 22 - 23 18 procps = if stdenv.isDarwin then darwin.ps else args.procps; 24 19 25 20 llvmShared = llvm.override { enableSharedLibraries = true; }; ··· 31 26 stdenv.mkDerivation { 32 27 name = "rustc-${version}"; 33 28 inherit version; 29 + 30 + inherit src; 34 31 35 32 __impureHostDeps = [ "/usr/lib/libedit.3.dylib" ]; 36 33 ··· 45 42 # Increase codegen units to introduce parallelism within the compiler. 46 43 RUSTFLAGS = "-Ccodegen-units=10"; 47 44 48 - src = fetchgit { 49 - url = https://github.com/rust-lang/rust; 50 - rev = srcRev; 51 - sha256 = srcSha; 52 - }; 53 - 54 45 # We need rust to build rust. If we don't provide it, configure will try to download it. 55 46 configureFlags = configureFlags 56 47 ++ [ "--enable-local-rust" "--local-rust-root=${rustPlatform.rust.rustc}" "--enable-rpath" ] 48 + ++ [ "--enable-vendor" "--disable-locked-deps" ] 49 + ++ [ "--enable-llvm-link-shared" ] 57 50 # ++ [ "--jemalloc-root=${jemalloc}/lib" 58 51 ++ [ "--default-linker=${stdenv.cc}/bin/cc" "--default-ar=${binutils.out}/bin/ar" ] 59 - # TODO: Remove when fixed build with rustbuild 60 - ++ [ "--disable-rustbuild" ] 61 52 ++ optional (stdenv.cc.cc ? isClang) "--enable-clang" 62 53 ++ optional (targets != []) "--target=${target}" 63 54 ++ optional (!forceBundledLLVM) "--llvm-root=${llvmShared}"; ··· 67 58 passthru.target = target; 68 59 69 60 postPatch = '' 70 - substituteInPlace src/rust-installer/gen-install-script.sh \ 71 - --replace /bin/echo "$(type -P echo)" 72 - substituteInPlace src/rust-installer/gen-installer.sh \ 73 - --replace /bin/echo "$(type -P echo)" 74 - 75 - # Workaround for NixOS/nixpkgs#8676 76 - substituteInPlace mk/rustllvm.mk \ 77 - --replace "\$\$(subst /,//," "\$\$(subst /,/," 78 - 79 61 # Fix dynamic linking against llvm 80 - ${optionalString (!forceBundledLLVM) ''sed -i 's/, kind = \\"static\\"//g' src/etc/mklldeps.py''} 62 + #${optionalString (!forceBundledLLVM) ''sed -i 's/, kind = \\"static\\"//g' src/etc/mklldeps.py''} 81 63 82 64 # Fix the configure script to not require curl as we won't use it 83 65 sed -i configure \ ··· 98 80 # https://reviews.llvm.org/rL281650 99 81 rm -vr src/test/run-pass/issue-36474.rs || true 100 82 83 + # Disable some failing gdb tests. Try re-enabling these when gdb 84 + # is updated past version 7.12. 85 + rm src/test/debuginfo/basic-types-globals.rs 86 + rm src/test/debuginfo/basic-types-mut-globals.rs 87 + rm src/test/debuginfo/c-style-enum.rs 88 + rm src/test/debuginfo/lexical-scopes-in-block-expression.rs 89 + rm src/test/debuginfo/limited-debuginfo.rs 90 + rm src/test/debuginfo/simple-struct.rs 91 + rm src/test/debuginfo/simple-tuple.rs 92 + rm src/test/debuginfo/union-smoke.rs 93 + rm src/test/debuginfo/vec-slices.rs 94 + rm src/test/debuginfo/vec.rs 95 + 96 + # this can probably be removed when rust is updated beyond 1.17 97 + # fixes a warning in the test harness (I think?) which fails the build due 98 + # to strict warnings 99 + sed -i '/static_in_const/d' src/tools/compiletest/src/main.rs 100 + 101 101 # Useful debugging parameter 102 102 # export VERBOSE=1 103 - '' + 104 - # In src/compiler-rt/cmake/config-ix.cmake, the cmake build falls 105 - # back to darwin 10.4. This causes the OS name to be recorded as 106 - # "10.4" rather than the expected "osx". But mk/rt.mk expects the 107 - # built library name to have an "_osx" suffix on darwin. 108 - optionalString stdenv.isDarwin '' 109 - substituteInPlace mk/rt.mk --replace "_osx" "_10.4" 103 + '' 104 + + optionalString stdenv.isDarwin '' 105 + # Disable all lldb tests. 106 + # error: Can't run LLDB test because LLDB's python path is not set 107 + rm -vr src/test/debuginfo/* 110 108 ''; 111 109 112 110 preConfigure = '' ··· 120 118 dontUseCmakeConfigure = true; 121 119 122 120 # ps is needed for one of the test cases 123 - nativeBuildInputs = [ file python2 procps rustPlatform.rust.rustc git cmake ]; 121 + nativeBuildInputs = [ file python2 procps rustPlatform.rust.rustc git cmake 122 + which libffi gdb ]; 124 123 125 124 buildInputs = [ ncurses ] ++ targetToolchains 126 125 ++ optional (!forceBundledLLVM) llvmShared; ··· 141 140 sed -i '28s/home_dir().is_some()/true/' ./src/test/run-pass/env-home-dir.rs 142 141 ''; 143 142 144 - doCheck = true; 143 + inherit doCheck; 144 + 145 145 dontSetConfigureCross = true; 146 146 147 147 # https://github.com/NixOS/nixpkgs/pull/21742#issuecomment-272305764 ··· 151 151 meta = with stdenv.lib; { 152 152 homepage = http://www.rust-lang.org/; 153 153 description = "A safe, concurrent, practical language"; 154 - maintainers = with maintainers; [ madjar cstrahan wizeman globin havvy wkennington retrry ]; 154 + maintainers = with maintainers; [ madjar cstrahan wizeman globin havvy wkennington ]; 155 155 license = [ licenses.mit licenses.asl20 ]; 156 156 platforms = platforms.linux ++ platforms.darwin; 157 157 };
+11 -4
pkgs/top-level/all-packages.nix
··· 5749 5749 5750 5750 rust = rustStable; 5751 5751 rustStable = callPackage ../development/compilers/rust { 5752 - inherit (llvmPackages_39) llvm; 5752 + inherit (llvmPackages_4) llvm; 5753 5753 }; 5754 5754 rustBeta = lowPrio (recurseIntoAttrs (callPackage ../development/compilers/rust/beta.nix {})); 5755 - rustNightly = lowPrio (recurseIntoAttrs (callPackage ../development/compilers/rust/nightly.nix { 5756 - rustPlatform = recurseIntoAttrs (makeRustPlatform rustBeta); 5757 - })); 5755 + 5756 + rustNightly = rustBeta; 5757 + 5758 + # rust support in nixpkgs isn't yet well maintained enough for us to 5759 + # pretend to support nightlies in a meaningful way. 5760 + 5761 + # rustNightly = lowPrio (recurseIntoAttrs (callPackage ../development/compilers/rust/nightly.nix { 5762 + # rustPlatform = recurseIntoAttrs (makeRustPlatform rustBeta); 5763 + # })); 5764 + 5758 5765 rustNightlyBin = lowPrio (callPackage ../development/compilers/rust/nightlyBin.nix { 5759 5766 buildRustPackage = callPackage ../build-support/rust { 5760 5767 rust = rustNightlyBin;
+3 -3
pkgs/top-level/rust-packages.nix
··· 7 7 { runCommand, fetchFromGitHub, git }: 8 8 9 9 let 10 - version = "2017-05-15"; 11 - rev = "c73d61e84a623168a1a9bfff9c71defcc3416631"; 12 - sha256 = "0c2f4f48bacx0lq33bjw806fq5r4nvbrxvl74n7gd2y44ldafnir"; 10 + version = "2017-05-31"; 11 + rev = "d85037df75a945b5a368d6ceaa7e030b67473a51"; 12 + sha256 = "0567lfjxvbn4pb39557yfdq1nm4ssgbvzvzkrdqnx9sx5xyx7n4s"; 13 13 14 14 src = fetchFromGitHub { 15 15 inherit rev;