Skip to content

Commit

Permalink
haskellPackages: Pass ghc-options in generic-builder when cross-compi…
Browse files Browse the repository at this point in the history
…ling

The following sequence of operations loses ghc-options:
  Setup.hs configure --ghc-options
  Setup.hs build --with-ghc=...

This is described in [1].

The fix is simple: Don't pass --with-ghc in the build phase. The values
are taken from the configure step anyway. This seems to have been
introduced all the way back in 64ec4dd
about 8 years ago for unknown reasons.

Resolves #286285

[1]: haskell/cabal#10069

(cherry picked from commit 5dbf665)
  • Loading branch information
wolfgangwalther authored and github-actions[bot] committed Jun 20, 2024
1 parent a830c1d commit 5b3bb36
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkgs/development/haskell-modules/generic-builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,6 @@ let

parallelBuildingFlags = "-j$NIX_BUILD_CORES" + optionalString stdenv.isLinux " +RTS -A64M -RTS";

crossCabalFlagsString =
lib.optionalString isCross (" " + lib.concatStringsSep " " crossCabalFlags);

buildFlagsString = optionalString (buildFlags != []) (" " + concatStringsSep " " buildFlags);

defaultConfigureFlags = [
Expand Down Expand Up @@ -592,7 +589,7 @@ stdenv.mkDerivation ({
find dist/build -exec touch -d '1970-01-01T00:00:00Z' {} +
''
+ ''
${setupCommand} build ${buildTarget}${crossCabalFlagsString}${buildFlagsString}
${setupCommand} build ${buildTarget}${buildFlagsString}
runHook postBuild
'';

Expand Down

0 comments on commit 5b3bb36

Please sign in to comment.