Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Documentation for fully static distribution #1881

Open
avdv opened this issue Mar 20, 2023 · 3 comments
Open

Better Documentation for fully static distribution #1881

avdv opened this issue Mar 20, 2023 · 3 comments

Comments

@avdv
Copy link
Member

avdv commented Mar 20, 2023

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

@aherrmann
Copy link
Member

@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.

@jonathanlking
Copy link

@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 😅

@aherrmann
Copy link
Member

Some of the progress from ZuriHac 2023: to update static-haskell-nix and include an appropriate GHC nh2/static-haskell-nix#116 and to test fully static builds on Skyscope tweag/skyscope#94

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

3 participants