Skip to content
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

fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run #4856

Merged
merged 4 commits into from
Jan 8, 2024

Conversation

ilya-lavrenov
Copy link
Contributor

@ilya-lavrenov ilya-lavrenov commented Sep 20, 2023

Description

Closes #4854

Suggested changelog entry:

Skip empty ``PYBIND11_PYTHON_EXECUTABLE_LAST`` for the first cmake run

@henryiii
Copy link
Collaborator

A value won’t ever be equal to an empty string. Though this avoids the undefined variable usage warning if you enable that, is that why? Didn’t think we were very close to passing that.

@ilya-lavrenov
Copy link
Contributor Author

A value won’t ever be equal to an empty string. Though this avoids the undefined variable usage warning if you enable that, is that why? Didn’t think we were very close to passing that.

The value of PYBIND11_PYTHON_EXECUTABLE_LAST is empty on first cmake run

@henryiii
Copy link
Collaborator

henryiii commented Oct 3, 2023

Ah, I see, this is the reverse of what I was thinking. I'm pretty sure we are using the empty value on first run to fill this if needed. If you aren't manually setting PYTHON_MODULE_EXTENSION, it needs to be set, right?

@henryiii
Copy link
Collaborator

henryiii commented Oct 3, 2023

Ahh, no, the block is shorter than I thought. Hmm, this might (mostly) work. In your case, if you did have the interpreter change, then you'd still lose the manually set value.

@henryiii
Copy link
Collaborator

henryiii commented Oct 3, 2023

The only issue here, then, is if PYBIND11_PYTHON_EXECUTABLE_LAST is unset, it will never be set.

@ilya-lavrenov
Copy link
Contributor Author

Yes, I agree with current state. Thanks for noticing it

@ilya-lavrenov
Copy link
Contributor Author

ping

@henryiii
Copy link
Collaborator

I think this is fine to go in, haven't been able to get anyone else to review it.

Thanks!

@henryiii
Copy link
Collaborator

(I'll merge after CMake 3.27.8 gets uploaded and un-breaks our CI. There's a narrow window (<1 hour) between a release and the binaries being uploaded that we get failing CI runs in).

@ilya-lavrenov
Copy link
Contributor Author

Could you please merge the PR?

@henryiii henryiii merged commit aec6cc5 into pybind:master Jan 8, 2024
85 checks passed
@henryiii henryiii added needs changelog Possibly needs a changelog entry and removed needs changelog Possibly needs a changelog entry labels Mar 27, 2024
@ilya-lavrenov ilya-lavrenov deleted the fix-issue-4854 branch April 19, 2024 15:37
github-merge-queue bot pushed a commit to openvinotoolkit/openvino that referenced this pull request Apr 22, 2024
### Details:
 - Removed WA for cross-compilation case
- It's possible because fix pybind/pybind11#4856
is included to latest released version
ilya-lavrenov added a commit to openvinotoolkit/openvino that referenced this pull request Apr 22, 2024
### Details:
 - Removed WA for cross-compilation case
- It's possible because fix pybind/pybind11#4856
is included to latest released version
alvoron pushed a commit to alvoron/openvino that referenced this pull request Apr 29, 2024
### Details:
 - Removed WA for cross-compilation case
- It's possible because fix pybind/pybind11#4856
is included to latest released version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: Cannot overwrite PYTHON_MODULE_EXTENSION when FindPython3.cmake is used
2 participants