summary refs log tree commit diff
diff options
context:
space:
mode:
authorzimbatm <zimbatm@zimbatm.com>2017-10-04 17:41:16 +0100
committerzimbatm <zimbatm@zimbatm.com>2017-10-23 00:30:46 +0100
commit7bd191df6a861e02d5bf2b36a03f6dc70e3e6bfd (patch)
tree74f4cf8cc3f2b29727ccbda906ae38cf818e9d0c
parente30e2010277da6814c6828b199c778774b3ba00a (diff)
downloadnixlib-7bd191df6a861e02d5bf2b36a03f6dc70e3e6bfd.tar
nixlib-7bd191df6a861e02d5bf2b36a03f6dc70e3e6bfd.tar.gz
nixlib-7bd191df6a861e02d5bf2b36a03f6dc70e3e6bfd.tar.bz2
nixlib-7bd191df6a861e02d5bf2b36a03f6dc70e3e6bfd.tar.lz
nixlib-7bd191df6a861e02d5bf2b36a03f6dc70e3e6bfd.tar.xz
nixlib-7bd191df6a861e02d5bf2b36a03f6dc70e3e6bfd.tar.zst
nixlib-7bd191df6a861e02d5bf2b36a03f6dc70e3e6bfd.zip
rust: 1.17.0 -> 1.20.0
simplify the boostrap hashes a bit

build with bundled llvm:

the rust project has forked the llvm compiler to solve some
issues.
With pkgs.llvm the test suite fails.

See https://github.com/rust-lang/rust/pull/43026

And PR #30088
-rw-r--r--pkgs/development/compilers/rust/bootstrap.nix30
-rw-r--r--pkgs/development/compilers/rust/cargo.nix4
-rw-r--r--pkgs/development/compilers/rust/default.nix13
-rwxr-xr-xpkgs/development/compilers/rust/print-hashes.sh30
4 files changed, 40 insertions, 37 deletions
diff --git a/pkgs/development/compilers/rust/bootstrap.nix b/pkgs/development/compilers/rust/bootstrap.nix
index ad49b1305706..fbcac09fc458 100644
--- a/pkgs/development/compilers/rust/bootstrap.nix
+++ b/pkgs/development/compilers/rust/bootstrap.nix
@@ -1,6 +1,18 @@
 { stdenv, fetchurl, makeWrapper, cacert, zlib, curl }:
 
 let
+  # Note: the version MUST be one version prior to the version we're
+  # building
+  version = "1.19.0";
+
+  # fetch hashes by running `print-hashes.sh 1.19.0`
+  hashes = {
+    i686-unknown-linux-gnu = "657b78f3c1a1b4412e12f7278e20cc318022fa276a58f0d38a0d15b515e39713";
+    x86_64-unknown-linux-gnu = "30ff67884464d32f6bbbde4387e7557db98868e87fb2afbb77c9b7716e3bff09";
+    i686-apple-darwin = "bdfd2189245dc5764c9f26bdba1429c2bf9d57477d8e6e3f0ba42ea0dc63edeb";
+    x86_64-apple-darwin = "5c668fb60a3ba3e97dc2cb8967fc4bb9422b629155284dcb89f94d116bb17820";
+  };
+
   platform =
     if stdenv.system == "i686-linux"
     then "i686-unknown-linux-gnu"
@@ -12,27 +24,11 @@ let
     then "x86_64-apple-darwin"
     else throw "missing bootstrap url for platform ${stdenv.system}";
 
-  # fetch hashes by patching print-hashes.sh to not use the "$DATE" variable
-  # then running `print-hashes.sh 1.16.0`
-  bootstrapHash =
-    if stdenv.system == "i686-linux"
-    then "b5859161ebb182d3b75fa14a5741e5de87b088146fb0ef4a30f3b2439c6179c5"
-    else if stdenv.system == "x86_64-linux"
-    then "48621912c242753ba37cad5145df375eeba41c81079df46f93ffb4896542e8fd"
-    else if stdenv.system == "i686-darwin"
-    then "26356b14164354725bd0351e8084f9b164abab134fb05cddb7758af35aad2065"
-    else if stdenv.system == "x86_64-darwin"
-    then "2d08259ee038d3a2c77a93f1a31fc59e7a1d6d1bbfcba3dba3c8213b2e5d1926"
-    else throw "missing bootstrap hash for platform ${stdenv.system}";
-
   src = fetchurl {
      url = "https://static.rust-lang.org/dist/rust-${version}-${platform}.tar.gz";
-     sha256 = bootstrapHash;
+     sha256 = hashes."${platform}";
   };
 
