Skip to content

Commit 374d4bd

Browse files
committed
Add 9220 patch
1 parent b50e3c9 commit 374d4bd

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

modules/configuration-nix.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ in {
4444
(fromUntil "3.2.0.0" "3.5" ../overlays/patches/Cabal/Cabal-3.0.0.0-no-final-checks.diff)
4545
(fromUntil "3.6.0.0" "3.11" ../overlays/patches/Cabal/Cabal-3.6.0.0-drop-pkg-db-check.diff)
4646
(fromUntil "3.6.0.0" "3.11" ../overlays/patches/Cabal/Cabal-3.6.0.0-no-final-checks.diff)
47+
(fromUntil "3.6.0.0" "3.11" ../overlays/patches/Cabal/9220.patch)
4748
];
4849

4950
# These two patches are:

overlays/patches/Cabal/9220.patch

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
diff --git a/src/Distribution/Simple/Configure.hs b/src/Distribution/Simple/Configure.hs
2+
index ac7bd852f..803475283 100644
3+
--- a/src/Distribution/Simple/Configure.hs
4+
+++ b/src/Distribution/Simple/Configure.hs
5+
@@ -637,22 +637,6 @@ configure (pkg_descr0, pbi) cfg = do
6+
"--enable-split-objs; ignoring")
7+
return False
8+
9+
- let compilerSupportsGhciLibs :: Bool
10+
- compilerSupportsGhciLibs =
11+
- case compilerId comp of
12+
- CompilerId GHC version
13+
- | version > mkVersion [9,3] && windows ->
14+
- False
15+
- CompilerId GHC _ ->
16+
- True
17+
- CompilerId GHCJS _ ->
18+
- True
19+
- _ -> False
20+
- where
21+
- windows = case compPlatform of
22+
- Platform _ Windows -> True
23+
- Platform _ _ -> False
24+
-
25+
let ghciLibByDefault =
26+
case compilerId comp of
27+
CompilerId GHC _ ->
28+
@@ -669,15 +653,6 @@ configure (pkg_descr0, pbi) cfg = do
29+
not (GHCJS.isDynamic comp)
30+
_ -> False
31+
32+
- withGHCiLib_ <-
33+
- case fromFlagOrDefault ghciLibByDefault (configGHCiLib cfg) of
34+
- True | not compilerSupportsGhciLibs -> do
35+
- warn verbosity $
36+
- "--enable-library-for-ghci is no longer supported on Windows with"
37+
- ++ " GHC 9.4 and later; ignoring..."
38+
- return False
39+
- v -> return v
40+
-
41+
let sharedLibsByDefault
42+
| fromFlag (configDynExe cfg) =
43+
-- build a shared library if dynamically-linked
44+
@@ -774,7 +749,7 @@ configure (pkg_descr0, pbi) cfg = do
45+
withProfExeDetail = ProfDetailNone,
46+
withOptimization = fromFlag $ configOptimization cfg,
47+
withDebugInfo = fromFlag $ configDebugInfo cfg,
48+
- withGHCiLib = withGHCiLib_,
49+
+ withGHCiLib = fromFlagOrDefault ghciLibByDefault (configGHCiLib cfg),
50+
splitSections = split_sections,
51+
splitObjs = split_objs,
52+
stripExes = strip_exe,
53+
diff --git a/src/Distribution/Simple/Setup.hs b/src/Distribution/Simple/Setup.hs
54+
index 36f6aa22f..aa60b73b8 100644
55+
--- a/src/Distribution/Simple/Setup.hs
56+
+++ b/src/Distribution/Simple/Setup.hs
57+
@@ -384,12 +384,7 @@ defaultConfigFlags progDb = emptyConfigFlags {
58+
configCabalFilePath = NoFlag,
59+
configVerbosity = Flag normal,
60+
configUserInstall = Flag False, --TODO: reverse this
61+
-#if defined(mingw32_HOST_OS)
62+
- -- See #8062 and GHC #21019.
63+
- configGHCiLib = Flag False,
64+
-#else
65+
- configGHCiLib = NoFlag,
66+
-#endif
67+
+ configGHCiLib = Flag True,
68+
configSplitSections = Flag False,
69+
configSplitObjs = Flag False, -- takes longer, so turn off by default
70+
configStripExes = NoFlag,

0 commit comments

Comments
 (0)