-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
core packages: long interpreter lines with long nix store path prefix #10854
Comments
I'm guessing this has to do with long ELF interpreter paths. Notice that both of the "bad interpreter paths" are cut off at 76 characters: Has anyone seen issues with long ELF interpreter paths before? Paging a couple of recent PatchELF contributors: @edolstra, @darealshinji. Meanwhile, a question and a couple of things you might be able to try:
|
I don't think it's about ELF but about shebang lengths (note the error is in gcc wrapper). When we patchShebang to absolute As suggested, PRoot would have additional advantage of being able to get binaries from Hydra. |
Thanks @vcunat. What is the purpose of using env in the shebang paths here? I thought it was typically used when the absolute path wasn't known, e.g. |
And, more to the point, in theory could |
Maybe env isn't even used in these particular cases, but it will certainly be needed in some, as discussed in #6227, But in this case the store prefix is so long that even single occurrence is a problem - 113 characters up to the dash after hash, and then you need package name with version and the inner path... Note that the limit of 127 is in the kernel, so we can't affect that on non-NixOS. I don't see what can be done except for shortening the path somehow (e.g. via proot). |
After some experimentation I got the hello to work by offering
as the
However, I suspect that it is not the only issue. For example, the
seemed to be not working, if the Nix installation path was
So, may be there is a mixture of issues at play. |
Yeah, well, I think only a rather small fraction of users have non-standard nix store prefix (I'm not counting prooted users), so there might be multiple bugs undiscovered. |
I'm not sure, if it is relevant here, but if You use Python somewhere in the guts of the Nix, then there's the issue of Python string lengths. In theory there is practically no limit, but in practice the Mercurial had a limit that if the file path was significantly longer than about 1024 characters, then it did not work any more and it is possible to find other, similar, observations about Python from the wild-wild-web. |
No, we just use C++ and perl for some relatively simple wrappers (and slowly getting rid of perl NixOS/nix#341). @martinvahi: note the related report I linked now. |
Wasn't this fixed yet? |
No, I don't think any step has been taken towards this. And I can't see what could be done about it, except for work-arounds to use shorter path for nix store. |
If the problem is really that the paths are too long and you don't know how to fix it yet, does it help if you're using symbolic links as shortcuts? I.e. |
nix is not really made for having the store deeper than in As such I’m gonna close this issue now, feel free to reopen if some other solution is found. |
A citation from the @Profpatsch answer:
May be one workaround to the default 127 shebang length limit
the
and the shebangs at the Nix scripts would look like
The
The It's just a wild, untested, idea. |
The details are accidentally at the Nix bugtrack, but I closed the original flaw report due to suggestions that it does not belong to the list of Nix package manager flaws.
The text was updated successfully, but these errors were encountered: