How to rebuild cabal executable and/or work around GLIBC version error

I am working on an Ubuntu 16.04 system and trying to get cabal up and running.

I’ve installed ghcup successfully and then installed cabal using ghcup. However, when I try to execute cabal I get:

cabal: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by cabal)

So the system is too old for the cabal executable. OK, so I’m thinking that I will rebuild cabal to get an executable which works for this old system. (Is there another way to circumvent the GLIBC version error?)

However, in searching various resources, I cannot find any instructions about how to rebuild cabal. cabal/CONTRIBUTING.md at master · haskell/cabal · GitHub only says cabal build cabal to build a new version; it doesn’t say how to get a working binary to start with. Did I overlook something there?

Are there any instructions about bootstrapping cabal? I have searched for a while now and I am empty-handed. I hope someone has some info about it.

1 Like

I am wondering: maybe build cabal-install with Stack, as Stack binary distributions for Linux/x86_64 (including old versions, if need be) are readily available? Project-level configuration (stack.yaml) for cabal-install-3.10.3.0:

snapshot: nightly-2024-04-04 # GHC 9.8.2
extra-deps:
- Cabal-3.10.3.0

EDIT: I read that Ubuntu 16.04 is based on Debian 9 ‘stretch’, and GHC 9.8.2 comes in a Debian 9/x86_64 flavour. EDIT2: This is an example source for that: What Debian version are the different Ubuntu versions based on? - Ask Ubuntu

1 Like

We can certainly fix that in the metadata.

1 Like

This should be fixed now: Fix Ubuntu 16.04 support by hasufell · Pull Request #197 · haskell/ghcup-metadata · GitHub

Note that it seems the way that cabal >= 3.8.1.0 invokes git in some circumstances is incompatible with git 2.7.4, which is shipped by Ubuntu 16.04: cabal-install does not work with git 2.7.4 (Ubuntu 16.04) · Issue #9868 · haskell/cabal · GitHub

1 Like