-
Notifications
You must be signed in to change notification settings - Fork 33
[RFC] Statically linked binaries #31
Description
I'm opening this issue to start a discussion around the ability to build statically linked binaries for Haskell projects. I think it will be extremely beneficial for the whole Haskell community if developers could produce such binaries easily with GitHub Actions workflows.
The following blog post describes in detail how to produce binaries for Haskell applications on all three operating systems using the setup-haskell action:
Cabal has the --enable-executable-static flag (mentioned in the blog post about the latest changes in HLS) which allows building statically linked binaries. Still, since they are built on Ubuntu, they are not truly statically linked. I expressed my concerns in the comments under the blog post:
For real static binaries, you need to build them inside the Alpine-based Docker container. I've used the ghc-musl in the past, and I find it quite pleasant and easy to use, but I had to do everything manually on my laptop. It would be nice to automate this process somehow.
I'm going to mention a few people, who might be interested in this discussion (sorry for notifications, feel free to unsubscribe from this conversation):
- @vrom911 (author of the GitHub binaries releases blog post)
- @bubba (author of producing statically linked binaries for HLS)
- @utdemir (author of the
ghc-muslproject) - @hasufell (author of statically linked binaries for
ghcup-hs)
I would like to hear your thoughts on how we can proceed with this!