Merge pull request #57936 from andir/build-rust-crate-nix-build-cores

buildRustCrate: use $NIX_BUILD_CORES for each of the crates
This commit is contained in:
Andreas Rammhold 2019-03-29 12:29:43 +01:00 committed by GitHub
commit e0b4356c0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@
rustcOpts =
lib.lists.foldl' (opts: opt: opts + " " + opt)
(if release then "-C opt-level=3" else "-C debuginfo=2")
(["-C codegen-units=1"] ++ extraRustcOpts);
(["-C codegen-units=$NIX_BUILD_CORES"] ++ extraRustcOpts);
rustcMeta = "-C metadata=${metadata} -C extra-filename=-${metadata}";
# Some platforms have different names for rustc.

View File

@ -22,7 +22,7 @@ let version_ = lib.splitString "-" crateVersion;
version = lib.splitString "." (lib.head version_);
rustcOpts = lib.lists.foldl' (opts: opt: opts + " " + opt)
(if release then "-C opt-level=3" else "-C debuginfo=2")
(["-C codegen-units=1"] ++ extraRustcOpts);
(["-C codegen-units=$NIX_BUILD_CORES"] ++ extraRustcOpts);
buildDeps = makeDeps buildDependencies;
authors = lib.concatStringsSep ":" crateAuthors;
optLevel = if release then 3 else 0;