-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
Revert "Unwrap python scripts when building an environment" #302385
Conversation
With just the first revert gobject-introspection didn't want to build and complained about missing python packages, so I assume we also need to revert the other python changes. As they wheren't done in proper commits, I needed to split the commit a bit. |
b835b44
to
a254c47
Compare
If only two packages are broken it might make more sense to workaround the issue and properly fix it? |
We should revert the changes, make fixes where needed, create a separate test job, reiterate when needed, and then submit again to staging. |
I think the unwrap logic is doing not always true assumptions and is currently hit or miss and can cause random breakages in undefined places. |
This has also broken mailman at runtime, as can be seen from its NixOS test. |
Since no one opposed reverting this with an alternative in the last 4 days, I think we should just merge this to fix wrapped applications. @vcunat can we get this into staging-next to get this fixed faster or should we target staging? |
There is no staging-next currently underway, so this should just be merged into staging before the next staging-next starts. |
It rebuilds darwin stdenv. You don't suggest making a separate staging-next iteration just for this change, right? |
Na, we just merge it into staging and take it with that. Also I've just added the 24.05 milestone, as this is release critical. |
This reverts commit 9611885.
Hi, I am not 100% sure about the xonsh issue, but I think that in the django/pretalx case, the issue is caused by the fact that As quick fix, we can do something like: sed \
-e '/^#!\/nix\/store\//d' \
-e '/^import sys;import site;import functools;sys\.argv\[0\] = /d' \
".$prg-wrapped" >> "$out/bin/$prg" instead of sed -e '1d' -e '3d' ".$prg-wrapped" >> "$out/bin/$prg" This should be more robust to weird wrapper variations by only deleting the lines that start with Of course, a more "proper" solution would probably be to avoid wrapping and unwrapping these scripts in the first place, but I am unsure about how that should be done. @cwp, I think, you mentioned in the original PR that you had an idea about that? |
Please explore properly fixing this in another PR. Getting this fixed is release critical, the new feature is not, and fixing this will cause a lot of rebuilds, hence we should get this definitely into the next staging-next cycle to not delay build failure fixing for the 24.05 release. |
This commit reverts all python changes from 234bb31.
This reverts commit 57427d3.
7d1ec9d
to
822a43d
Compare
Cross-posting from #303057 (comment) to for visibility: Do we need to carry over |
Feel free to test that out. I don't know. |
Understandable. It's a bit unfortunate since I was hoping to get the fixed venv behaviour in 24.05, but oh well. Are there any known/suspected affected packages apart from xonsh and pretalx? It's a bit hard to verify that the proposed fix works with just two examples and (seemingly?) no relevant tests. |
pypy3 but that's generally not that well maintained. I think this could affect all wrapped scripts that are not generated by the build tooling and are just copied to $out/bin (eg https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/pr/pretalx/package.nix#L153) |
The only way to make it work is by recursing into the package set. |
pypy3 on nixos is itself a mess, as it makes some very specific assumptions about argv and python path env var at build time. I am honestly amazed it built at all before... That said: such a change as the here-reverted PR made might warrant revisiting some python applications that made questionable assumptions before. #297628 having broken pypy3 doesn't mean pypy3 had reasonable build logic even before it was blown to pieces. The installation logic is quite involved as it goes through multiple iterations of wrapping and compiling, it doesn't just build all at once. |
I also mentioned Mailman in this thread. |
Agree with this sentiment. Getting it into staging now should make it available before ZHF. |
Going on the recommendation of @FRidh
I'm going to merge this into staging. There's not currently a staging-next job open to expedite this, so the only other option would be to merge to master... or take more time for a more complete solution (which I think would be better tackled in a separate jobset in a separate PR). |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
This reverts commit 9611885 from #297628
Closes #301498
Description of changes
The sed does bad assumptions and breaks python scripts like pretalx-manager #302315 (https://github.com/pretalx/pretalx/blob/dd9f39179a918c9b943fb64da0797fae930ff170/src/manage.py#L2) or xonsh #301449
Tested in #302315 by setting
dontWrapPythonPrograms = true
which unbroke the script. Beforeimport os
was being deleted by sed in line 3.Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.