Skip to content

Commit

Permalink
Cabal fix for ghc-options -fplugin in ghc >=9.6.3
Browse files Browse the repository at this point in the history
Include haskell/cabal#9384 to fix #2096
  • Loading branch information
hamishmack committed Nov 6, 2023
1 parent df609c2 commit a0f7e8c
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions overlays/bootstrap.nix
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ in {
++ final.lib.optionals (final.stdenv.targetPlatform.isGhcjs) (fromUntil "9.6.1" "9.6.3" ./patches/ghc/ghc-9.6-JS-implement-TH-support.patch)
++ final.lib.optionals (final.stdenv.targetPlatform.isGhcjs) (fromUntil "9.6.3" "9.8" ./patches/ghc/ghc-9.6.3-JS-implement-TH-support.patch)
++ fromUntil "9.8.1" "9.8.2" ./patches/ghc/ghc-9.8-cabal-c-soures-fix.patch
++ fromUntil "9.6.3" "9.10" ./patches/ghc/ghc-9.6.3-Cabal-9384.patch

# the following is a partial reversal of https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4391, to address haskell.nix#1227
++ final.lib.optional (versionAtLeast "8.10.6" && versionLessThan "9.0" && final.stdenv.targetPlatform.isAarch64) ./patches/ghc/mmap-next.patch
Expand Down
48 changes: 48 additions & 0 deletions overlays/patches/ghc/ghc-9.6.3-Cabal-9384.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
diff --git a/libraries/Cabal/Cabal/src/Distribution/Simple/GHC.hs b/libraries/Cabal/Cabal/src/Distribution/Simple/GHC.hs
index 9d653f858..1fbd15318 100644
--- a/libraries/Cabal/Cabal/src/Distribution/Simple/GHC.hs
+++ b/libraries/Cabal/Cabal/src/Distribution/Simple/GHC.hs
@@ -1861,18 +1861,12 @@ libAbiHash verbosity _pkg_descr lbi lib clbi = do
libBi = libBuildInfo lib
comp = compiler lbi
platform = hostPlatform lbi
- vanillaArgs0 =
+ vanillaArgs =
(componentGhcOptions verbosity lbi libBi clbi (componentBuildDir lbi clbi))
`mappend` mempty {
ghcOptMode = toFlag GhcModeAbiHash,
ghcOptInputModules = toNubListR $ exposedModules lib
}
- vanillaArgs =
- -- Package DBs unnecessary, and break ghc-cabal. See #3633
- -- BUT, put at least the global database so that 7.4 doesn't
- -- break.
- vanillaArgs0 { ghcOptPackageDBs = [GlobalPackageDB]
- , ghcOptPackages = mempty }
sharedArgs = vanillaArgs `mappend` mempty {
ghcOptDynLinkMode = toFlag GhcDynamicOnly,
ghcOptFPic = toFlag True,
diff --git a/libraries/Cabal/Cabal/src/Distribution/Simple/GHCJS.hs b/libraries/Cabal/Cabal/src/Distribution/Simple/GHCJS.hs
index c8721746a..dcd5b3230 100644
--- a/libraries/Cabal/Cabal/src/Distribution/Simple/GHCJS.hs
+++ b/libraries/Cabal/Cabal/src/Distribution/Simple/GHCJS.hs
@@ -1573,18 +1573,12 @@ libAbiHash verbosity _pkg_descr lbi lib clbi = do
libBi = libBuildInfo lib
comp = compiler lbi
platform = hostPlatform lbi
- vanillaArgs0 =
+ vanillaArgs =
(componentGhcOptions verbosity lbi libBi clbi (componentBuildDir lbi clbi))
`mappend` mempty {
ghcOptMode = toFlag GhcModeAbiHash,
ghcOptInputModules = toNubListR $ exposedModules lib
}
- vanillaArgs =
- -- Package DBs unnecessary, and break ghc-cabal. See #3633
- -- BUT, put at least the global database so that 7.4 doesn't
- -- break.
- vanillaArgs0 { ghcOptPackageDBs = [GlobalPackageDB]
- , ghcOptPackages = mempty }
sharedArgs = vanillaArgs `mappend` mempty {
ghcOptDynLinkMode = toFlag GhcDynamicOnly,
ghcOptFPic = toFlag True,

0 comments on commit a0f7e8c

Please sign in to comment.