rustc: enable codegen units and parallel building (#21742)
This commit is contained in:
parent
ce26a4d3d4
commit
e91840cfb6
@ -20,27 +20,17 @@ let
|
||||
else
|
||||
"${shortVersion}-g${builtins.substring 0 7 srcRev}";
|
||||
|
||||
name = "rustc-${version}";
|
||||
|
||||
procps = if stdenv.isDarwin then darwin.ps else args.procps;
|
||||
|
||||
llvmShared = llvm.override { enableSharedLibraries = true; };
|
||||
|
||||
target = builtins.replaceStrings [" "] [","] (builtins.toString targets);
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = http://www.rust-lang.org/;
|
||||
description = "A safe, concurrent, practical language";
|
||||
maintainers = with maintainers; [ madjar cstrahan wizeman globin havvy wkennington retrry ];
|
||||
license = [ licenses.mit licenses.asl20 ];
|
||||
platforms = platforms.linux ++ platforms.darwin;
|
||||
};
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
inherit name;
|
||||
name = "rustc-${version}";
|
||||
inherit version;
|
||||
inherit meta;
|
||||
|
||||
__impureHostDeps = [ "/usr/lib/libedit.3.dylib" ];
|
||||
|
||||
@ -52,6 +42,9 @@ stdenv.mkDerivation {
|
||||
# versions.
|
||||
RUSTC_BOOTSTRAP = "1";
|
||||
|
||||
# Increase codegen units to introduce parallelism within the compiler.
|
||||
RUSTFLAGS = "-Ccodegen-units=10";
|
||||
|
||||
src = fetchgit {
|
||||
url = https://github.com/rust-lang/rust;
|
||||
rev = srcRev;
|
||||
@ -130,13 +123,12 @@ stdenv.mkDerivation {
|
||||
buildInputs = [ ncurses ] ++ targetToolchains
|
||||
++ optional (!forceBundledLLVM) llvmShared;
|
||||
|
||||
# https://github.com/rust-lang/rust/issues/30181
|
||||
# enableParallelBuilding = false; # missing files during linking, occasionally
|
||||
|
||||
outputs = [ "out" "doc" ];
|
||||
setOutputFlags = false;
|
||||
|
||||
# Disable codegen units for the tests.
|
||||
preCheck = ''
|
||||
export RUSTFLAGS=
|
||||
export TZDIR=${tzdata}/share/zoneinfo
|
||||
'' +
|
||||
# Ensure TMPDIR is set, and disable a test that removing the HOME
|
||||
@ -147,7 +139,16 @@ stdenv.mkDerivation {
|
||||
sed -i '28s/home_dir().is_some()/true/' ./src/test/run-pass/env-home-dir.rs
|
||||
'';
|
||||
|
||||
# Disable doCheck on Darwin to work around upstream issue
|
||||
doCheck = true;
|
||||
dontSetConfigureCross = true;
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = http://www.rust-lang.org/;
|
||||
description = "A safe, concurrent, practical language";
|
||||
maintainers = with maintainers; [ madjar cstrahan wizeman globin havvy wkennington retrry ];
|
||||
license = [ licenses.mit licenses.asl20 ];
|
||||
platforms = platforms.linux ++ platforms.darwin;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user