[pybind11] fix issue where Python environment was restricted to versi…#52695
[pybind11] fix issue where Python environment was restricted to versi…#52695WentsingNee wants to merge 1 commit into
Conversation
|
Hi! I found a problem that find_package(Python3) always found python3.12 installed by vcpkg under manifest mode. I've tried sepecify variables such as |
ricardoofnl
left a comment
There was a problem hiding this comment.
The direction makes sense: the port itself is built with -DPYBIND11_NOPYTHON=ON, so python3 was only ever a consumer convenience. Two things beyond the inline comments:
The arm64_linux CI failure is caused by scripts/ci.feature.baseline.txt line 1103 (pybind11:arm64-linux=cascade). With the hard python3 dependency removed, pybind11[core] and pybind11[core,python3] now pass on arm64-linux, so that baseline entry contradicts reality and has to be removed in this PR (checklist item 4).
| ] | ||
| ], | ||
| "features": { | ||
| "python3": { |
There was a problem hiding this comment.
Without "default-features": ["python3"] this silently changes behavior for every consumer. Of the 8 ports in the registry depending on pybind11, 4 do not declare python3 themselves (bbstrader, numcpp, tensorpipe, libtorch); they currently get vcpkg's Python transitively and would start resolving find_package(Python) to whatever system Python happens to exist. Either add the feature to default-features (users who want their own Python can install pybind11[core]), or update those 4 dependents to depend on python3 directly.
There was a problem hiding this comment.
We should fix those rather than trying to backcompat hack it up here. (If we do something like it at all)
| ], | ||
| "features": { | ||
| "python3": { | ||
| "description": "python3 development environment", |
There was a problem hiding this comment.
Suggestion: something like "Use vcpkg's python3 when consuming pybind11" would describe the effect better; the feature decides which Python find_package(Python) resolves to at configure time, it does not install a development environment for pybind11 itself.
There was a problem hiding this comment.
Thanks for your suggestion. I'm not a native English speaker and not good at writing. Forgive me plz :(
…on 3.12 by dependencies
I don't think that it's a good idea. vcpkg's Python is forzen at version 3.12 and has only development parts without interpreter. With forcing usage of vcpkg's Python, pybind extension of my project can only be built and used under Python3.12 and the users do not have any other methods to overwrite the options and can't decide the Python version they like. |
|
Installation order problems are even worse than forcing python. |
./vcpkg x-add-version --alland committing the result.