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 Frederik Rietdijk
parent d1bcac2a54
commit 3cd79689f4

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