Cabal segfault on MacOS Ventura

Cabal: Failed to build slam-0.0.0.1 because it depends on slam-0.0.0.1 which
itself failed to build.
Failed to build servant-server-0.19.2 because it depends on
servant-server-0.19.2 which itself failed to build.
Failed to build w-lggr-2.4.0-4fd1f823. The failure occurred during the
configure step. The build process segfaulted (i.e. SIGSEGV).
Failed to build wai-app-static-3.1.7.4 because it depends on
wai-app-static-3.1.7.4 which itself failed to build.
Failed to build wai-extra-3.1.13.0 because it depends on wai-extra-3.1.13.0
which itself failed to build.

It’s a private codebase, so I can’t share. Perhaps others have been running into similar issues?

Coworker updated to MacOS Ventura last night, reinstalled xcode tools this morning. This is the error he’s getting.

Versions:

  • Cabal 3.8.1.0 and 3.6.2.0 (neither works)
  • GHC 9.2.4
1 Like

Update. It’s also failing on random other packages after a cabal nuking, with exactly the same error but for different package names. We’re performing a full nuking of ghcup and everything haskell-related.

CallStack (from HasCallStack):
  withMetadata, called at src/Distribution/Simple/Utils.hs:370:14 in Cabal-3.8.1.0-inplace:Distribution.Simple.Utils
Error: Cabal: Failed to build lngg-pythn-0.5.8-3f00cd65. The build process
segfaulted (i.e. SIGSEGV).
Failed to build parcel-0.1.0.0 because it depends on parcel-0.1.0.0 which
itself failed to build.
Failed to build servant-py-0.1.1.1 because it depends on servant-py-0.1.1.1
which itself failed to build.
Failed to build slam-0.0.0.1 because it depends on slam-0.0.0.1 which itself
failed to build.
1 Like

Opening an issue on cabal repo might get more eyes on the error.

1 Like

Solution found…

rm -rf ~/.cabal
ghcup nuke 
# we manually uninstalled every GHC/cabal before nuking
# wasn't clear from ghcup nuke -h whether ghcup nuke
# would delete them for us
### Restart computer
### Update our toolchain to use ghc-9.2.5

This caused the error to go away. I have no idea why we had the issue. Very likely some subtlety due the reinstalling xcode toolchain.

2 Likes

Nothing particularly subtle here, you could have just installed GHC 9.2.5 without nuking everything. GHC 9.2.4 does not work on macOS Ventura.

4 Likes

Thanks - that’s a little silly of me (though it was not obvious to me how to know such things).

1 Like

Indeed you were very likely seeing GHC #22497, which ended up being due to an upstream bug in the gmp library.

2 Likes