Skip to content

Commit

Permalink
cabal-install: Fix for justStaticExecutables
Browse files Browse the repository at this point in the history
Fixes `cabal-install` to remove references to GHC, mostly through other
libraries that are included in the binary.

See: #304352

Co-authored-by: sternenseemann <[email protected]>
  • Loading branch information
9999years and sternenseemann committed Jun 6, 2024
1 parent bd4363d commit caa1c96
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion pkgs/development/haskell-modules/configuration-common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,21 @@ self: super: {
};
in
{
cabal-install = super.cabal-install.overrideScope cabalInstallOverlay;
cabal-install =
let
cabal-install = super.cabal-install.overrideScope cabalInstallOverlay;
scope = cabal-install.scope;
in
# Some dead code is not properly eliminated on aarch64-darwin, leading
# to bogus references to some dependencies.
overrideCabal (old: lib.optionalAttrs (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) {
postInstall = ''
${old.postInstall or ""}
remove-references-to -t ${scope.HTTP} "$out/bin/.cabal-wrapped"
remove-references-to -t ${scope.Cabal} "$out/bin/.cabal-wrapped"
'';
}) cabal-install;

cabal-install-solver = super.cabal-install-solver.overrideScope cabalInstallOverlay;

# Needs cabal-install >= 3.8 /as well as/ matching Cabal
Expand Down

0 comments on commit caa1c96

Please sign in to comment.