-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Give a more useful error message when running non-nix ELF binaries on NixOS #208187
Comments
The stub should be controlled by a module option, on by default, and easy to disable; otherwise I agree |
I'm in the process of implementing and testing this now. In the process, I also discovered something interesting. bash has changed the error message it shows in this scenario:
Which at least points in roughly the right direction. |
Draft PR is up. I would appreciate feedback on what the message should look like, in particular. |
Can't we try to get this upstream behaviour
in all Linux distros, instead of making something bespoke for NixOS? |
Not really, because that error message is unhelpful for everyone who needs it, and the NixOS solution is different from other distros |
The first problem is that error message is nearly as impenetrable to most as the old one. NixOS is truly different from the entire rest of the linux space in this regard, and just dumping an error message about an aspect of the environment even most accomplished linux users don't know exists isn't really good enough. The second problem is that bash, or whatever is trying to start the executable, can't actually determine what precisely is missing. All it has to go on is an error code from the kernel afaik. The new behavior of bash is as good as their error reporting can actually be, given the interfaces they're working with. |
We should maybe tell the fish people to do better than this, though: $ ./foo
fish: Job 1, './foo' terminated by signal SIGSEGV (Address boundary error) |
Issue description
This error message is just awful.
We all know what the issue is and why this can't be made to work, but we could at least improve the error message by creating a stub ELF interpreter in the default location that just prints out an error message when called.
This would need to interact with modules like
nix-ld
appropriately, but seems doable enough.Thoughts?
The text was updated successfully, but these errors were encountered: