Cmake 4.1.2 broke ~100 packages (due to old stuff in upstream CMakeLists.txt)

Cmake compiling tool was recently updated to 4.1.2, which has broken about 100 packages. The newer cmake versions require that the CMakeLists.txt file in upstream sources claims compatibility with at least cmake 3.5. And many old versions of packages still have a specification for older cmake in their sources.

The cmake failures are pretty visible:

CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 has been removed from CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.

  Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.


-- Configuring incomplete, errors occurred!

If you are using or maintaining a package that is now failing for a cmake related reason, pleast participate in bringing things up to shape.

  • In many cases, the correct solution would be to update the package to a newer version, as many/most packages have been recently modifying their sources for this reason.
  • Alternatively, even if the upstream has not yet released a new version, there may already be a compatibility commit that can be backported here as a patch.
  • Third option would be to create a local patch just authoring a local patch changing the 'cmake_minimum_required' in CMakeLists.txt to be 3.10. See example in our commit histories. https://github.com/openwrt/packages/commits/master

First list of failing packages was in https://github.com/openwrt/openwrt/pull/20265#issuecomment-3395192802
The current buildbot failures can be seen at https://downloads.openwrt.org/snapshots/faillogs/ (pick there the architecture relevant to you, or just any of the newest builds)

References:

Issue discussion in packages feed:

cmake bump PR:

5 Likes

Luci asked me for cmake 3.31.0 as a minimum and from what I've seen it's the latest stable one, by the way the new clones come with cmake 3.5 so it's not enough for Luci.

We are already using cmake 4.1.2.
This is only about adjusting packages not to claim too low cmake as their standard.

(24.10 is using cmake 3.30 for compilation, and no LuCI package in 24.10 asks for higher cmake)

That's right, it was in snapshot compiled where it asked me for 3.31

Yeah, and 4.1.2 is built as a tool for OpenWrt compilation in master.
OpenWrt compilation does not use the host cmake.

@hnyman you got there too fast. I took a look at some key packages and you’d already tackled them XD

Yeah, I tried to look for those packages that are dependencies of others. I haven't fixed them all, but a dozen at least.

2 Likes

You’re doing great work as always my man.