Skip to content

Conversation

@ferdymercury
Copy link
Collaborator

This version of CMake was released in March 2022
https://github.com/Kitware/CMake/releases/tag/v3.23.0

This version is required to use FILE_SETs, which could help towards #16327 and #18419.

@guitargeek
Copy link
Contributor

Unfortunately, we still have older CMake versions on the platforms that we still support:

  • ubuntu2204 - cmake version 3.22.1 (end of life April 2027)
  • debian125 - cmake version 3.25.1 (end of life 30 Jun 2028)
  • alma8 - cmake version 3.26.5
  • ubuntu2404 - cmake version 3.28.3
  • macOS 14 - cmake version 3.29.5

On Windows, I don't know.

So I think in practice, that means we can only require CMake 3.23+ when Ubuntu 22.04 is end-of-life in two years 🙁

By the way, so far our strategy has been to just use the same minimum CMake version as LLVM.

@ferdymercury
Copy link
Collaborator Author

ferdymercury commented Sep 22, 2025

@dannf @roehling
Is there any remote plan / chance to bump Ubuntu's 22.04 cmake version from 3.22 to 3.23 ?

@github-actions
Copy link

github-actions bot commented Sep 22, 2025

Test Results

    21 files      21 suites   3d 13h 5m 10s ⏱️
 3 775 tests  3 775 ✅ 0 💤 0 ❌
77 465 runs  77 465 ✅ 0 💤 0 ❌

Results for commit f0bf16d.

♻️ This comment has been updated with latest results.

@ferdymercury
Copy link
Collaborator Author

So I think in practice, that means we can only require CMake 3.23+ when Ubuntu 22.04 is end-of-life in two years

Question: wouldn't it be an option to ask those users to install cmake from snap or from the official cmake PPA in that corner case?

@ferdymercury
Copy link
Collaborator Author

Thanks, but it seems cmake is not found in the Ubu22 image

@bellenot
Copy link
Member

AFAIK, we never force users to take another version of CMake than the one installed by default on the distros. That's what defines the minimal version of CMake. At least it was like this so far. @dpiparo can correct me if I'm wrong

@guitargeek
Copy link
Contributor

Thanks, but it seems cmake is not found in the Ubu22 image

That's just an effect of the incremental build I guess

AFAIK, we never force users to take another version of CMake than the one installed by default on the distros. That's what defines the minimal version of CMake. At least it was like this so far. @dpiparo can correct me if I'm wrong

Yes, that's what we have done so far, but maybe at some point we should discuss if we should keep it like that when Ubuntu doesn't update it's CMake version in 5 years at all. Even RedHat does that.

The only thing that I changed now was to install a newer CMake version on the Ubuntu 22.04 CI image, which is independent of what we require from our users.

@guitargeek guitargeek added the clean build Ask CI to do non-incremental build on PR label Nov 25, 2025
@guitargeek guitargeek closed this Nov 25, 2025
@guitargeek guitargeek reopened this Nov 25, 2025
@guitargeek
Copy link
Contributor

@ferdymercury, you have any idea what is going on with all these failures? Maybe it would help to rebase the commit on master and push again to this PR branch?

@ferdymercury
Copy link
Collaborator Author

Force-pushing didn't help.

It might be the underlying call to cmake_policy(3.23) causes issues.?

I checked in https://man.archlinux.org/man/cmake-policies.7.en#Policies_Introduced_by_CMake_3.23
but didn't see anything obvious.

Not sure if we need to change anything else in our CMakeLists around these lines:

set(policy_new CMP0072 CMP0076 CMP0077 CMP0079
    CMP0156 CMP0179 #deduplicate static libraries when linker supports it
)
set(policy_old CMP0116 CMP0135 CMP0144)

@ferdymercury
Copy link
Collaborator Author

ferdymercury commented Nov 26, 2025

I can reproduce the failure locally on Ubuntu22 (only after clearing full build dir)

The problem is from 3.20 to 3.21:

This works:

cmake_minimum_required(VERSION 3.23 FATAL_ERROR)
cmake_policy(VERSION 3.20)

This or higher fails:

cmake_minimum_required(VERSION 3.23 FATAL_ERROR)
cmake_policy(VERSION 3.21)

So maybe related with https://man.archlinux.org/man/cmake-policies.7.en#CMP0126

This version of CMake was released in March 2022
https://github.com/Kitware/CMake/releases/tag/v3.23.0

This version is required to use FILE_SETs, which could help towards root-project#16327 and root-project#18419.

Since cmake_minimum_required updates the cmake_policy from 3.20 to 3.23, we need to take care of a change that happened from 3.20 to 3.21 that leads to an error
in the CheckCompiler CMake module, so set the proper policy flag to old to avoid that error on some platforms.
@ferdymercury ferdymercury marked this pull request as ready for review November 26, 2025 12:04
@ferdymercury
Copy link
Collaborator Author

Fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clean build Ask CI to do non-incremental build on PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants