-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
python: propagate makeWrapper arguments #83321
Conversation
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.
I think this is a good idea but want the bash code that's now in the postFixup
somewhere else.
My idea is that the various wrapper scripts write to this make-wrapper-args
file, until we have declarative wrappers. The consumer of that file should maybe be able to choose what parts to take based on an identifier, though I think we can do without. Let's wait for more feedback.
@@ -157,6 +157,19 @@ let | |||
] ++ checkInputs; | |||
|
|||
postFixup = lib.optionalString (!dontWrapPythonPrograms) '' | |||
# Propagate wrapper arguments up to the python |
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.
In mk-python-derivation
a hook needs to do this; the function itself should remain small.
@worldofpeace @jtojnar any common approach that can be taken here? I want declarative wrappers in JSON with structured attributes, but we're not there. Let's discuss this in the main thread.
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.
If the various hook were to export their arguments in a common array, be it makeWrapperArgs
or something else it would be great.
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.
Ok, I moved the shell code to a dedicated hook. I tested again with matplotlib and it seems good. I used a clone of buildPythonPackage
to avoid a mass rebuild, so I haven't tested much else.
Rebased, fixed a conflict and removed the unnecessary escaping. |
I have some changes lined up regarding this (https://github.com/FRidh/nixpkgs/pull/new/makewrapperargshook), but most importantly now, this PR breaks |
d1f8fee
to
5ad4b81
Compare
Python libraries that have runtime dependencies, like Qt and GTK libraries, are currently not working. These are not included in the interpreter wrapper and no mechanism exist to do so automatically. This commit adds a `nix-support/make-wrapper-args` file that stores the makeWrapper arguments of a python derivation (created with buildPythonPackage). The arguments are loaded from python.buildEnv when creating the Python environment and passed to the makeWrapper invocation.
5ad4b81
to
af1c62d
Compare
@FRidh can you push your changes here? I couldn't use |
My apologies for not following up with this. I understand the need for this feature, but I am not happy with the eventual approach. Declarative wrappers is just so much more work, that is definitely not something to wait for. |
No problem, I very well knew this approach wasn't the ultimate solution. I hoped it could be used as a stop gap to quickly fix python packages with Qt dependencies, but it seems there isn't much of an interest: there are only a couple open issues in Nixpkgs. Thank you for starting the work on unifying the wrapper hooks. There was much talk about this situation but nothing material had been proposed. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/low-effort-and-high-impact-tasks/21095/41 |
Motivation for this change
Python libraries that have runtime dependencies, like Qt and GTK
libraries, are currently not working. These are not included in
the interpreter wrapper and no mechanism exist to do so automatically.
This commit adds a
nix-support/make-wrapper-args
file that storesthe makeWrapper arguments of a python derivation (created with
buildPythonPackage). The arguments are loaded from python.buildEnv
when creating the Python environment and passed to the makeWrapper
invocation.
Things done
pythonPackages.matplotlib
with Qtnix path-info -S
before and after)This should fix issues #25351 #80147 #39637