CMake 4.0 appears to have broken my github CI builds

See these workflow runs:

The most recent builds are me flailing around trying to get cmake to work, but the vcpkg step where the manifest is processed and dependent packages are installed always fails on ubuntu where cmake reports as 4.0, while it succeeds on macOS where cmake reports as 3.31. The Windows build got cancelled because of the ubuntu failure, but it reports version 4.0 as well.

I tried mucking about with apt-get to uninstall cmake 4 and install cmake 3 on ubuntu but apparently I didn’t mutter the correct magik haiku and get it to work.

Any suggestions on how to fix this?

These jobs were all working fine just a few days ago, so I’m pretty sure it’s all down to cmake 4.0 being the default.

e.g.Add missing expectation for added call to Complete · LegalizeAdulthood/scintilla-example@22a5984 · GitHub

Project
CMake workflow

OK, so the root cause appears to be the CMake recipes in my dependencies were setting the minimum version to something < 3.5 and therefore they broke.

Github has reverted the runners to 3.31 to get people’s builds passing again.

It looks like the community was caught off-guard with the breaking change.

2 Likes

Looks like vcpkg is going to work around this by setting the environment variable CMAKE_POLICY_VERSION_MINIMUM to 3.5 before running any dependency builds.

See [scripts/get_cmake_vars][scripts/ports.cmake] fix CMake4 on OSX by strega-nil-re · Pull Request #44712 · microsoft/vcpkg · GitHub