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
Full GCC is included in the Nix closure of built artifacts #829
Comments
What's the output of |
@michaelpj it seems to be a direct dependency:
There's some mention of |
FWIW, non-static Haskell executables from nixpkgs also seem to depend on GCC, so it's not just us. |
This looks sort of relevant as a way this can happen: NixOS/nixpkgs#311 |
@Profpatsch, friendly ping -- any chance you know why this might happen (both here and in Nixpkgs in general)? I saw that you fixed the closure size issues with Pandoc. |
Pandoc in nixpkgs is a static executable which is why it avoids this problem, I think. The question is whether it's avoidable for dynamically linked things too. |
I was just investigating this in our builds.
I get a large number of
|
As expected, setting |
Ah nice @eamsden! That worked for me using only
This raises the question of why |
Quoth @angerman:
|
Where do you add those options?
|
I met the same problem even I added the |
Try and use |
OK, I figure it out why. In my case, I built a fully static linked haskell executable, yet somehow, there is a reference to the haskell library path in the static binary. Nix scans the static binary and found the reference path so it think that's a runtime dependency which causes it packed |
How do we apply the |
Aha, finally figured it out..
|
If that's true, a question is whether it would be less painful to turn it off in the cases where it breaks. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
When I build an executable, the Nix dependency closure includes the full GCC compiler. When I use the Nix Docker tools to build a Docker image with a Haskell app, this blows up the size by 143 MB.
To demonstrate, I created a blank Haskell project with
stack new
and added the basicdefault.nix
from the Haskell.nix docs. You can find the repro here: https://github.com/thomasjm/haskell-nix-closure.When I build this and look at the closure, I get the following:
Notice how in addition to normal runtime libs, this contains
gcc-9.2.0-lib
(which is small and okay) as well asgcc-9.2.0
(which is big and shouldn't be a runtime dependency).The text was updated successfully, but these errors were encountered: