Skip to content

Commit a0f7e8c

Browse files
committed
Cabal fix for ghc-options -fplugin in ghc >=9.6.3
Include haskell/cabal#9384 to fix #2096
1 parent df609c2 commit a0f7e8c

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

overlays/bootstrap.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ in {
240240
++ final.lib.optionals (final.stdenv.targetPlatform.isGhcjs) (fromUntil "9.6.1" "9.6.3" ./patches/ghc/ghc-9.6-JS-implement-TH-support.patch)
241241
++ final.lib.optionals (final.stdenv.targetPlatform.isGhcjs) (fromUntil "9.6.3" "9.8" ./patches/ghc/ghc-9.6.3-JS-implement-TH-support.patch)
242242
++ fromUntil "9.8.1" "9.8.2" ./patches/ghc/ghc-9.8-cabal-c-soures-fix.patch
243+
++ fromUntil "9.6.3" "9.10" ./patches/ghc/ghc-9.6.3-Cabal-9384.patch
243244

244245
# the following is a partial reversal of https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4391, to address haskell.nix#1227
245246
++ final.lib.optional (versionAtLeast "8.10.6" && versionLessThan "9.0" && final.stdenv.targetPlatform.isAarch64) ./patches/ghc/mmap-next.patch
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
diff --git a/libraries/Cabal/Cabal/src/Distribution/Simple/GHC.hs b/libraries/Cabal/Cabal/src/Distribution/Simple/GHC.hs
2+
index 9d653f858..1fbd15318 100644
3+
--- a/libraries/Cabal/Cabal/src/Distribution/Simple/GHC.hs
4+
+++ b/libraries/Cabal/Cabal/src/Distribution/Simple/GHC.hs
5+
@@ -1861,18 +1861,12 @@ libAbiHash verbosity _pkg_descr lbi lib clbi = do
6+
libBi = libBuildInfo lib
7+
comp = compiler lbi
8+
platform = hostPlatform lbi
9+
- vanillaArgs0 =
10+
+ vanillaArgs =
11+
(componentGhcOptions verbosity lbi libBi clbi (componentBuildDir lbi clbi))
12+
`mappend` mempty {
13+
ghcOptMode = toFlag GhcModeAbiHash,
14+
ghcOptInputModules = toNubListR $ exposedModules lib
15+
}
16+
- vanillaArgs =
17+
- -- Package DBs unnecessary, and break ghc-cabal. See #3633
18+
- -- BUT, put at least the global database so that 7.4 doesn't
19+
- -- break.
20+
- vanillaArgs0 { ghcOptPackageDBs = [GlobalPackageDB]
21+
- , ghcOptPackages = mempty }
22+
sharedArgs = vanillaArgs `mappend` mempty {
23+
ghcOptDynLinkMode = toFlag GhcDynamicOnly,
24+
ghcOptFPic = toFlag True,
25+
diff --git a/libraries/Cabal/Cabal/src/Distribution/Simple/GHCJS.hs b/libraries/Cabal/Cabal/src/Distribution/Simple/GHCJS.hs
26+
index c8721746a..dcd5b3230 100644
27+
--- a/libraries/Cabal/Cabal/src/Distribution/Simple/GHCJS.hs
28+
+++ b/libraries/Cabal/Cabal/src/Distribution/Simple/GHCJS.hs
29+
@@ -1573,18 +1573,12 @@ libAbiHash verbosity _pkg_descr lbi lib clbi = do
30+
libBi = libBuildInfo lib
31+
comp = compiler lbi
32+
platform = hostPlatform lbi
33+
- vanillaArgs0 =
34+
+ vanillaArgs =
35+
(componentGhcOptions verbosity lbi libBi clbi (componentBuildDir lbi clbi))
36+
`mappend` mempty {
37+
ghcOptMode = toFlag GhcModeAbiHash,
38+
ghcOptInputModules = toNubListR $ exposedModules lib
39+
}
40+
- vanillaArgs =
41+
- -- Package DBs unnecessary, and break ghc-cabal. See #3633
42+
- -- BUT, put at least the global database so that 7.4 doesn't
43+
- -- break.
44+
- vanillaArgs0 { ghcOptPackageDBs = [GlobalPackageDB]
45+
- , ghcOptPackages = mempty }
46+
sharedArgs = vanillaArgs `mappend` mempty {
47+
ghcOptDynLinkMode = toFlag GhcDynamicOnly,
48+
ghcOptFPic = toFlag True,

0 commit comments

Comments
 (0)