lol

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

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