-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
How do I actually use this? #88
Comments
Hey @athas, given that futhark is already in nixpkgs, the simplest approach would be to clone this repo (including Approach 1: Using futhark already in nixpkgs
That'd build futhark as is in nixpkgs, with all the overrides for various system and Haskell packages to make static linking work. You can also add This gets pretty far, until:
If you wanted to lift that restriction to check if it'd work without the bounds, you could add
Approach 2: Providing your own
|
Thanks for the advice. I suspect some of my own explorations ran into the upstream musl/gold problem. It can be a bit hard to tell what's a persistent error and what's just temporary breakage. I will try to go with Approach 2, because I am interested in doing builds independently of the Futhark in nixpkgs (which can be arbitrarily out of date, and is certainly not usable for producing nightly builds in CI). |
@athas Yes, that makes sense; approach 2 is also what Dhall uses.
The CI may help with it; consider for example https://buildkite.com/nh2/static-haskell-nix/builds?branch=master&page=2 It shows that on Unfortunately it doesn't allow me to show these things in separate lists, or as separate badges; both are |
is there a way of using it directly from a .nix without cloning the repo? via e.g. builtins.fetchGit |
@mikelpr we have an example here: |
It would be great to add the information in this issue to the readme, especially a link to, or condensed version of @monacoremo's expression ( |
yes that's a fantastic project ! The last green CI was october 6th, there seems to be a long backlog of pipelines that could probably be skipped. I would be interested in a nixpkgs bump to select ghc884 . |
Ah thanks, indeed an update seems to have sent the buildkite daemon into a crashloop due to permissions (probably because dir names changed due to NixOS/nixpkgs#78373 and so the permissions were wrong). I've fixed it now and cancelled the in-between |
Here's a minimal flake for building a static binary. I've used this successfully to build a Yesod server, so it seems to work OK with template Haskell.
If anyone has any ideas for improvements, I'd love to hear them. @nh2, would you consider a PR adding a templates flake? |
I have a Haskell program that I would like to build statically with Nix. I currently link with glibc, which has the usual problems, so I'm quite interested in linking with Musl instead. But while I use Nix and NixOS, I'm afraid I don't quite understand the instructions here. The only clear example I can find of how to link my own, single package against musl is the minimal example, which I am told not to use in practice. Apart from that, the documentation points me at survey/default.nix, which is a 1300 line .nix file, and encourages me to "easily import this functionality and add an override to add your own packages". I've tried reading the code, but I'm afraid I have no idea what is going on, or how to make use of it.
Is there a simple example of how to use this somewhere?
The text was updated successfully, but these errors were encountered: