Skip to content
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

Open
Neumann-A opened this issue Mar 17, 2024 · 6 comments
Open

Problems with static python builds. #26

Neumann-A opened this issue Mar 17, 2024 · 6 comments

Comments

@Neumann-A
Copy link
Member

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.

@m-kuhn
Copy link
Contributor

m-kuhn commented Mar 18, 2024

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.

@Neumann-A
Copy link
Member Author

that would require for the dynamic triplets to become the default one which will probably not happen.

@m-kuhn
Copy link
Contributor

m-kuhn commented Mar 18, 2024

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?
I imagine static support boils down to a user application linking python and various modules, i.e. code that is maintained outside vcpkg (or to a limited scope within the module itself just to make the import tests work). Or we have a dedicated port with features python3-static[numpy,pyqt] but this offers very little flexibility and high maintenance.

@Neumann-A
Copy link
Member Author

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.

@m-kuhn
Copy link
Contributor

m-kuhn commented Mar 24, 2024

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.

@Neumann-A
Copy link
Member Author

I think if microsoft/vcpkg#39449 is merged this can be closed due to the extension feature in python3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants