summary refs log tree commit diff
path: root/pkgs/development/compilers/rust/rustc.nix
diff options
context:
space:
mode:
authorCorey O'Connor <coreyoconnor@gmail.com>2018-04-12 13:16:09 -0700
committerCorey O'Connor <coreyoconnor@gmail.com>2018-04-12 13:17:23 -0700
commita2eacaaf3b80d7aecdf5fc547e51e6ce42ba5c53 (patch)
treec7963334a952863c42dd332c1c450623ca9e8527 /pkgs/development/compilers/rust/rustc.nix
parent58d4fd9e02d870914ae625845aec6e3171d5c8dc (diff)
downloadnixpkgs-a2eacaaf3b80d7aecdf5fc547e51e6ce42ba5c53.tar
nixpkgs-a2eacaaf3b80d7aecdf5fc547e51e6ce42ba5c53.tar.gz
nixpkgs-a2eacaaf3b80d7aecdf5fc547e51e6ce42ba5c53.tar.bz2
nixpkgs-a2eacaaf3b80d7aecdf5fc547e51e6ce42ba5c53.tar.lz
nixpkgs-a2eacaaf3b80d7aecdf5fc547e51e6ce42ba5c53.tar.xz
nixpkgs-a2eacaaf3b80d7aecdf5fc547e51e6ce42ba5c53.tar.zst
nixpkgs-a2eacaaf3b80d7aecdf5fc547e51e6ce42ba5c53.zip
rustc: correct propagation of NIX_BUILD_CORES
Diffstat (limited to 'pkgs/development/compilers/rust/rustc.nix')
-rw-r--r--pkgs/development/compilers/rust/rustc.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix
index bb0794aeb84..1395d8e9a3b 100644
--- a/pkgs/development/compilers/rust/rustc.nix
+++ b/pkgs/development/compilers/rust/rustc.nix
@@ -53,6 +53,7 @@ stdenv.mkDerivation {
   RUSTFLAGS = "-Ccodegen-units=10";
 
   # We need rust to build rust. If we don't provide it, configure will try to download it.
+  # Reference: https://github.com/rust-lang/rust/blob/master/src/bootstrap/configure.py
   configureFlags = configureFlags
                 ++ [ "--enable-local-rust" "--local-rust-root=${rustPlatform.rust.rustc}" "--enable-rpath" ]
                 ++ [ "--enable-vendor" ]
@@ -62,6 +63,13 @@ stdenv.mkDerivation {
                 ++ optional (targets != []) "--target=${target}"
                 ++ optional (!forceBundledLLVM) "--llvm-root=${llvmShared}";
 
+  # The boostrap.py will generated a Makefile that then executes the build.
+  # The BOOTSTRAP_ARGS used by this Makefile must include all flags to pass
+  # to the bootstrap builder.
+  postConfigure = ''
+    substituteInPlace Makefile --replace 'BOOTSTRAP_ARGS :=' 'BOOTSTRAP_ARGS := --jobs $(NIX_BUILD_CORES)'
+  '';
+
   patches = patches ++ targetPatches;
 
   # the rust build system complains that nix alters the checksums