-
Notifications
You must be signed in to change notification settings - Fork 639
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
[CMake] Refactor finding Python #19592
base: main
Are you sure you want to change the base?
Conversation
With CMake 3.18+ (the minimum version set for IREE is 3.21), it should be sufficient to search for `Development.Module` instead of `Development`. We therefore skip searching for the latter as this might be the root for issue with the current macOS builds (see iree-org#19591).
@@ -641,7 +641,6 @@ if(IREE_BUILD_PYTHON_BINDINGS) | |||
# seems to be robust generally. | |||
# See: https://reviews.llvm.org/D118148 | |||
# If building Python packages, we have a hard requirement on 3.9+. | |||
find_package(Python3 3.9 COMPONENTS Interpreter Development NumPy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is truly safe to remove now, then also reword the comments above.
This in particular is explaining why there are two similar calls to find_package
back to back:
# Configuring the Development.Module is flaky in multi-project setups.
# "Bootstrapping" by first looking for the optional Development component
# seems to be robust generally.
# See: https://reviews.llvm.org/D118148
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will update the PR accordingly after our next release.
@@ -641,7 +641,6 @@ if(IREE_BUILD_PYTHON_BINDINGS) | |||
# seems to be robust generally. | |||
# See: https://reviews.llvm.org/D118148 | |||
# If building Python packages, we have a hard requirement on 3.9+. | |||
find_package(Python3 3.9 COMPONENTS Interpreter Development NumPy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We therefore skip searching for the latter as this might be the root for issue with the current macOS builds (see #19591).
I don't see how that could be related? One of the sample builds (https://github.com/iree-org/iree/actions/runs/12514308966/job/34910189766#step:8:77) already configures with explicit Python executables set ('-DPython3_EXECUTABLE=/Users/runner/hostedtoolcache/Python/3.11.9/x64/bin/python3' '-DPYTHON_EXECUTABLE=/Users/runner/hostedtoolcache/Python/3.11.9/x64/bin/python3'
), so any number of find_package
commands should be fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That comes from a discussion on Discord but it turned out this is not related.
With CMake 3.18+ (the minimum version set for IREE is 3.21), it should be sufficient to search for
Development.Module
instead ofDevelopment
.