Skip to content

Commit 7ffd20d

Browse files
committed
Use a flag to fake being ghc
1 parent ca4ac76 commit 7ffd20d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/MicroCabal/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ decodeCommonArgs env = do
5555
let loop e ("-v" : as) = loop e{ verbose = verbose e + 1 } as
5656
loop e ("-q" : as) = loop e{ verbose = -1 } as
5757
loop e ("-r" : as) = loop e{ recursive = True } as
58-
loop e (('-':'f':s) : as) = loop e{ eflags = decodeCabalFlags s } as
58+
loop e (('-':'f':s) : as) = loop e{ eflags = decodeCabalFlags s ++ eflags e } as
5959
loop e ("--ghc" : as) = do be <- ghcBackend env; loop e{ backend = be } as
6060
loop e ("--mhs" : as) = do be <- mhsBackend env; loop e{ backend = be } as
6161
loop e ("--dry-run" : as) = loop e{ dryRun = True } as

src/MicroCabal/Normalize.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ cond info = eval
7979
eval (Cimpl s mv) = n == s && maybe True (inVersionRange v) mv
8080
-- Pretend we are ghc >= 9.0. This is an ugly hack, but makes
8181
-- some packages work with no change (change is hard!).
82-
|| s == "ghc" && maybe False (inVersionRange hackv) mv
82+
|| fromMaybe False (lookup "fake-ghc" (flags info)) &&
83+
s == "ghc" && maybe False (inVersionRange hackv) mv
8384
where (n, v) = impl info
84-
hackv = makeVersion [9,0,0]
85+
hackv = makeVersion [9,6,0]
8586

8687
inVersionRange :: Version -> VersionRange -> Bool
8788
inVersionRange v (VEQ v') = v == v'

0 commit comments

Comments
 (0)