diff --git a/overlays/bootstrap.nix b/overlays/bootstrap.nix index 0125b188f6..896270d4a9 100644 --- a/overlays/bootstrap.nix +++ b/overlays/bootstrap.nix @@ -82,6 +82,7 @@ in { # will be applied to most versions of the GHC anyway (reordering the patches # results in rebuilds of GHC and reduces sharing in /nix/store). in until "9.11" ./patches/ghc/dll-loader-8.4.2.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/949 -- open + ++ fromUntil "9.4" "9.12" ./patches/ghc/ghc-9.4-9.6-9.8-disable-coreprep-spec-eval.patch # causes more allocations ++ until "9.2" ./patches/ghc/ghc-8.4.3-Cabal2201-no-hackage-tests.patch # ? ++ until "9.2" ./patches/ghc/cabal-host.patch # https://github.com/haskell/cabal/issues/5887 ++ fromUntil "9.2" "9.4" ./patches/ghc/ghc-9.2-cabal-host.patch # https://github.com/haskell/cabal/issues/5887 diff --git a/overlays/patches/ghc/ghc-9.4-9.6-9.8-disable-coreprep-spec-eval.patch b/overlays/patches/ghc/ghc-9.4-9.6-9.8-disable-coreprep-spec-eval.patch new file mode 100644 index 0000000000..75abfd400d --- /dev/null +++ b/overlays/patches/ghc/ghc-9.4-9.6-9.8-disable-coreprep-spec-eval.patch @@ -0,0 +1,20 @@ +diff --git a/compiler/GHC/CoreToStg/Prep.hs b/compiler/GHC/CoreToStg/Prep.hs +index c463f41121..3673b94991 100644 +--- a/compiler/GHC/CoreToStg/Prep.hs ++++ b/compiler/GHC/CoreToStg/Prep.hs +@@ -1785,7 +1785,14 @@ mkFloat env dmd is_unlifted bndr rhs + where + is_hnf = exprIsHNF rhs + is_strict = isStrUsedDmd dmd +- ok_for_spec = exprOkForSpecEval (not . is_rec_call) rhs ++ ok_for_spec = exprOkForSpecEval fun_ok_for_spec rhs ++ fun_ok_for_spec i ++ | is_rec_call i = False ++ | otherwise = ++ case idDetails i of ++ DFunId {} -> False ++ DataConWorkId {} -> False ++ _ -> True + is_rec_call = (`elemUnVarSet` cpe_rec_ids env) + + emptyFloats :: Floats