-  # Note: the version  MUST be one version prior to the version we're
-  # building
-  version = "1.16.0";
 in import ./binaryBuild.nix
   { inherit stdenv fetchurl makeWrapper cacert zlib curl;
     buildRustPackage = null;
diff --git a/pkgs/development/compilers/rust/cargo.nix b/pkgs/development/compilers/rust/cargo.nix
index 97977ba3ed3a..2df843faf934 100644
--- a/pkgs/development/compilers/rust/cargo.nix
+++ b/pkgs/development/compilers/rust/cargo.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchgit, file, curl, pkgconfig, python, openssl, cmake, zlib
 , makeWrapper, libiconv, cacert, rustPlatform, rustc, libgit2
-, version, srcRev, srcSha, depsSha256
+, version, srcSha, depsSha256
 , patches ? []}:
 
 rustPlatform.buildRustPackage rec {
@@ -9,7 +9,7 @@ rustPlatform.buildRustPackage rec {
 
   src = fetchgit {
     url = "https://github.com/rust-lang/cargo";
-    rev = srcRev;
+    rev = version;
     sha256 = srcSha;
   };
 
diff --git a/pkgs/development/compilers/rust/default.nix b/pkgs/development/compilers/rust/default.nix
index 0d7e26e06f47..2544cca43366 100644
--- a/pkgs/development/compilers/rust/default.nix
+++ b/pkgs/development/compilers/rust/default.nix
@@ -6,17 +6,19 @@
 
 let
   rustPlatform = recurseIntoAttrs (makeRustPlatform (callPackage ./bootstrap.nix {}));
-  version = "1.17.0";
+  version = "1.20.0";
 in
 rec {
   rustc = callPackage ./rustc.nix {
     inherit llvm targets targetPatches targetToolchains rustPlatform version;
 
+    forceBundledLLVM = true;
+
     configureFlags = [ "--release-channel=stable" ];
 
     src = fetchurl {
       url = "https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz";
-      sha256 = "4baba3895b75f2492df6ce5a28a916307ecd1c088dc1fd02dbfa8a8e86174f87";
+      sha256 = "0542y4rnzlsrricai130mqyxl8r6rd991frb4qsnwb27yigqg91a";
     };
 
     patches = [
@@ -26,10 +28,9 @@ rec {
   };
 
   cargo = callPackage ./cargo.nix rec {
-    version = "0.18.0";
-    srcRev = "fe7b0cdcf5ca7aab81630706ce40b70f6aa2e666";
-    srcSha = "164iywv1l3v87b0pznf5kkzxigd6w19myv9d7ka4c65zgrk9n9px";
-    depsSha256 = "1mrgd8ib48vxxbhkvsqqq4p19sc6b74x3cd8p6lhhlm6plrajrvm";
+    version = "0.21.1";
+    srcSha = "a64iywv1l3v87b0pznf5kkzxigd6w19myv9d7ka4c65zgrk9n9px";
+    depsSha256 = "amrgd8ib48vxxbhkvsqqq4p19sc6b74x3cd8p6lhhlm6plrajrvm";
 
     inherit rustc; # the rustc that will be wrapped by cargo
     inherit rustPlatform; # used to build cargo
diff --git a/pkgs/development/compilers/rust/print-hashes.sh b/pkgs/development/compilers/rust/print-hashes.sh
index da52ac37ab30..f3d094d65a8a 100755
--- a/pkgs/development/compilers/rust/print-hashes.sh
+++ b/pkgs/development/compilers/rust/print-hashes.sh
@@ -1,4 +1,5 @@
 #!/usr/bin/env bash
+set -euo pipefail
 
 # All rust-related downloads can be found at
 # https://static.rust-lang.org/dist/index.html.  To find the date on
@@ -6,25 +7,30 @@
 # file, e.g.
 # https://static.rust-lang.org/dist/channel-rust-beta-date.txt
 
-PLATFORMS="i686-unknown-linux-gnu x86_64-unknown-linux-gnu i686-apple-darwin x86_64-apple-darwin"
-BASEURL="https://static.rust-lang.org/dist"
-DATE=$1
-VERSION=$2
+PLATFORMS=(
+  i686-unknown-linux-gnu
+  x86_64-unknown-linux-gnu
+  i686-apple-darwin
+  x86_64-apple-darwin
+)
+BASEURL=https://static.rust-lang.org/dist
+VERSION=${1:-}
+DATE=${2:-}
 
-if [[ -z  $DATE ]]
+if [[ -z $VERSION ]]
 then
-    echo "No date supplied"
+    echo "No version supplied"
     exit -1
 fi
 
-if [[ -z  $VERSION ]]
+if [[ -n $DATE ]]
 then
-    echo "No version supplied"
-    exit -1
+    BASEURL=$BASEURL/$DATE
 fi
 
-for PLATFORM in $PLATFORMS
+for PLATFORM in "${PLATFORMS[@]}"
 do
-    URL="$BASEURL/$DATE/rust-$VERSION-$PLATFORM.tar.gz.sha256"
-    curl $URL
+    URL="$BASEURL/rust-$VERSION-$PLATFORM.tar.gz.sha256"
+    SHA256=$(curl -sSfL $URL | cut -d ' ' -f 1)
+    echo "$PLATFORM = \"$SHA256\";"
 done