-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] nix: Replace busybox-sandbox-shell with Bash #36669
Conversation
Instead of playing a cat-and-mouse game of finding out what feature we managed to miss enabling in our own variant of busybox shell, just use a minimal version of Bash. At current point the Bash version is roughly 500 kB bigger.
I'm not going to try to block this, but IMO things failing when they use /bin/sh is a good thing. |
But yes, if we're going to try to keep /bin/sh supported there's no reason not to just use bash. |
@shlevy I think your approach of having no |
With this change, could it still happen that a package builds in the sandbox on my machine but sometimes fails on Hydra? Whatever solution we choose should produce consistent results. |
@xeji Yes, it could still happen. Your machine could have nix built with a different version of nixpkgs, or outside of nixpkgs altogether, or hydra's could. But it's less likely with this fix. |
@Mic92 If we get a commitment to move to a no-bin-sh world, I'll gladly stand behind this as an interim solution 😀 I already had patches to glibc etc... |
Of course, killing Should we put |
@7c6f434c By the way, I consider |
@7c6f434c how about using |
@Mic92 sometimes the builds use more scripts; so maybe better safe than annoyed? @shlevy We-ell, I can answer that yes, Re: kernel: will |
What’s the problem with supporting both |
@Profpatsch Even more impurity. We've already had real issues stemming from the existence of /bin/sh in and out of sandbox... |
+1 this (or whatever) as stop gap. and no |
If there is going to be a Are there any known problems with our current This PR doesn't make migration pains go away, but I believe is intended to prevent/limit such pain in the future should we find something lacking in /bin/sh. Regarding static linking bash, two quick thoughts:
Bash config:
"ac_cv_func_dlopen=no"
"ac_cv_func_dlclose=no"
"ac_cv_func_dlsym=no" I'm sorry about the busybox-specific attribute name, I did comment about it in my PR 😇 although I didn't come up with a better one :). |
Don't default `doCheck` to false, and use the default set of phases so the phases list does not need to be overriden in order to add checkPhase or installCheckPhase.
Any news on that? Apparently busybox sh is also not fully posix-compliant: #37082 (comment) |
Busybox can be built to be not fully POSIX compliant. Some Nixpkgs builds of busybox support the `command` builtin, and I think some version of busybox-in-sandbox also uses busybox which supports this builtin (not the initial one, and propagation of the multiple approaches to the fix across branches is complicated.)
|
Thanks for the many comments, all. So the intention of this was to restore the previous behaviour that has been in place for the past few NixOS releases using Nix <= 1.11. That is, the proposals of having per-drv /bin/sh or removing /bin/sh totally from the sandbox are out of scope here.
Actually you are right, I checked again the two PRs that did some patchShebangs changes and they were for Still, I conceptually dislike using the busybox shell here. For one it's Linux-only. So if we ever grow a way to have a non-host /bin/sh in e.g. Darwin or even other Unices we'd be forced to have a different /bin/sh implementation there. And from a purity point of view I prefer a bug-for-bug / unspecified-behaviour compatible /bin/sh so the chance of old Nixpkgs versions from stopping working is as small as possible.
I personally don't see a reason why, given that Bash is open-source and ported to practically everywhere. And again in the current model of /bin/sh, it's also about potentially breaking existing .drvs. I will look into the configure/compile flags more tomorrow, thanks for the tips. |
What is the status of this pull request? |
Closing due to lack of activity, feel free re-open this if needed. |
Instead of playing a cat-and-mouse game of finding out what feature we
managed to miss enabling in our own variant of busybox shell, just
use a minimal version of Bash.
At current point the Bash version is roughly 500 kB bigger.