rustc: enable codegen units and parallel building (#21742)
This commit is contained in:
parent
ce26a4d3d4
commit
e91840cfb6
@ -20,27 +20,17 @@ let
|
|||||||
else
|
else
|
||||||
"${shortVersion}-g${builtins.substring 0 7 srcRev}";
|
"${shortVersion}-g${builtins.substring 0 7 srcRev}";
|
||||||
|
|
||||||
name = "rustc-${version}";
|
|
||||||
|
|
||||||
procps = if stdenv.isDarwin then darwin.ps else args.procps;
|
procps = if stdenv.isDarwin then darwin.ps else args.procps;
|
||||||
|
|
||||||
llvmShared = llvm.override { enableSharedLibraries = true; };
|
llvmShared = llvm.override { enableSharedLibraries = true; };
|
||||||
|
|
||||||
target = builtins.replaceStrings [" "] [","] (builtins.toString targets);
|
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
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
inherit name;
|
name = "rustc-${version}";
|
||||||
inherit version;
|
inherit version;
|
||||||
inherit meta;
|
|
||||||
|
|
||||||
__impureHostDeps = [ "/usr/lib/libedit.3.dylib" ];
|
__impureHostDeps = [ "/usr/lib/libedit.3.dylib" ];
|
||||||
|
|
||||||
@ -52,6 +42,9 @@ stdenv.mkDerivation {
|
|||||||
# versions.
|
# versions.
|
||||||
RUSTC_BOOTSTRAP = "1";
|
RUSTC_BOOTSTRAP = "1";
|
||||||
|
|
||||||
|
# Increase codegen units to introduce parallelism within the compiler.
|
||||||
|
RUSTFLAGS = "-Ccodegen-units=10";
|
||||||
|
|
||||||
src = fetchgit {
|
src = fetchgit {
|
||||||
url = https://github.com/rust-lang/rust;
|
url = https://github.com/rust-lang/rust;
|
||||||
rev = srcRev;
|
rev = srcRev;
|
||||||
@ -130,13 +123,12 @@ stdenv.mkDerivation {
|
|||||||
buildInputs = [ ncurses ] ++ targetToolchains
|
buildInputs = [ ncurses ] ++ targetToolchains
|
||||||
++ optional (!forceBundledLLVM) llvmShared;
|
++ optional (!forceBundledLLVM) llvmShared;
|
||||||
|
|
||||||
# https://github.com/rust-lang/rust/issues/30181
|
|
||||||
# enableParallelBuilding = false; # missing files during linking, occasionally
|
|
||||||
|
|
||||||
outputs = [ "out" "doc" ];
|
outputs = [ "out" "doc" ];
|
||||||
setOutputFlags = false;
|
setOutputFlags = false;
|
||||||
|
|
||||||
|
# Disable codegen units for the tests.
|
||||||
preCheck = ''
|
preCheck = ''
|
||||||
|
export RUSTFLAGS=
|
||||||
export TZDIR=${tzdata}/share/zoneinfo
|
export TZDIR=${tzdata}/share/zoneinfo
|
||||||
'' +
|
'' +
|
||||||
# Ensure TMPDIR is set, and disable a test that removing the HOME
|
# 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
|
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;
|
doCheck = true;
|
||||||
dontSetConfigureCross = 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…
x
Reference in New Issue
Block a user