fix: relink pybind11::embed after partial FindPython#6067
Draft
henryiii wants to merge 4 commits into
Draft
Conversation
Re-run FindPython when an earlier call only found the interpreter so pybind11::embed still picks up Python::Python. Add installed and subdirectory CMake tests that reproduce the interpreter-only ordering and assert the embed target links the Python embed library. Assisted-by: GitHub Copilot CLI:GPT-5.4 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the new embed regression checks on the FindPython path only and use the older Development component on CMake versions before 3.18. This avoids the CMake 3.15 configuration error and the expected old-mode linking mismatch while preserving coverage for the pybind#6063 fix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Collaborator
|
@henryiii regarding this CI failure: CI / 🐍 (ubuntu-latest, pypy3.11, -DCMAKE_CXX_STANDARD=17) / 🧪 (pull_request) See PR #6050 It looks like we now need to apply the |
Collaborator
Author
|
Cibuildwheel is bumping this in a release soon, so we should understand why we don't work on the latest pypy. |
Collaborator
I already created issue #6049 to track the pins. Do you know someone we could assign this to? Someone with a vested interest in PyPy maybe? |
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Human guided, AI assisted PR (using this skill). AI text below. 🤖
Summary
Re-run the new FindPython lookup when pybind11 is loaded after an earlier
find_package(Python COMPONENTS Interpreter)call that did not create the development targets needed bypybind11::embed.This keeps
pybind11::embedlinkingPython::Pythonin the partial-discovery case reported in #6063, while preserving the existingPythonversusPython3handling.Testing
Add CMake embed tests for both subdirectory and installed usage that start with an interpreter-only
find_package(Python)call and then assertpybind11::embedlinksPython::Pythononce the development components are available.Fixes #6063
Assisted-by: GitHub Copilot CLI:GPT-5.4