astro / deadnix

Scan Nix files for dead code
GNU General Public License v3.0
507 stars 13 forks source link

Provide a statically linked package #83

Open jzbor opened 2 months ago

jzbor commented 2 months ago

I noticed that my CI takes a lot of time downloading dependencies for deadnix (namely libgcc, glibc and their dependencies). I think this could be avoided by using a binary that is statically linked against musl. Ideally this could be provided as a flake output.

astro commented 2 months ago

Though I got rid of naersk, I am failing to build with pkgsCross.musl64.pkgsStatic.

Cross-building deadnix from nixpkgs works, however. Would you like me to switch deadnix-action to that?

jzbor commented 2 months ago

I didn't even know of deadnix-action. Currently I use deadnix from nixpkgs, so just using that might work. One thing is, that it will not be cached like the default package.

I think the best solution would be a deadnix-static package so it could make use of the public binary cache, but I think this might not align with nixpkgs packaging guidelines.

jzbor commented 1 month ago

So I have now successfully created a static build with crane. Sadly however the benefit seems to be negated by the usage of flakes, as their download takes almost as long as downloading libc + dependencies (see here).