Earlier PR #12 mentions this as a future thing to explore.
Right now the Linux binary builds are dynamically linked against whatever local linux environment the build happens in, which works on most distros but breaks for non-FHS distros (like NixOS, guix, etc).
For example:
$ npx hunkdiff
Need to install the following packages:
hunkdiff@0.11.1
Ok to proceed? (y) y
Could not start dynamically linked executable: /home/agent/.npm/_npx/4c45ab9f0afbb831/node_modules/hunkdiff-linux-x64/bin/hunk
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see:
https://nix.dev/permalink/stub-ld
musl is a tiny standalone stdlib build target that can be statically linked against and will work on any linux distro, popular npm binaries like codex and opencode do this as well.
Not sure what is the best approach to integrate into the current build workflow. Perhaps something along the lines of bun run build:release -DZIG_TARGET=x86_64-linux-musl -DCMAKE_EXE_LINKER_FLAGS="-static" (untested).
(Disclaimer: I am not an npm packaging or bun expert, this content is meat-written after some research so it may be incorrect.)
Earlier PR #12 mentions this as a future thing to explore.
Right now the Linux binary builds are dynamically linked against whatever local linux environment the build happens in, which works on most distros but breaks for non-FHS distros (like NixOS, guix, etc).
For example:
musl is a tiny standalone stdlib build target that can be statically linked against and will work on any linux distro, popular npm binaries like codex and opencode do this as well.
Not sure what is the best approach to integrate into the current build workflow. Perhaps something along the lines of
bun run build:release -DZIG_TARGET=x86_64-linux-musl -DCMAKE_EXE_LINKER_FLAGS="-static"(untested).(Disclaimer: I am not an npm packaging or bun expert, this content is meat-written after some research so it may be incorrect.)