Repository navigation
Conversation
|
— codex on behalf of Ralf — Keep the free-threaded workaround active on reconfigure. In a vendored Generated by Codex. Ralf has yet to review these findings. |
fb1487c to
a376a13
Compare
|
🤖 AI text below 🤖 Confirmed and fixed in a376a13. The branch now contains the commit from #6267 (98be134), and the free-threaded predicate is part of the I did two configures in the same build directory with a vendored
With a376a13, an explicit No two-configure test is added to the test suite; |
…MP0190 Without CMP0190 NEW, FindPython finds the interpreter when cross-compiling but cannot query its ABI flags. It then drops the free-threaded ABI requested with Python_FIND_ABI and rejects the python3.Xt headers. The default is part of the PYBIND11_USE_CROSSCOMPILING option default, so the cache keeps it on a second configure. Assisted-by: ClaudeCode:claude-opus-5-5 Assisted-by: ClaudeCode:claude-fable-5-2
a376a13 to
476ce78
Compare
🤖 AI text below 🤖
Description
When cross-compiling with CMP0190 OLD (for example
cmake_minimum_required(VERSION 3.15...4.0)), pybind11 asks FindPython forInterpreter. If the interpreter can run on the build machine (conda's cross-python), FindPython finds it. It does not query the interpreter in a cross build, so it sets the ABI flags to<none>. This overrides a free-threadedPython_FIND_ABI(ANY;ANY;ANY;ON, which scikit-build-core sets). FindPython then searches only for names withouttand rejectsinclude/python3.Xt, so it fails withCould NOT find Python (missing: Development.Module).This broke the conda-forge linux-ppc64le cp314t/cp315t builds of iminuit (conda-forge/iminuit-feedstock#121). The cause is a FindPython bug. This PR adds a workaround: when cross-compiling with no emulator,
PYBIND11_USE_CROSSCOMPILINGnow also defaults to ON ifPython_FIND_ABIrequests the free-threaded ABI. Before, it did this only with CMP0190 NEW. An explicit value is still kept. Builds with the GIL are not changed.A broader option is to default to ON for all cross builds with no emulator, whatever the policy. That would also cover free-threaded builds that don't set
Python_FIND_ABI(they fail anyway, because of FindPython's default ABI), but it changes the behavior for current cross builds with the GIL.I checked this with CMake 4.5, the conda-forge
linux-ppc64lepython-3.14.10 cp314tpackage, and a local 3.14t interpreter that acts as the cross-python wrapper. Before this change, Development.Module was not found. After it, Python is found.Suggested changelog entry:
Python_FIND_ABIrequests the free-threaded ABI (as scikit-build-core does).