Open miyanyan opened 12 months ago
The patch should be reverted BUT a proper instructions about how to use pybind11 should be provided instead.
The patch should be reverted
If this patch is reverted, issues like https://github.com/microsoft/vcpkg/issues/30642 and https://github.com/microsoft/vcpkg/issues/31311 will appear.
BUT a proper instructions about how to use pybind11 should be provided instead.
Could you elaborate on your thoughts about this?
@Neumann-A Asking for your help.
I think you can ask @BillyONeal since he will nuke system linkage of python in the future any way.
Could you elaborate on your thoughts about this?
Some users want pybind11 and system python (1), some users want pybind11 and python from vcpkg (2). Both are valid, but after #31318 (1) is broken and (2) works without additional interventions. The patch should be reverted and documentation about how to make (2) work should be added.
Pybind11 and linking system python is not an option in vcpkg without an overlay. So breaking it is ok and even intended.
If you want the default vcpkg experience, everything building things that load into python need to use the python port.
If you want the system python to be used instead, you need to install python development headers and libraries to the system, and overlay the python3 port with an empty one.
There is no desire to create frankenstein installed trees where some binaries therein expect system python and some expect vcpkg's built copy of python.
The only reason the system python should be being used is for running build systems or other scripts that are just "running .py files"
after this pr https://github.com/microsoft/vcpkg/pull/32194, vcpkg install pybind11
will not install python first, so when I write find_package(Python3)
, if no python installed by vcpkg, it will find system python, otherwise it will use vcpkg's python. This's an option for me, it's great.
when using pybind11:
pip install xxx
, the pure python env is enough.after this pr #32194,
vcpkg install pybind11
will not install python first, so when I writefind_package(Python3)
, if no python installed by vcpkg, it will find system python, otherwise it will use vcpkg's python. This's an option for me, it's great.
I must have not understood this when I merged it. Installs must not be path dependent. That is,
vcpkg install pybind11
vcpkg install python3
must produce the same results as
vcpkg install python3
vcpkg install pybind11
or features like binary caching that depend on ports providing this behavior will break.
If pybind11 needs to find a python to load things into, it needs to use the vcpkg one, not the system one, always. If you want to force the system one, overlay python3
with an empty port.
if use pybind11 to write python module, like create xxx.pyd, it's ok to use vcpkg or system python, because I dont't need to pip install xxx, the pure python env is enough.
It is unlikely that the system python and vcpkg's python are ABI compatible.
if use pybind11 to call python in c++, I have to install some python packages using pip most of the time, so since the packages are already installed in system python, using vcpkg's python will need more work.
Then that more work is necessary. Again, if you want to use the system python, you can overlay python3 with an empty port, and the universe becomes consistent again.
This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.
Environment
To Reproduce Steps to reproduce the behavior:
find_package(Python3 EXACT 3.8 COMPONENTS Interpreter Development REQUIRED)
Expected behavior hi, I wanna use pybind11 in this way:
find_package(Python3)
to find the system python3.libpython38.dll
, I don't want to linkpython38_d.dll
insteadAdditional context I found in this pr https://github.com/microsoft/vcpkg/pull/31318
Py_DEBUG
will be set in debug mode, but not all the system python lib has debug version