-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
WIP: wrapPython: only inject Python code, don't wrap with makeWrapper #58174
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
Conversation
This is essentially a continuation of #17749. |
About PYTHONNOUSERSITE, #51641. I suggest making |
@@ -29,14 +29,14 @@ makeSetupHook { | |||
''; | |||
|
|||
# This preamble does two things: | |||
# * Sets argv[0] to the original application's name; otherwise it would be .foo-wrapped. | |||
# Python doesn't support `exec -a`. | |||
# * Adds all required binary directories to PATH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Append, prepend ?
Thank you for your contributions.
|
Still important to me. What's the status of this PR? |
Alas, I haven't done any further work on this, and at this point I probably won't, so I'll go ahead and close this. But I would love to see something like this merged - I still have code which would benefit from this. |
What's still left to be done on what you had written? |
IIRC I thought the change was essentially good in its current state (although of course it would be changed some in review). So if someone wanted to resurrect the change, I think it would just be a matter of rebasing, updating for @FRidh 's comments and opening a new PR. Also you probably would want to target the change at staging, and do some testing of packages that are affected by this which are mentioned in the linked issues (like qutebrowser). |
Ok thanks! Didn't quite understand what you said about merging |
I'm not sure - there might not be any other argument passed to the shebang in current Nixpkgs. |
Motivation for this change
This makes Python executables (such as meson) which look at sys.argv[0] to find the currently executing script, work fine without special-casing anything.
See #58130
Still to resolve:
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)