Skip to content

Commit

Permalink
cabal: enable multi-threaded builds with GHC 7.8.x or later for execu…
Browse files Browse the repository at this point in the history
…tables

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.
  • Loading branch information
peti committed Nov 7, 2014
1 parent 1a8b7b6 commit 4427308
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkgs/build-support/cabal/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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' \
Expand Down

0 comments on commit 4427308

Please sign in to comment.