rust: 1.15.0 -> 1.17.0

Also updates beta, nightly, nightlyBin, and bootstrap compilers.
Also updates the registry.
Also consolidates logic between bootstrap and nightlyBin compilers.
Also contains some miscellaneous cleanups.
Also patches firefox to build with the newer cargo
This commit is contained in:
Anders Papitto
2017-06-10 15:15:50 -07:00
parent 53835c93cb
commit 1e0866e064
12 changed files with 277 additions and 288 deletions
+13 -65
View File
@@ -1,8 +1,6 @@
{ stdenv, fetchurl, makeWrapper, cacert, zlib }:
{ stdenv, fetchurl, makeWrapper, cacert, zlib, curl }:
let
inherit (stdenv.lib) optionalString;
platform =
if stdenv.system == "i686-linux"
then "i686-unknown-linux-gnu"
@@ -14,77 +12,27 @@ let
then "x86_64-apple-darwin"
else throw "missing bootstrap url for platform ${stdenv.system}";
# fetch hashes by running `print-hashes.sh 1.14.0`
# fetch hashes by running `print-hashes.sh 1.17.0`
bootstrapHash =
if stdenv.system == "i686-linux"
then "8d5c75728b44468216f99651dfae9d60ae0696a77105dd2b02942d75f3256840"
then "39d16ce0f618ba37ee1024b83e4822a2d38e6ba9f341ff2020d34df94c7a6beb"
else if stdenv.system == "x86_64-linux"
then "c71325cfea1b6f0bdc5189fa4c50ff96f828096ff3f7b5056367f9685d6a4d04"
then "bbb0e249a7a3e8143b569706c7d2e7e5f51932c753b7fd26c58ccd2015b02c6b"
else if stdenv.system == "i686-darwin"
then "fe1b3d67329a22d67e3b8db8858a43022e2e746dde60ef4a2db3f2cac16ea9bd"
then "308132b33d4002f95a725c2d31b975ff37905e3644894ed86e614b03ded70265"
else if stdenv.system == "x86_64-darwin"
then "3381341524b0184da5ed2cdcddc2a25e2e335e87f1cf676f64d98ee5e6479f20"
then "1689060c07ec727e9756f19c9373045668471ab56fd8f53e92701150bbe2032b"
else throw "missing bootstrap hash for platform ${stdenv.system}";
needsPatchelf = stdenv.isLinux;
src = fetchurl {
url = "https://static.rust-lang.org/dist/rust-${version}-${platform}.tar.gz";
sha256 = bootstrapHash;
};
version = "1.14.0";
in
rec {
rustc = stdenv.mkDerivation rec {
name = "rustc-bootstrap-${version}";
inherit version;
inherit src;
buildInputs = [ makeWrapper ];
phases = ["unpackPhase" "installPhase"];
installPhase = ''
./install.sh --prefix=$out \
--components=rustc,rust-std-${platform},rust-docs
${optionalString needsPatchelf ''
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
"$out/bin/rustc"
''}
# Do NOT, I repeat, DO NOT use `wrapProgram` on $out/bin/rustc
# (or similar) here. It causes strange effects where rustc loads
# the wrong libraries in a bootstrap-build causing failures that
# are very hard to track dow. For details, see
# https://github.com/rust-lang/rust/issues/34722#issuecomment-232164943
'';
};
cargo = stdenv.mkDerivation rec {
name = "cargo-bootstrap-${version}";
inherit version;
inherit src;
buildInputs = [ makeWrapper zlib rustc ];
phases = ["unpackPhase" "installPhase"];
installPhase = ''
./install.sh --prefix=$out \
--components=cargo
${optionalString needsPatchelf ''
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
"$out/bin/cargo"
''}
wrapProgram "$out/bin/cargo" \
--suffix PATH : "${rustc}/bin"
'';
};
}
version = "1.17.0";
in import ./binaryBuild.nix
{ inherit stdenv fetchurl makeWrapper cacert zlib curl;
buildRustPackage = null;
inherit version src platform;
versionType = "bootstrap";
}