Skip to content

[CMake][Python] Bump minimum CMake version to 3.26#23607

Merged
kuhar merged 2 commits intoiree-org:mainfrom
kuhar:cmake-3.26
Mar 3, 2026
Merged

[CMake][Python] Bump minimum CMake version to 3.26#23607
kuhar merged 2 commits intoiree-org:mainfrom
kuhar:cmake-3.26

Conversation

@kuhar
Copy link
Member

@kuhar kuhar commented Mar 1, 2026

CMake 3.26 added FindPython's Development.SABIModule component, which is required for building Stable ABI (abi3). With this minimum version, we can unconditionally request SABIModule upfront in the Python find_package calls, before deciding whether to enable abi3. This is appealing because the SABI module must be found early and cannot be deferred to after the abi3 option is resolved; otherwise we need the user to decide through cmake flags.

CMake 3.26 availability:
pip install cmake: 4.2.3
Homebrew: 4.2.3
Chocolatey (Windows CI): 4.2.3
Ubuntu 24.04 (apt): 3.28.3
Ubuntu 22.04 (apt): 3.22.1 (use pip or Kitware APT repo)
Debian 12 bookworm (apt): 3.25.1 (3.31.6 in backports)

ci-extra: all

CMake 3.26 added FindPython's Development.SABIModule component, which
is required for building Python Stable ABI (abi3) extension modules.
With this minimum version, we can unconditionally request
Development.SABIModule upfront in the Python find_package calls, before
deciding whether to enable abi3. This is necessary because the SABI
module must be found early — the same place we find Development.Module
— and cannot be deferred to after the abi3 option is resolved.

CMake 3.26 availability:

  Source                    │ Version
  ──────────────────────────┼─────────
  pip install cmake         │ 4.2.3
  Homebrew                  │ 4.2.3
  Chocolatey (Windows CI)   │ 4.2.3
  Ubuntu 24.04 (apt)        │ 3.28.3
  Ubuntu 22.04 (apt)        │ 3.22.1 ✗ (use pip or Kitware APT repo)
  Debian 12 bookworm (apt)  │ 3.25.1 ✗ (3.31.6 in backports)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@kuhar kuhar requested a review from Groverkss as a code owner March 1, 2026 22:24
Copy link
Contributor

@amd-eochoalo amd-eochoalo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

CMake 3.31.2 fixed a bug related to SABIModule

FindPython: Ensure SABIModule is found in all cases

I looked a bit further and I think it may be this one which relates to cross compiling on Windows. I don't believe we need this patch, just making a note that this issue exist and was solved in version 3.31.2 .

@kuhar
Copy link
Member Author

kuhar commented Mar 2, 2026

I looked a bit further and I think it may be this one which relates to cross compiling on Windows. I don't believe we need this patch, just making a note that this issue exist and was solved in version 3.31.2 .

Hi, I'm having issues using FindPython on Windows. When searching for both the Development.Module and Development.SABIModule components (without the Interpreter component), FindPython fails. When searching for just one of the two, it works correctly. Please find a minimal example below.

I think we should be fine because we always request the interpreter component:

find_package(Python3 3.10 COMPONENTS Interpreter Development NumPy)

Thanks for a thorough review BTW, I a wasn't aware of these potential teething issues.

@ScottTodd ScottTodd removed their request for review March 2, 2026 19:51
@kuhar
Copy link
Member Author

kuhar commented Mar 3, 2026

We need to update cmake on 'shark10-ci-2'

@kuhar
Copy link
Member Author

kuhar commented Mar 3, 2026

We need to update cmake on 'shark10-ci-2'

Done, as simple as:

sudo apt remove cmake -yqq
pip install --user cmake

@kuhar
Copy link
Member Author

kuhar commented Mar 3, 2026

@kuhar
Copy link
Member Author

kuhar commented Mar 3, 2026

Nobody borough up concerns and the CI passed, merging

@kuhar kuhar merged commit 84f18ff into iree-org:main Mar 3, 2026
122 of 129 checks passed
kuhar added a commit to kuhar/iree that referenced this pull request Mar 3, 2026
I want to make sure we exercise stable ABI builds in our default
development flows, not only when building wheels.

Auto-detect `IREE_ENABLE_PYTHON_STABLE_ABI` after `find_package(Python)`
instead of requiring it to be explicitly set. The cache variable can still
be overridden with `-DIREE_ENABLE_PYTHON_STABLE_ABI=ON/OFF`.

Since CMake 3.26 is now the minimum, `Development.SABIModule` is always
requested unconditionally in `find_package`:
iree-org#23607.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
kuhar added a commit to kuhar/iree that referenced this pull request Mar 3, 2026
I want to make sure we exercise stable ABI builds in our default
development flows, not only when building wheels.

Auto-detect `IREE_ENABLE_PYTHON_STABLE_ABI` after `find_package(Python)`
instead of requiring it to be explicitly set. The cache variable can still
be overridden with `-DIREE_ENABLE_PYTHON_STABLE_ABI=ON/OFF`.

Since CMake 3.26 is now the minimum, `Development.SABIModule` is always
requested unconditionally in `find_package`:
iree-org#23607.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
kuhar added a commit to kuhar/iree that referenced this pull request Mar 3, 2026
I want to make sure we exercise stable ABI builds in our default
development flows, not only when building wheels.

Auto-detect `IREE_ENABLE_PYTHON_STABLE_ABI` after `find_package(Python)`
instead of requiring it to be explicitly set. The cache variable can still
be overridden with `-DIREE_ENABLE_PYTHON_STABLE_ABI=ON/OFF`.

Since CMake 3.26 is now the minimum, `Development.SABIModule` is always
requested unconditionally in `find_package`:
iree-org#23607.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
kuhar added a commit to kuhar/iree that referenced this pull request Mar 3, 2026
I want to make sure we exercise stable ABI builds in our default
development flows, not only when building wheels.

Auto-detect `IREE_ENABLE_PYTHON_STABLE_ABI` after `find_package(Python)`
instead of requiring it to be explicitly set. The cache variable can still
be overridden with `-DIREE_ENABLE_PYTHON_STABLE_ABI=ON/OFF`.

Since CMake 3.26 is now the minimum, `Development.SABIModule` is always
requested unconditionally in `find_package`:
iree-org#23607.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
kuhar added a commit to kuhar/iree that referenced this pull request Mar 3, 2026
I want to make sure we exercise stable ABI builds in our default
development flows, not only when building wheels.

Auto-detect `IREE_ENABLE_PYTHON_STABLE_ABI` after `find_package(Python)`
instead of requiring it to be explicitly set. The cache variable can still
be overridden with `-DIREE_ENABLE_PYTHON_STABLE_ABI=ON/OFF`.

Since CMake 3.26 is now the minimum, `Development.SABIModule` is always
requested unconditionally in `find_package`:
iree-org#23607.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
kuhar added a commit that referenced this pull request Mar 3, 2026
…GIL (#23629)

I want to make sure we exercise stable ABI builds in our default
development flows, not only when building wheels.

Auto-detect `IREE_ENABLE_PYTHON_STABLE_ABI` after `find_package(Python)`
instead of requiring it to be explicitly set. The cache variable can
still be overridden with `-DIREE_ENABLE_PYTHON_STABLE_ABI=ON/OFF`.

Since CMake 3.26 is now the minimum, `Development.SABIModule` is always
requested unconditionally in `find_package`:
#23607.

ci-extra: all

Co-authored-by: Claude Opus 4.6 <[email protected]>
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.

2 participants