From e87d4575643ee19c16242132167cf6dfa985dcce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Thu, 3 Dec 2020 12:44:12 +0100 Subject: [PATCH] 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 --- pkgs/build-support/rust/build-rust-crate/configure-crate.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"