Ask HN: What's stopping Guix from building static binaries for various targets?
tetris11
2 days ago
5
2
Guix can build for various different targets using `guix build --target <arch>`, and it can build entire linked libraries that can be deployed as a tarball to a target machine via `guix pack --target <arch>`...

But it can't do the one thing that Nix can do reliably and that is produce a single static binary.

What is stopping it?

Many packages are written using the `(build-system gnu-build-system)` macro.

How hard is it to add a `(build-system gnu-build-system 'static)` parameter, that changes the configure step to use the `-static` flag?

revskill2 days ago
Fear.
gkoosa day ago
In Guix, packages are typically dynamically linked against libraries in the store. Static linking changes not just the configure flags, but also how dependencies are pulled in - you'd have to make sure every dependency is available as a static .a library for the target platform and many Guix packages aren't built with static artifacts at all.