about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorAndrew Dunham <andrew@du.nham.ca>2018-09-24 09:21:16 -0700
committerxeji <36407913+xeji@users.noreply.github.com>2018-09-24 18:21:16 +0200
commitba278c3b87d9bd1941c51f8566c4972f30deefa7 (patch)
tree0abd6680eeb89f332ce04f41e93d512a8b75a49e /pkgs
parente10361b30a214de9236ef3a42a3c25678e37f5c8 (diff)
downloadnixlib-ba278c3b87d9bd1941c51f8566c4972f30deefa7.tar
nixlib-ba278c3b87d9bd1941c51f8566c4972f30deefa7.tar.gz
nixlib-ba278c3b87d9bd1941c51f8566c4972f30deefa7.tar.bz2
nixlib-ba278c3b87d9bd1941c51f8566c4972f30deefa7.tar.lz
nixlib-ba278c3b87d9bd1941c51f8566c4972f30deefa7.tar.xz
nixlib-ba278c3b87d9bd1941c51f8566c4972f30deefa7.tar.zst
nixlib-ba278c3b87d9bd1941c51f8566c4972f30deefa7.zip
boost: limit concurrent jobs to the maximum supported number (#47255)
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/libraries/boost/generic.nix16
1 files changed, 15 insertions, 1 deletions
diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix
index 32899b748113..4131e5f7a27c 100644
--- a/pkgs/development/libraries/boost/generic.nix
+++ b/pkgs/development/libraries/boost/generic.nix
@@ -47,10 +47,24 @@ let
   # To avoid library name collisions
   layout = if taggedLayout then "tagged" else "system";
 
+  # Versions of b2 before 1.65 have job limits; specifically:
+  #   - Versions before 1.58 support up to 64 jobs[0]
+  #   - Versions before 1.65 support up to 256 jobs[1]
+  #
+  # [0]: https://github.com/boostorg/build/commit/0ef40cb86728f1cd804830fef89a6d39153ff632
+  # [1]: https://github.com/boostorg/build/commit/316e26ca718afc65d6170029284521392524e4f8
+  jobs =
+    if versionOlder version "1.58" then
+      "$(($NIX_BUILD_CORES<=64 ? $NIX_BUILD_CORES : 64))"
+    else if versionOlder version "1.65" then
+      "$(($NIX_BUILD_CORES<=256 ? $NIX_BUILD_CORES : 256))"
+    else
+      "$NIX_BUILD_CORES";
+
   b2Args = concatStringsSep " " ([
     "--includedir=$dev/include"
     "--libdir=$out/lib"
-    "-j$NIX_BUILD_CORES"
+    "-j${jobs}"
     "--layout=${layout}"
     "variant=${variant}"
     "threading=${threading}"