Discussion:
Proposed MBF: CMake 4.0 compatibility
Add Reply
Timo Röhling
2025-04-23 19:50:01 UTC
Reply
Permalink
Hi,

CMake has deprecated backwards compatibility for versions older than 3.5
since July 2023, and the CMake 4.0 release finally drops support,
causing all packages still relying (or declaring to rely) on older
behavior to FTBFS.

Trixie will ship with CMake 3.31, so this issue is only relevant for the
Forky release cycle. However, I plan to file forky tagged bugs early, so
that maintainers are aware and can forward the bug to upstream as
needed.

I have rebuilt the ~3000 packages which build-depend on CMake with
debusine (thanks to Freexian for this helpful service and Stefano Rivera
for his debusine-rebuilds tool) and discovered 936 affected packages;
the dd-list is attached.

If you want to fix your package, there are two options:

1) Add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to dh_auto_configure, which
will override any CMakeLists.txt settings. This is the minimally
invasive procedure, no patching required. See also [1].

2) Patch CMakeLists.txt and use the "..." range syntax to add a
supported maximum version, e.g., cmake_minimum_required(VERSION
3.2...3.31). This is the recommended way to submit bugfixes to upstream.

In both cases, you should verify that CMake still behaves how the
package expects it. If your package builds reproducibly, you can easily
check that the binary packages remain unchanged. Alternatively, you can
look for policy warnings in the current build logs, which will point you
towards potential problems.


Cheers
Timo

[1]
https://cmake.org/cmake/help/latest/variable/CMAKE_POLICY_VERSION_MINIMUM.html
--
⢀⣎⠟⠻⢶⣊⠀ ╭────────────────────────────────────────────────────╮
⣟⠁⢠⠒⠀⣿⡁ │ Timo Röhling │
⢿⡄⠘⠷⠚⠋⠀ │ 9B03 EBB9 8300 DF97 C2B1 23BF CC8C 6BDD 1403 F4CA │
⠈⠳⣄⠀⠀⠀⠀ ╰────────────────────────────────────────────────────╯
Andreas Henriksson
2025-04-24 07:50:01 UTC
Reply
Permalink
Hello Timo,
Post by Timo Röhling
Hi,
CMake has deprecated backwards compatibility for versions older than 3.5
since July 2023, and the CMake 4.0 release finally drops support,
[...]
Post by Timo Röhling
mfgtools (U)
[...]

Already fixed in upstream git and should be part of next upstream release:
https://github.com/nxp-imx/mfgtools/commit/311ee9b3cca0275fbb5eb5228c56edbb518afd67

FWIW My general feedback is that people will be distracted by a MBF
right before a freeze (and will often miss forky tags and notices).
Also if you wait just 'til after the freeze (start of forky) then likely
a bunch of upstream will already have caught up and some people (like
myself hopefully) will likely already have uploaded the latest upstream
release and thus your MBF will be a lot fewer.
But I also understand that you want to give the long tail as much
heads up as possible. Maintainers can if bugs are filed set forwarded
and fixed-upstream tag which can help if you want to work on patches
for the remaining ones and upstream them. It's a judgement call and I
guess as I see it, it depends alot on how much effort you intend to
invest into the bugs after they have been filed...

Regards,
Andreas Henriksson

Loading...