Closed danbst closed 5 years ago
I've seen something like this before, which was due to a module using cabal's Paths_
(which contains links to the library). You should be able to check this with nix why-depends <your derivation> <path-of-warp>
, for instance.
EDIT:
Forgot to mention the fix: run remove-references-to -t ${the-warp-you-are-using} <your-exe>
from makeWrapper
. But first make sure those references really are spurious.
This is solved for most packages now.
E.g. on commit 3ae445d7fd1f84e61617fc16e83d7fbd005cc438:
% nix-store -qR $(NIX_PATH=nixpkgs=nixpkgs nix-build default.nix)
/nix/store/702n4ffyszdm7vh154w5nk9h8axm1cl4-example-scotty-app-0.1.0.0
Some packages like pandoc
still have that problem (2 GB closure), likely because they actually use Paths_
and data files and so on as @nmattia said.
But for the original problem of this happening for all packages, that should be solved.
Thus I'll close this general issue; let's file individual issues for packages where we want to fix this.
Found here: https://github.com/jgm/pandoc/blob/c3236560c234aaefe9239ba2e391f540f1d6408a/INSTALL.md#linux
This provides both pandoc and pandoc-citeproc. The executables are statically linked and have no dynamic dependencies or dependencies on external data files. Note: because of the static linking, the pandoc binary from this package cannot use lua filters that require external lua modules written in C.
That seems to give some hints.
While it should be a static binary, it still contains links to /nix/store derivations:
The resulting closure is quite large and includes
gcc
and all Haskell libs. Total runtime closure size is 1.9 Gb!