nixos/binfmt: Avoid adding to extra-sandbox-paths with fixBinary#494593
nixos/binfmt: Avoid adding to extra-sandbox-paths with fixBinary#494593dramforever merged 2 commits intoNixOS:masterfrom
Conversation
|
I originally kept the extra sandbox paths.
I wonder, what's the downside to having those paths? Performance impact on sandbox setup? In either case, I don't feel strongly about this. Feel free.
|
It should be possible, with some work in Nix, to make use of the fact that "binfmt_misc namespaces" exist (actually just that each user namespace has its own binfmt_misc): torvalds/linux@21ca59b. This way, we can avoid having binfmt_misc emulators contaminate native and cross builds altogether. I intend to work towards that. I originally didn't mention this because I haven't got that working yet, and because I thought avoiding impurity as much as possible was obvious. |
|
Re: dynamic vs static emulators, I will concede that dynamically linked emulators should be avoided for chroot-like use cases, so including emulated containers, emulated-native Nix builds. For non-chroot use cases dynamically linked emulators work well. In particular, the |
This PR isn't avoiding any impurity. But I guess it's a first step towards setting up binfmt_misc on builds where it is necessary only (and wiping it where it isn't?). That would be slick. 👍 |
|
(nixpkgs-review is useless here but passes. The test evaluates and builds on x86_64-linux too. Likewise, |
|
In case anyone was waiting for this |
Static emulators should not require setting
nix.settings.extra-sandbox-paths.I hope this way of organizing the defaults makes sense.
Honestly I think non-static emulators should be thrown away altogether but I just want to make the static case happier for now.
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.