Better Documentation for fully static distribution
Compiling a standalone, static executable should be better documented.
See https://www.joachim-breitner.de/blog/776-Distributing_Haskell_programs_in_a_multi-platform_zip_file
Also see Tweag blog
@jonathanlking I just saw your ZuriHac project "Building statically linked Haskell binaries with Bazel". Very cool! I thought I'd ping you here in case there is added context on this issue that may be useful to you. The blog post linked above was based on the example project you've linked to. I'll also be at ZuriHac. Would love to connect there and see if I can help.
@aherrmann I'm looking forward to meeting you 🙂
I've already managed to get up to GHC 9.4 working on a fork and on our company monorepo (I work at Habito).
I'm very keen on adding some tests (e.g. to test libpq is working properly and also to run ldd on the binary), which should give more confidence when upgrading again in the future. I'd also be keen to get a (cachix) nix cache set up, as building everything from scratch can take hours, which isn't fun if you just wanted to test it out.
Two areas I definitely would appreciate help on are:
- The Nix derivation for GHC 9.6 switches to Hadrian and has different build parameters. I naively tried a few things but didn't get very far and it might be a lot quicker/more enjoyable pairing on this!
- I discovered a segfault in the GHC linker when loading statically linked libraries for Template Haskell evaluation (I'm working on a minimal example here), while not specific to Bazel, it blocked us from upgrading (until I found a workaround). It might be nice to debug it a bit further/open a GHC bug report. It is also possible that it's since been fixed in 9.6, but I can't test it yet 😅
Some of the progress from ZuriHac 2023: to update static-haskell-nix and include an appropriate GHC https://github.com/nh2/static-haskell-nix/pull/116 and to test fully static builds on Skyscope https://github.com/tweag/skyscope/pull/94