3
0
Fork 0
forked from mirrors/nixpkgs

cabal: enable multi-threaded builds with GHC 7.8.x or later for executables

Multi-threaded builds exacerbate the non-determinism in ghc package ids, which
is a serious problem for libraries. Packages that define only executables,
however, should be safe to  build with parallelism enabled.
This commit is contained in:
Peter Simons 2014-08-16 17:42:11 +02:00
parent 1a8b7b6a12
commit 44273088ad

View file

@ -217,6 +217,9 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version;
${optionalString (self.enableSharedExecutables && self.stdenv.isDarwin) ''
configureFlags+=" --ghc-option=-optl=-Wl,-headerpad_max_install_names"
''}
${optionalString (versionOlder "7.8" ghc.version && !self.isLibrary) ''
configureFlags+=" --ghc-option=-j$NIX_BUILD_CORES"
''}
echo "configure flags: $extraConfigureFlags $configureFlags"
./Setup configure --verbose --prefix="$out" --libdir='$prefix/lib/$compiler' \