Commit a24f97bf authored by Wolfgang Walther's avatar Wolfgang Walther Committed by sternenseemann
Browse files

haskellPackages: Pass ghc-options in generic-builder when cross-compiling

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 64ec4dd8
about 8 years ago for unknown reasons.

Resolves #286285

[1]: https://github.com/haskell/cabal/issues/10069
parent f07f2b3c
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -237,9 +237,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 = [
@@ -603,7 +600,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
      '';