haskell / cabal

Official upstream development repository for Cabal and cabal-install
https://haskell.org/cabal
Other
1.62k stars 691 forks source link

cabal accidentally doesn't include abi hash for development compilers #10170

Open mpickering opened 3 months ago

mpickering commented 3 months ago

The current logic says

compilerAbiTag :: AbiTag
      compilerAbiTag = maybe NoAbiTag AbiTag (Map.lookup "Project Unit Id" ghcInfoMap >>= stripPrefix (prettyShow compilerId <> "-"))

If we look at ghc --info for a development build of GHC then we see..

("Project Unit Id","ghc-9.11-inplace")

but the version is reported as

The Glorious Glasgow Haskell Compilation System, version 9.11.20240612

So the call to stripPrefix will fail and no ABI tag will be used because the Project Unit Id is not prefixed by ghc-9.11.20240612.

Perhaps a more robust but confusing tactic is to hash the contents of Project Unit Id rather than attempting to parse it.

andreasabel commented 3 days ago

Bumped into this in the CI for haskell-ci with ghc-9.12 alpha1: https://github.com/andreasabel/haskell-ci/actions/runs/11434726576/job/31808789430#step:26:35

[ 0.00002] ghc.info: /github/home/.ghcup/ghc/9.12.20241014/bin/ghc [ 0.00058] process.0.start: cwd=/tmp /github/home/.ghcup/ghc/9.12.20241014/bin/ghc --info [ 0.03486] peu.die: ghc-9.12.20241014- is not prefix of Project Unit Id: ghc-9.12-9c22