-
Notifications
You must be signed in to change notification settings - Fork 1
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
Problems with static python builds. #26
Comments
My immediate plan of action involves pushing microsoft/vcpkg#36556 to improve support for dynamic mac builds and ignoring the problems that come with static python builds. |
that would require for the dynamic triplets to become the default one which will probably not happen. |
I might be accepting that for my immediate use cases. But back to your question, is host python with [numpy] support a requirement? |
If a port wants to run a python script using numpy for whatever reason yes it is a requirement. |
In this case this port will need to link (host) python itself or have a helper port that does it instead, I don't think there's a way around this using static builds. |
I think if microsoft/vcpkg#39449 is merged this can be closed due to the |
@Neumann-A does microsoft/vcpkg#39449 work for every scenario, if we have common dependencies in the main app and a python extension, which is linked (statically) into both binaries, won't we run into ODR violations? |
I don't fully understand the question, so let me ask another question: How do you think this violation could occurs?
Case 1) Everything dynamic -> no problem |
What I'm thinking is: qt being linked statically to the main app (executable, might not be python.exe but another application initializing a python interpreter) and a dynamically loaded shared lib as part of a python module (e.g. pyqt) also linking qt statically. |
That is a different kind of error, however you shouldn't see that in static linkage since the dynamic loader shouldn't be involved (and make sure normal symbol visibility is hidden)? |
I didn't try, so I cannot tell
Yes, pyqt is used to write plugins for the main app which interact with Qt objects / widgets from the main app
I did not try this yet, as I was always under the impression going with all dynamic will be less risky (despite not being an officially supported vcpkg triplet) |
I think going dynamic is the only correct approach here. Has the error gone away after fixing the symlinks? |
Thanks for confirming. Yes, it has gone away. Macdeployqt is patched in vcpkg, upstream merge pending. |
There is a problem with static python builds that cannot import extensions since the extension has not been statically linked into the python executable. However you could build an application which has more extensions and links more then the static python library which is apparent from https://www.kitware.com/static-python-and-numpy-with-paraview/
The question is how to achieve something similar for vcpkg? Basically using host python + extensions might not be enough since if the host triplet is a static python build the extensions become unusable and the code cannot be run from the host.
The text was updated successfully, but these errors were encountered: