-
Notifications
You must be signed in to change notification settings - Fork 220
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
Build fails with pybind11 2.7 #54
Comments
I think this is due to the CMake files having absolute paths in the pybind11 2.7.0 package. 2.7.1 is due out today with the fix for this. |
I see, and the 2.7.1.dev1 doesn't include this fix? |
You mean some commit from master? Depends on which one. And we don't provide wheels for development versions, and "in-place" building should work (it had absolute paths). How are you getting pybind11? |
I checked out this repo, went into pybind11, and did a pull, which puts me at dcbda8d7ff6e0a207807208ff0364bbb74e02175 for pybind11 |
Then I tried to build this example, no dice |
with |
Ouch, that's not good. It's also weird, since this is an |
Yeah, not good indeed. All my pybind11-based projects are going to start failing if/when I update them to this commit. |
There is more info here: https://cmake.org/cmake/help/latest/policy/CMP0111.html |
And this is the message with pybind11 2.6:
|
At least I understand the change in behavior. Pybind11 2.6 used 3.18 as the max policy, and 2.7.1dev1 uses 3.21. But we aren't making any non-INTERFACE targets, and this is working in lots of other places. Are you doing anything special, perhaps? I'll be trying this out on my Windows machine in a minute. So you are doing:
|
Oops, no it doesn't, this example uses a submodule, getting them mixed up. I see what you are doing, I'll try it. |
I never install pybind11 python package. I don't like polluting (and mutating) the packages installed in my environment. |
I would start from this project, as it very clearly demonstrates the problem. Checkout this project, recursively, update pybind11. Then |
Sorry, I was confused; python_example uses PEP 518 requirements in pyproject.toml, and this one uses a submodule. Eiteh could be used in either example, it was just a choice (as well as assuming that CMake devs might prefer to have it available for building without running the Python parts). |
gh repo clone pybind/cmake_example -- --recurse-submodules
cd cmake_example
git -C pybind11 checkout master
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -v . Works just fine, no warnings present. Replacing the last line with an internal detail that should not be exposed, |
PS: I am using a recent CMake instead of 3.19.0rc2 - that's an RC for something that's now on 3.21.1. It's slightly possible this was a regression in that specific version? But unlikely. Claiming an INTERFACE target needs a library location will break a ton of packages. |
Also, very curious, you are getting a |
Seems like upgrading to cmake 3.21.1 eliminates this particular issue I was seeing. Weird. Running
|
Great! Probably was due to being a release candidate. If you use |
I have a couple of use cases where one can't just use |
I updated the pybind11 module, yielding pybind11 2.7.1.dev1. But the build fails now, with lots of errors of this kind:
They were also present in 2.6, but the build still worked, now it doesn't.
Windows, cmake version 3.19.0-rc2
The text was updated successfully, but these errors were encountered: