4 ms·
Agreed, if the binary is statically linked. If you run `file` on the output from that and it shows 'dynamically linked' then you're playing games with porting o
by ghotli 3y ago
Agreed, if the binary is statically linked. If you run `file` on the output from that and it shows 'dynamically linked' then you're playing games with porting over libraries, changing the library loading path, or just going full chroot like linux from scratch does with the bootstrapping part of the install. I find static binaries simplest to work with in that context but agreed I use that pattern too with docker and generally build ad-hoc tools within containers like that. If only these devices could run docker but I'm left to my own tooling to figure out per device.
- 8organicbits 3y agoAgreed, dynamically linked binaries don't drop in well.
- lloeki 3y agoIn a way, that's what Nix sets out to do, isolating even dynamically linked libraries: if two derivations depend on the same shared lib derivation then it's reused, if not then they don't conflict. Each leaf derivation can be handled completely independently of the others, and independently of the original system†. And then when Nix† is not an option at runtime, dockerTools†† can build a Docker image to do the minimisation+isolation. That said, Nix might also be completely overkill in some scenarios where static linking would be just fine and very practical. The practical simplicity of a single binary should not be overlooked. † nixpkgs is sufficient, a full nixos is not needed †† https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-dockerTools https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-dockerTool...
- vacuity 3y agoSo Nix keeps track of different versions of shared libraries?
- sporeray 3y agoYeah, each package/lib is stored in a unified directory by it's hash https://zero-to-nix.com/concepts/nix-store https://zero-to-nix.com/concepts/nix-store. Different variation different hash.
- YoshiRulz 3y agoYou've missed nix-bundle and pkgsStatic, which are much closer to the above idea re: copying to another machine.