Limit parallel building of Haskell packages. [Fixes #53665]

This commit is contained in:
Will Fancher 2019-01-08 16:40:12 -05:00 committed by Peter Simons
parent 178836c9bb
commit 55fe0276b8

View File

@ -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}."