Skip to content

Commit 4f0b69a

Browse files
committed
fix(Cabal): fix abi tag in case ghc's unit-id is the same as the compiler id
1 parent fdf8b59 commit 4f0b69a

File tree

1 file changed

+7
-6
lines changed
  • Cabal/src/Distribution/Simple

1 file changed

+7
-6
lines changed

Cabal/src/Distribution/Simple/GHC.hs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,13 @@ configureCompiler verbosity hcPath conf0 = do
237237
-- In this example, @AbiTag@ is "inplace".
238238
compilerAbiTag :: AbiTag
239239
compilerAbiTag =
240-
maybe
241-
NoAbiTag
242-
AbiTag
243-
( dropWhile (== '-') . stripCommonPrefix (prettyShow compilerId)
244-
<$> Map.lookup "Project Unit Id" ghcInfoMap
245-
)
240+
case Map.lookup "Project Unit Id" ghcInfoMap of
241+
Nothing -> NoAbiTag
242+
Just "" -> NoAbiTag
243+
Just projectUnitId ->
244+
case dropWhile (== '-') $ stripCommonPrefix (prettyShow compilerId) projectUnitId of
245+
"" -> NoAbiTag
246+
tag -> AbiTag tag
246247

247248
let comp =
248249
Compiler

0 commit comments

Comments
 (0)