3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #38869 from coreyoconnor/rustc-build-cores

rustc: correct propagation of NIX_BUILD_CORES
This commit is contained in:
Daiderd Jordan 2018-04-15 12:53:33 +02:00 committed by GitHub
commit a071e9f841
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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