summary refs log tree commit diff
path: root/pkgs/build-support/rust
diff options
context:
space:
mode:
authorDaniël de Kok <me@danieldk.eu>2020-12-03 12:44:12 +0100
committerDaniël de Kok <me@danieldk.eu>2020-12-03 12:44:12 +0100
commite87d4575643ee19c16242132167cf6dfa985dcce (patch)
tree6737666dabd9fb2e95ec95c112628cdba395396e /pkgs/build-support/rust
parent3a2e9d2ac7e826eacc1dd99f07f9b06242b04e14 (diff)
downloadnixpkgs-e87d4575643ee19c16242132167cf6dfa985dcce.tar
nixpkgs-e87d4575643ee19c16242132167cf6dfa985dcce.tar.gz
nixpkgs-e87d4575643ee19c16242132167cf6dfa985dcce.tar.bz2
nixpkgs-e87d4575643ee19c16242132167cf6dfa985dcce.tar.lz
nixpkgs-e87d4575643ee19c16242132167cf6dfa985dcce.tar.xz
nixpkgs-e87d4575643ee19c16242132167cf6dfa985dcce.tar.zst
nixpkgs-e87d4575643ee19c16242132167cf6dfa985dcce.zip
buildRustCrate: set NUM_JOBS to NIX_BUILD_CORES
Bofore this change, NUM_JOBS was set to 1. Some crates for building
C/C++ code (e.g. the cc and cmake crates), rely on this variable to
set the number of jobs. As a consequence, we were compiling embedded
libraries serially. Change this to NIX_BUILD_CORES to permit parallel
builds.

Prior discussion:

https://github.com/NixOS/nixpkgs/pull/50452#issuecomment-439407547
Diffstat (limited to 'pkgs/build-support/rust')
-rw-r--r--pkgs/build-support/rust/build-rust-crate/configure-crate.nix2
1 files changed, 1 insertions, 1 deletions
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 5ada40b3b9b..d1010ac1adb 100644
--- a/pkgs/build-support/rust/build-rust-crate/configure-crate.nix
+++ b/pkgs/build-support/rust/build-rust-crate/configure-crate.nix
@@ -144,7 +144,7 @@ in ''
   export CARGO_PKG_VERSION_PATCH=${lib.elemAt version 2}
   export CARGO_PKG_VERSION_PRE="${versionPre}"
   export CARGO_PKG_HOMEPAGE="${crateHomepage}"
-  export NUM_JOBS=1
+  export NUM_JOBS=$NIX_BUILD_CORES
   export RUSTC="rustc"
   export RUSTDOC="rustdoc"