-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fully statically linked skyscope binary #94
Conversation
So that libffi and libgmp include .a files.
This is awesome, thanks!
Even having to build GHC etc in full, the convenience of distributing a single statically linked binary is worth it IMO. |
Relevant static-haskell-nix upstream work: nh2/static-haskell-nix@c91a9b4, nh2/static-haskell-nix#116 |
Yes, just need to figure out how to build it without timing out CI in that case. Maybe we can connect CI to a Nix remote builder? |
As static-haskell-nix doesn't yet support MacOS, and as we don't have a Nix cache with an appropriate GHC, it will be convenient to allow both types of linking for the time being. The default will be to link dynamically. To build a fully static binary pass: --host_platform=//backend:static_executable
This uses rules_haskell's capability for fully static linking together with static libraries and an appropriate GHC provided by static-haskell-nix and patched as described in this blog post.
A build on Linux confirms that the resulting library is fully static and is functional.
What's missing to be able to merge this is (at least) to have the appropriate GHC, GCC, zlib, etc. in a Nix cache.
Warning: If you test this locally this will build GHC via Nix. You can use a remote builder configured in
/etc/nix/machines
to speed it up.cc @nh2 @jonathanlking