Skip to main content

lsupg Static Builds With GHC 9 (Part 2)

It has been more than a year since I last investigated lsupg static builds with GHC 9. I have not had time to work on this at all, and my lsupg project really needs some maintenance. This blog entry investigates the current state of GHC 9 builds for Alpine Linux.

When I last looked into this, many official GHC 9 builds for Alpine Linux had issues. There have since been a few changes:

  • Olivier Benz has a new ghc-musl project that does not use the official GHC builds. He is doing an excellent job at maintaining the project! Note that this project is different from Utku Demir’s ghc-musl project. My understanding is that Utku’s project is effectively deprecated in favor of Olivier’s project.
  • While chatting with Simon Michael recently, I learned that GHCup now installs unofficial builds of GHC 9, and these unofficial builds are working.

I manually prepared a test environment using the latest release of Alpine (version 3.19) and tested the official builds. As with my previous test, GHC 9.0.2 worked without issue. GHC versions 9.2.8, 9.4.8, 9.6.5, and 9.8.2 failed. I checked the currently required Alpine packages configuration for GHCup and confirmed that I did not miss any.

I then tested using GHCup. GHC versions 9.0.2, 9.2.8, 9.6.5, and 9.8.2 use unofficial builds. GHC version 9.4.8 uses the dynamically linked official build. All of these work, and the dynamically linked build was able to compile a static executable without issue.

I have planned to switch to Olivier’s ghc-musl for quite some time. When I first investigated this, I did not move forward because I was unable to reproduce the builds locally. Many builds failed because GPG key servers would very often fail to send keys. (I wonder if everybody experiences such failures…) Other builds failed while building GHC. I am generally hesitant to use containers that I am unable to reproduce locally, but I have recently decided to go ahead and use the images from Docker Hub for lsupg. I hope to do this soon, and I will write about it in a separate blog entry.