Hello HN!
I've always had a bad time redistributing programs that use shared libraries, AppImage in my opinion does too much, and a container is an overkill - not always integrates smoothly.
I've moved to nix since long ago, but redistributing between nix and other distros or vice versa it's still a pain in the ass, more so if you want to run an alien app in nix or a nix app without the package manger in any other distro.
For that, with the help of Claude, I've implemented a format that deduces at pack-time all the shared libraries a program needs, puts them, together with its own glibc and a patched dynamic linker into a single executable.
This means that you don't actually need a runtime nor any special capability, it can run inside a FROM SCRATCH docker, alpine linux etc... And it also supports coreutils-like multiple programs accessible via symlinks, so it is a good fit for that purpose.
You can just use:
> felf pack $(which git) --output git.felf
and you'll have already a git binary that works everywhere, no matter which distro you are building this from. This only packs the binary and their dependencies.
Essentially, the effect is similar as if you LD_PRELOAD's all the libraries that it requires.
In the end, we have been fighting these demons since long long ago, chroots/docker/appimage/flatpack/nix etc...
So this xkcd applies: https://xkcd.com/927/
I'm happy to share the project, I hope it inspires new discoveries/tools in this regard!
Comments URL: https://news.ycombinator.com/item?id=50415219
Points: 1
# Comments: 0