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
haskellPackages: add ghcForStatic #3194
Conversation
It's built with gmp that contains static libraries as well, so one is able to build statically linked haskell programs.
Hmm, maybe I should've made the wrapper pass these additional flags automatically. Well, I believe some real users are needed to finish this. |
Shouldn't GHC refer unconditionally to a static-linking-enabled version of GMP? I mean, having those additional *.a files lying around doesn't cost much, right? It seems okay to just hard-code that variant instead of introducing yet another different flavor of the GHC compiler. |
Yes, thanks, I was being blind. I did check that the additional files add ~1.5 MB and the rest of gmp is even smaller. When I look at the sizes of Haskell stuff, this is really negligible :-D |
Updated. This will result into recompilation of all haskell stuff, so the interested people should test before merging. Otherwise we might find soon that e.g. zlib or something is also causing problems. Also, I read this links glibc in statically, which can cause problems running on a system with even a slightly different version of (g)libc (they write). http://stackoverflow.com/questions/8657908/deploying-yesod-to-heroku-cant-build-statically/8658468#8658468 |
# see thread http://permalink.gmane.org/gmane.linux.distributions.nixos/13526 | ||
gmp = gmp.override { withStatic = true; }; | ||
}; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This kind of override probably won't work because pkgs
is a recursive set. When I run
nix-build ~/.nix-defexpr -A haskellPackages_ghc782.ghcPlain --dry-run
with this patch applied, it doesn't re-build anything. I'm still trying to figure out what the proper way is to achieve the desired effect.
Okay ... the following code snippet in
I'm not sure whether it's a good idea for |
I've committed the patch to a branch as e7cd8178c00d8731873cd80313f7772276ecdea4. Hydra is building it at http://hydra.nixos.org/jobset/nixpkgs/haskell-updates. |
Ah, I didn't notice that |
Frankly, the code that sets up these Haskell packages is a mess. I'm sure this whole boot-strapping logic can be simplified quite a bit. It's just that worrying about this kind of thing is exhausting and inconvenient, so I typically prefer flashier tasks such as updating some library. :-) |
Is this pull request still relevant in the presence of #3232? |
Merged. Thanks for patch, Vladimir! |
It's built with gmp that contains static libraries as well,
so one is able to build statically linked haskell programs.
Example:
This is just a proof of concept: