From 4c89619152a9084f104f883145298c8c89b0616d Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Wed, 20 Mar 2019 02:19:50 +0100 Subject: [PATCH] buildRustCrate: use $NIX_BUILD_CORES for each of the crates --- pkgs/build-support/rust/build-rust-crate/build-crate.nix | 2 +- pkgs/build-support/rust/build-rust-crate/configure-crate.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/rust/build-rust-crate/build-crate.nix b/pkgs/build-support/rust/build-rust-crate/build-crate.nix index 0978f7e1756f1..2999c3d4c1d9a 100644 --- a/pkgs/build-support/rust/build-rust-crate/build-crate.nix +++ b/pkgs/build-support/rust/build-rust-crate/build-crate.nix @@ -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. diff --git a/pkgs/build-support/rust/build-rust-crate/configure-crate.nix b/pkgs/build-support/rust/build-rust-crate/configure-crate.nix index b184d363d5541..165b3414c6a32 100644 --- a/pkgs/build-support/rust/build-rust-crate/configure-crate.nix +++ b/pkgs/build-support/rust/build-rust-crate/configure-crate.nix @@ -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;