Github actions ubuntu-latest no longer installs gold

ubuntu-latest has switched from ubuntu-24.04 to ubuntu-26.04. It seems like in this switch, gold is no longer installed.

Cabal has an issue for this for their CI, and @Bodigrim says it’s fixed for GHC 9.6+, but I see it when building with Stack + GHC 9.12:

Is there a broader ecosystem fix? Is it just because of Stack? Are ghcup or haskell-actions/setup affected?

1 Like

We’ve had this issue recently on our older GHC CI in discord-haskell; see @yutotakano’s PR: Fix CI not finding gold linker in latest Ubuntu by yutotakano · Pull Request #267 · discord-haskell/discord-haskell · GitHub

It’s a bug in the GHC 9.4 series. So no, it’s not just because of Stack.

Yes, which is why this is unfortunate. Right now, everybody has to work around it. GHC won’t release a patch since they don’t patch old releases. haskell-actions wouldn’t address it either, since they just install using ghcup.

That’s why I asked @hasufell on the GHC issue if he’d be open to have GHCup patch the bug in the released GHC package. It’s in a script, not a binary, so it is relatively straight forward.

I see proposals in Servant and cabal to just drop the old compiler. That is of course an option, but if GHCup offers installation of something (even if it is old), wouldn’t it be nice if it just worked? What is the point of offering it if it won’t work?

I’m seeing the error in 9.12. Does your comment still apply?

Oh, you might have a separate issue. It looks like you are not including the Ubuntu version in the cache key. Have you checked whether the issue is solved if you try without the cache? I am worried that you’re taking a cache from when you had gold, and using it when gold is gone.

ah good idea. I’ll try that later

I’ve been using ubuntu-26.04 in GHA for Haskell for some time and the solution for GHC < 9.6 is to just apt-get install binutils-gold.

5 Likes