From e91840cfb6b7778f8c29d455a2f24cffa1b4e43e Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Thu, 12 Jan 2017 14:25:20 +0100 Subject: rustc: enable codegen units and parallel building (#21742) --- pkgs/development/compilers/rust/rustc.nix | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'pkgs/development/compilers/rust') diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index 04543f17ec983..190bb1a69fda2 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -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; + }; } -- cgit 1.4.1