summary refs log tree commit diff
diff options
context:
space:
mode:
authorJan Malakhovski <oxij@oxij.org>2018-09-05 01:08:14 +0000
committerJan Malakhovski <oxij@oxij.org>2018-09-05 01:14:39 +0000
commitc63ca0a431a7a3bdf2aaae05b2acca86d8c1e7bd (patch)
treee274bb1e9127aed9070e07c63360c0f328b74aa6
parentb75ea627c6f290c0764d5ab8103dfd82ca309caa (diff)
downloadnixlib-c63ca0a431a7a3bdf2aaae05b2acca86d8c1e7bd.tar
nixlib-c63ca0a431a7a3bdf2aaae05b2acca86d8c1e7bd.tar.gz
nixlib-c63ca0a431a7a3bdf2aaae05b2acca86d8c1e7bd.tar.bz2
nixlib-c63ca0a431a7a3bdf2aaae05b2acca86d8c1e7bd.tar.lz
nixlib-c63ca0a431a7a3bdf2aaae05b2acca86d8c1e7bd.tar.xz
nixlib-c63ca0a431a7a3bdf2aaae05b2acca86d8c1e7bd.tar.zst
nixlib-c63ca0a431a7a3bdf2aaae05b2acca86d8c1e7bd.zip
stdenv: implement enableParallelChecking option
Works similarly to `enableParallelBuilding`, but is set by default when
`enableParallelBuilding` is set. In my experience most packages that build
fine in parallel also check fine in parallel.
-rw-r--r--pkgs/stdenv/generic/make-derivation.nix2
-rw-r--r--pkgs/stdenv/generic/setup.sh4
2 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix
index e1ce3200e8c9..3f35dce2eb29 100644
--- a/pkgs/stdenv/generic/make-derivation.nix
+++ b/pkgs/stdenv/generic/make-derivation.nix
@@ -227,6 +227,8 @@ rec {
           inherit doCheck doInstallCheck;
 
           inherit outputs;
+        } // lib.optionalAttrs (attrs.enableParallelBuilding or false) {
+          enableParallelChecking = attrs.enableParallelChecking or true;
         } // lib.optionalAttrs (hardeningDisable != [] || hardeningEnable != []) {
           NIX_HARDENING_ENABLE = enabledHardeningOptions;
         } // lib.optionalAttrs (stdenv.buildPlatform.isDarwin) {
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
index 141e94c5ed46..e51dc1f1a0a6 100644
--- a/pkgs/stdenv/generic/setup.sh
+++ b/pkgs/stdenv/generic/setup.sh
@@ -1044,7 +1044,7 @@ checkPhase() {
         # Old bash empty array hack
         # shellcheck disable=SC2086
         local flagsArray=(
-            ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}}
+            ${enableParallelChecking:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}}
             $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"}
             ${checkFlags:-VERBOSE=y} ${checkFlagsArray+"${checkFlagsArray[@]}"}
             ${checkTarget}
@@ -1176,7 +1176,7 @@ installCheckPhase() {
         # Old bash empty array hack
         # shellcheck disable=SC2086
         local flagsArray=(
-            ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}}
+            ${enableParallelChecking:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}}
             $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"}
             $installCheckFlags ${installCheckFlagsArray+"${installCheckFlagsArray[@]}"}
             ${installCheckTarget:-installcheck}