rustc: cleanup, use correct llvm version

This commit is contained in:
Luka Blaskovic 2020-12-14 08:40:37 +00:00
parent ec2fa1cee8
commit c73d96f776
5 changed files with 36 additions and 21 deletions

View file

@ -11,15 +11,24 @@
, buildPackages
, newScope, callPackage
, CoreFoundation, Security
, llvmPackages
, pkgsBuildTarget, pkgsBuildBuild
, pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost
, makeRustPlatform
, llvmPackages_5, llvm_10
} @ args:
import ./default.nix {
rustcVersion = "1.45.2";
rustcSha256 = "0273a1g3f59plyi1n0azf21qjzwml1yqdnj5z472crz37qggr8xp";
llvmSharedForBuild = pkgsBuildBuild.llvm_10.override { enableSharedLibraries = true; };
llvmSharedForHost = pkgsBuildHost.llvm_10.override { enableSharedLibraries = true; };
llvmSharedForTarget = pkgsBuildTarget.llvm_10.override { enableSharedLibraries = true; };
llvmBootstrapForDarwin = llvmPackages_5;
# For use at runtime
llvmShared = llvm_10.override { enableSharedLibraries = true; };
# Note: the version MUST be one version prior to the version we're
# building
bootstrapVersion = "1.44.1";
@ -41,4 +50,4 @@ import ./default.nix {
];
}
(builtins.removeAttrs args [ "fetchpatch" ])
(builtins.removeAttrs args [ "fetchpatch" "pkgsBuildHost" "llvmPackages_5" "llvm_10" ])

View file

@ -13,15 +13,24 @@
, buildPackages
, newScope, callPackage
, CoreFoundation, Security
, llvmPackages
, pkgsBuildTarget, pkgsBuildBuild
, pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost
, makeRustPlatform
, llvmPackages_5, llvm_11
} @ args:
import ./default.nix {
rustcVersion = "1.48.0";
rustcSha256 = "0fz4gbb5hp5qalrl9lcl8yw4kk7ai7wx511jb28nypbxninkwxhf";
llvmSharedForBuild = pkgsBuildBuild.llvm_11.override { enableSharedLibraries = true; };
llvmSharedForHost = pkgsBuildHost.llvm_11.override { enableSharedLibraries = true; };
llvmSharedForTarget = pkgsBuildTarget.llvm_11.override { enableSharedLibraries = true; };
llvmBootstrapForDarwin = llvmPackages_5;
# For use at runtime
llvmShared = llvm_11.override { enableSharedLibraries = true; };
# Note: the version MUST be one version prior to the version we're
# building
bootstrapVersion = "1.47.0";
@ -43,4 +52,4 @@ import ./default.nix {
];
}
(builtins.removeAttrs args [ "fetchpatch" ])
(builtins.removeAttrs args [ "fetchpatch" "pkgsBuildHost" "llvmPackages_5" "llvm_11"])

View file

@ -5,12 +5,16 @@
, bootstrapHashes
, selectRustPackage
, rustcPatches ? []
, llvmBootstrapForDarwin
, llvmShared
, llvmSharedForBuild
, llvmSharedForHost
, llvmSharedForTarget
}:
{ stdenv, lib
, buildPackages
, newScope, callPackage
, CoreFoundation, Security
, llvmPackages
, pkgsBuildTarget, pkgsBuildBuild
, makeRustPlatform
}: rec {
@ -76,16 +80,17 @@
version = rustcVersion;
sha256 = rustcSha256;
inherit enableRustcDev;
inherit llvmShared llvmSharedForBuild llvmSharedForHost llvmSharedForTarget;
patches = rustcPatches;
# Use boot package set to break cycle
rustPlatform = bootRustPlatform;
} // lib.optionalAttrs (stdenv.cc.isClang && stdenv.hostPlatform == stdenv.buildPlatform) {
stdenv = llvmPackages.stdenv;
pkgsBuildBuild = pkgsBuildBuild // { targetPackages.stdenv = llvmPackages.stdenv; };
pkgsBuildHost = pkgsBuildBuild // { targetPackages.stdenv = llvmPackages.stdenv; };
pkgsBuildTarget = pkgsBuildTarget // { targetPackages.stdenv = llvmPackages.stdenv; };
stdenv = llvmBootstrapForDarwin.stdenv;
pkgsBuildBuild = pkgsBuildBuild // { targetPackages.stdenv = llvmBootstrapForDarwin.stdenv; };
pkgsBuildHost = pkgsBuildBuild // { targetPackages.stdenv = llvmBootstrapForDarwin.stdenv; };
pkgsBuildTarget = pkgsBuildTarget // { targetPackages.stdenv = llvmBootstrapForDarwin.stdenv; };
});
rustfmt = self.callPackage ./rustfmt.nix { inherit Security; };
cargo = self.callPackage ./cargo.nix {

View file

@ -1,6 +1,7 @@
{ stdenv, removeReferencesTo, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget
, llvmShared, llvmSharedForBuild, llvmSharedForHost, llvmSharedForTarget
, fetchurl, file, python3
, llvm_10, darwin, cmake, rust, rustPlatform
, darwin, cmake, rust, rustPlatform
, pkgconfig, openssl
, which, libffi
, withBundledLLVM ? false
@ -13,13 +14,6 @@
let
inherit (stdenv.lib) optionals optional optionalString concatStringsSep;
inherit (darwin.apple_sdk.frameworks) Security;
llvmSharedForBuild = pkgsBuildBuild.llvm_10.override { enableSharedLibraries = true; };
llvmSharedForHost = pkgsBuildHost.llvm_10.override { enableSharedLibraries = true; };
llvmSharedForTarget = pkgsBuildTarget.llvm_10.override { enableSharedLibraries = true; };
# For use at runtime
llvmShared = llvm_10.override { enableSharedLibraries = true; };
in stdenv.mkDerivation rec {
pname = "rustc";
inherit version;

View file

@ -10030,11 +10030,9 @@ in
# 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 = if stdenv.cc.isClang then llvmPackages_5 else llvmPackages_10;
};
rust_1_48 = callPackage ../development/compilers/rust/1_48.nix {
inherit (darwin.apple_sdk.frameworks) CoreFoundation Security;
llvmPackages = if stdenv.cc.isClang then llvmPackages_5 else llvmPackages_11;
};
rust = rust_1_48;