ndmitchell / hlint

Haskell source code suggestions
Other
1.47k stars 196 forks source link

Statically link binary hlint distributions #1533

Open phadej opened 1 year ago

phadej commented 1 year ago

From https://github.com/haskell-CI/haskell-ci/pull/666

One thing that I discovered when trying out the hlint-3.6.1 bindist is that dynamically links against the glibc version provided by Ubuntu 22.04 (Jammy). This will not work if you run hlint-3.6.1 on Ubuntu 20.04 (Bionic),

For that reason, I build cabal-docspec and cabal-plan etc on alpine linux with --enable-executable-static (see e.g. https://github.com/haskell-hvr/cabal-plan/blob/master/Makefile)

benz0li commented 1 year ago

If my multi-arch (linux/amd64, linux/arm64/v8) glcr.b-data.ch/ghc/ghc-musl docker image was used to build hlint, this project could provide statically linked binaries for both Linux/x86_64 and Linux/AArch64.

Cross references:

ndmitchell commented 9 months ago

Happy to take patches to https://github.com/ndmitchell/hlint/blob/master/.github/workflows/release.yml. I'm not a Linux user, but this does sound desirable.

benz0li commented 9 months ago

I'm not a Linux user

I am not a GitHub user :wink:.

benz0li commented 9 months ago

I build my own multi-arch (linux/amd64, linux/arm64/v8) docker images containing the statically linked hlint executable at /usr/local now.

This, to copy the latest executable from said docker images into my multi-arch (linux/amd64, linux/arm64/v8) GHC musl Dev Containers.