From 3cd79689f40b8accb4befe40e6edb7a8b12c9b39 Mon Sep 17 00:00:00 2001 From: Will Fancher Date: Tue, 8 Jan 2019 16:40:12 -0500 Subject: [PATCH] Limit parallel building of Haskell packages. [Fixes #53665] --- pkgs/development/haskell-modules/generic-builder.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index fc2c008be0c8..77bde5c85b72 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -78,6 +78,7 @@ in # same package in the (recursive) dependencies of the package being # built. Will delay failures, if any, to compile time. allowInconsistentDependencies ? false +, maxBuildCores ? 4 # GHC usually suffers beyond -j4. https://ghc.haskell.org/trac/ghc/ticket/9221 } @ args: assert editedCabalFile != null -> revision != null; @@ -250,6 +251,7 @@ stdenv.mkDerivation ({ '' + postPatch; setupCompilerEnvironmentPhase = '' + NIX_BUILD_CORES=$(( NIX_BUILD_CORES < ${toString maxBuildCores} ? NIX_BUILD_CORES : ${toString maxBuildCores} )) runHook preSetupCompilerEnvironment echo "Build with ${ghc}."