Skip to content

Commit

Permalink
Merge pull request #57936 from andir/build-rust-crate-nix-build-cores
Browse files Browse the repository at this point in the history
buildRustCrate: use $NIX_BUILD_CORES for each of the crates
  • Loading branch information
andir committed Mar 29, 2019
2 parents 347a49a + 4c89619 commit e0b4356
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkgs/build-support/rust/build-rust-crate/build-crate.nix
Expand Up @@ -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.
Expand Down
Expand Up @@ -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;
Expand Down

0 comments on commit e0b4356

Please sign in to comment.