Unverified Commit 0fcde6e3 authored by Randy Eckenrode's avatar Randy Eckenrode
Browse files

haskell.compiler.ghc963Binary: work around `ar -L` issue on Darwin

The bindist defaults to enabling `ar -L` if it detects a compatible `ar`. Suppress this behavior by overriding the setting. This allows the bindist to be used to bootstrap GHC 9.8.
parent 202ad936
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -282,6 +282,12 @@ stdenv.mkDerivation rec {
      isScript "$i" || continue
      sed -i -e '2i export PATH="${lib.makeBinPath runtimeDeps}:$PATH"' "$i"
    done
  '' + lib.optionalString stdenv.targetPlatform.isDarwin ''
    # Work around building with binary GHC on Darwin due to GHC’s use of `ar -L` when it
    # detects `llvm-ar` even though the resulting archives are not supported by ld64.
    # https://gitlab.haskell.org/ghc/ghc/-/issues/23188
    # https://github.com/haskell/cabal/issues/8882
    sed -i -e 's/,("ar supports -L", "YES")/,("ar supports -L", "NO")/' "$out/lib/ghc-${version}/lib/settings"
  '';

  # Apparently necessary for the ghc Alpine (musl) bindist: