From b837bd4305144d04bdbb796507aa57691976336d Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Tue, 1 Sep 2020 09:07:15 +0200 Subject: [PATCH 1/2] rust: 1.45.2 -> 1.46.0 This adds the rust toolchain 1.46.0: https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1460-2020-08-27 Because rustc-1.46.0 enables static PIE by default for `x86_64-unknown-linux-musl` this release will suffer from: https://github.com/NixOS/nixpkgs/issues/94228 So this commit doesn't remove the 1.45.2 release. This commit also specifies the right LLVM packages to use for each rust release. --- pkgs/development/compilers/rust/1_44.nix | 2 +- pkgs/development/compilers/rust/1_45.nix | 2 +- pkgs/development/compilers/rust/1_46.nix | 44 +++++++++++++++++++++ pkgs/development/compilers/rust/default.nix | 10 ++--- pkgs/top-level/all-packages.nix | 17 +++++++- 5 files changed, 66 insertions(+), 9 deletions(-) create mode 100644 pkgs/development/compilers/rust/1_46.nix diff --git a/pkgs/development/compilers/rust/1_44.nix b/pkgs/development/compilers/rust/1_44.nix index 9fc268d152b1ea7..fca6a677ddab84c 100644 --- a/pkgs/development/compilers/rust/1_44.nix +++ b/pkgs/development/compilers/rust/1_44.nix @@ -11,7 +11,7 @@ , buildPackages , newScope, callPackage , CoreFoundation, Security -, llvmPackages_5 +, llvmPackages , pkgsBuildTarget, pkgsBuildBuild } @ args: diff --git a/pkgs/development/compilers/rust/1_45.nix b/pkgs/development/compilers/rust/1_45.nix index 1a634d3f51edb5a..41c380174aef8a3 100644 --- a/pkgs/development/compilers/rust/1_45.nix +++ b/pkgs/development/compilers/rust/1_45.nix @@ -11,7 +11,7 @@ , buildPackages , newScope, callPackage , CoreFoundation, Security -, llvmPackages_5 +, llvmPackages , pkgsBuildTarget, pkgsBuildBuild } @ args: diff --git a/pkgs/development/compilers/rust/1_46.nix b/pkgs/development/compilers/rust/1_46.nix new file mode 100644 index 000000000000000..04954a043bf8971 --- /dev/null +++ b/pkgs/development/compilers/rust/1_46.nix @@ -0,0 +1,44 @@ +# New rust versions should first go to staging. +# Things to check after updating: +# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin: +# i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github +# This testing can be also done by other volunteers as part of the pull +# request review, in case platforms cannot be covered. +# 2. The LLVM version used for building should match with rust upstream. +# Check the version number in the src/llvm-project git submodule in: +# https://github.com/rust-lang/rust/blob//.gitmodules +# 3. Firefox and Thunderbird should still build on x86_64-linux. + +{ stdenv, lib +, buildPackages +, newScope, callPackage +, CoreFoundation, Security +, llvmPackages +, pkgsBuildTarget, pkgsBuildBuild +} @ args: + +import ./default.nix { + rustcVersion = "1.46.0"; + rustcSha256 = "0a17jby2pd050s24cy4dfc0gzvgcl585v3vvyfilniyvjrqknsid"; + + # Note: the version MUST be one version prior to the version we're + # building + bootstrapVersion = "1.45.2"; + + # fetch hashes by running `print-hashes.sh 1.45.2` + bootstrapHashes = { + i686-unknown-linux-gnu = "5b2050dde23152750de89f7e59acaab6bf088d0beb5854c69c9a545fd254b936"; + x86_64-unknown-linux-gnu = "860feed955726a4d96ffe40758a110053326b9ae11c9e1ee059e9c6222f25643"; + arm-unknown-linux-gnueabihf = "ddb5f59bbdef84e0b7c83049461e003ed031dd881a4622365c3d475102535c60"; + armv7-unknown-linux-gnueabihf = "7a556581f87602705f9c89b04cce621cfbba9050b6fbe478166e91d164567531"; + aarch64-unknown-linux-gnu = "151fad66442d28a4e4786753d1afb559c4a3d359081c64769273a31c2f0f4d30"; + x86_64-apple-darwin = "6e8067624ede10aa23081d62e0086c6f42f7228cc0d00fb5ff24d4dac65249d6"; + }; + + selectRustPackage = pkgs: pkgs.rust_1_46; + + rustcPatches = [ + ]; +} + +(builtins.removeAttrs args [ "fetchpatch" ]) diff --git a/pkgs/development/compilers/rust/default.nix b/pkgs/development/compilers/rust/default.nix index d08b63dd643f9fb..9545b851815f6b9 100644 --- a/pkgs/development/compilers/rust/default.nix +++ b/pkgs/development/compilers/rust/default.nix @@ -10,7 +10,7 @@ , buildPackages , newScope, callPackage , CoreFoundation, Security -, llvmPackages_5 +, llvmPackages , pkgsBuildTarget, pkgsBuildBuild }: rec { toRustTarget = platform: with platform.parsed; let @@ -80,10 +80,10 @@ # Use boot package set to break cycle rustPlatform = bootRustPlatform; } // lib.optionalAttrs (stdenv.cc.isClang && stdenv.hostPlatform == stdenv.buildPlatform) { - stdenv = llvmPackages_5.stdenv; - pkgsBuildBuild = pkgsBuildBuild // { targetPackages.stdenv = llvmPackages_5.stdenv; }; - pkgsBuildHost = pkgsBuildBuild // { targetPackages.stdenv = llvmPackages_5.stdenv; }; - pkgsBuildTarget = pkgsBuildTarget // { targetPackages.stdenv = llvmPackages_5.stdenv; }; + stdenv = llvmPackages.stdenv; + pkgsBuildBuild = pkgsBuildBuild // { targetPackages.stdenv = llvmPackages.stdenv; }; + pkgsBuildHost = pkgsBuildBuild // { targetPackages.stdenv = llvmPackages.stdenv; }; + pkgsBuildTarget = pkgsBuildTarget // { targetPackages.stdenv = llvmPackages.stdenv; }; }); rustfmt = self.callPackage ./rustfmt.nix { inherit Security; }; cargo = self.callPackage ./cargo.nix { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7d48edaa19aa3b6..747228403a8b0cb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9635,15 +9635,28 @@ in rust_1_44 = callPackage ../development/compilers/rust/1_44.nix { inherit (darwin.apple_sdk.frameworks) CoreFoundation Security; + llvmPackages = llvmPackages_9; }; + # Because rustc-1.46.0 enables static PIE by default for + # `x86_64-unknown-linux-musl` this release will suffer from: + # + # https://github.com/NixOS/nixpkgs/issues/94228 + # + # So this commit doesn't remove the 1.45.2 release. rust_1_45 = callPackage ../development/compilers/rust/1_45.nix { inherit (darwin.apple_sdk.frameworks) CoreFoundation Security; + llvmPackages = llvmPackages_10; + }; + rust_1_46 = callPackage ../development/compilers/rust/1_46.nix { + inherit (darwin.apple_sdk.frameworks) CoreFoundation Security; + llvmPackages = llvmPackages_10; }; - rust = rust_1_45; + rust = rust_1_46; rustPackages_1_44 = rust_1_44.packages.stable; rustPackages_1_45 = rust_1_45.packages.stable; - rustPackages = rustPackages_1_45; + rustPackages_1_46 = rust_1_46.packages.stable; + rustPackages = rustPackages_1_46; inherit (rustPackages) cargo clippy rustc rustPlatform; inherit (rust) makeRustPlatform; From c01133316f7bac9d45c8afa2f4778b6cd76d1015 Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Wed, 23 Sep 2020 16:29:30 +0200 Subject: [PATCH 2/2] rust: remove 1.44.1 since firefox and thunderbird build with 1.46 --- pkgs/development/compilers/rust/1_44.nix | 42 ------------------------ pkgs/top-level/all-packages.nix | 11 ++----- 2 files changed, 3 insertions(+), 50 deletions(-) delete mode 100644 pkgs/development/compilers/rust/1_44.nix diff --git a/pkgs/development/compilers/rust/1_44.nix b/pkgs/development/compilers/rust/1_44.nix deleted file mode 100644 index fca6a677ddab84c..000000000000000 --- a/pkgs/development/compilers/rust/1_44.nix +++ /dev/null @@ -1,42 +0,0 @@ -# New rust versions should first go to staging. -# Things to check after updating: -# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin: -# i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github -# This testing can be also done by other volunteers as part of the pull -# request review, in case platforms cannot be covered. -# 2. The LLVM version used for building should match with rust upstream. -# 3. Firefox and Thunderbird should still build on x86_64-linux. - -{ stdenv, lib -, buildPackages -, newScope, callPackage -, CoreFoundation, Security -, llvmPackages -, pkgsBuildTarget, pkgsBuildBuild -} @ args: - -import ./default.nix { - rustcVersion = "1.44.1"; - rustcSha256 = "0ww4z2v3gxgn3zddqzwqya1gln04p91ykbrflnpdbmcd575n8bky"; - - # Note: the version MUST be one version prior to the version we're - # building - bootstrapVersion = "1.43.1"; - - # fetch hashes by running `print-hashes.sh 1.44.1` - bootstrapHashes = { - i686-unknown-linux-gnu = "0626fa8a6a2387021413d740543f7496656d81115e2284e4ef73217128398990"; - x86_64-unknown-linux-gnu = "25cd71b95bba0daef56bad8c943a87368c4185b90983f4412f46e3e2418c0505"; - arm-unknown-linux-gnueabihf = "16b9c4861565a195323d144fd0f54c0ae794ee3d2a867682f8aedbdacaad5a6c"; - armv7-unknown-linux-gnueabihf = "0c32a5958a358a031e6ca52074cfd45256688dc334db315199f5dbbf7562e5b1"; - aarch64-unknown-linux-gnu = "fbb612387a64c9da2869725afffc1f66a72d6e7ba6667ba717cd52c33080b7fb"; - x86_64-apple-darwin = "e1c3e1426a9e615079159d6b619319235e3ca7b395e7603330375bfffcbb7003"; - }; - - selectRustPackage = pkgs: pkgs.rust_1_44; - - rustcPatches = [ - ]; -} - -(builtins.removeAttrs args [ "fetchpatch" ]) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 747228403a8b0cb..944f84161bedc85 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9633,10 +9633,6 @@ in inherit (darwin) apple_sdk; }; - rust_1_44 = callPackage ../development/compilers/rust/1_44.nix { - inherit (darwin.apple_sdk.frameworks) CoreFoundation Security; - llvmPackages = llvmPackages_9; - }; # Because rustc-1.46.0 enables static PIE by default for # `x86_64-unknown-linux-musl` this release will suffer from: # @@ -9653,7 +9649,6 @@ in }; rust = rust_1_46; - rustPackages_1_44 = rust_1_44.packages.stable; rustPackages_1_45 = rust_1_45.packages.stable; rustPackages_1_46 = rust_1_46.packages.stable; rustPackages = rustPackages_1_46; @@ -20709,7 +20704,7 @@ in firefoxPackages = recurseIntoAttrs (callPackage ../applications/networking/browsers/firefox/packages.nix { callPackage = pkgs.newScope { - inherit (rustPackages_1_44) cargo rustc; + inherit (rustPackages) cargo rustc; libpng = libpng_apng; python = python2; gnused = gnused_422; @@ -23584,7 +23579,7 @@ in thonny = callPackage ../applications/editors/thonny { }; thunderbird-78 = callPackage ../applications/networking/mailreaders/thunderbird { - inherit (rustPackages_1_44) cargo rustc; + inherit (rustPackages) cargo rustc; libpng = libpng_apng; icu = icu67; libvpx = libvpx_1_8; @@ -23592,7 +23587,7 @@ in }; thunderbird = callPackage ../applications/networking/mailreaders/thunderbird/68.nix { - inherit (rustPackages_1_44) cargo rustc; + inherit (rustPackages) cargo rustc; libpng = libpng_apng; nss = nss_3_44; gtk3Support = true;