buildRustCrate: use $NIX_BUILD_CORES for each of the crates

This commit is contained in:
Andreas Rammhold 2019-03-20 02:19:50 +01:00
parent c18bb57627
commit 4c89619152
No known key found for this signature in database
GPG Key ID: E432E410B5E48C86
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;