mbedtls-openipc: CMAKE_POLICY_VERSION_MINIMUM=3.5 - #2257
Conversation
Newer host CMake rejects old mbedtls without an explicit policy floor. Co-authored-by: Cursor <cursoragent@cursor.com>
PR Summary by Qodombedtls-openipc: set CMAKE_POLICY_VERSION_MINIMUM=3.5 for newer host CMake
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can group findings by type and pick your Finding display, from Minimal to Full More tips ↗ | Customize Qodo ↗ | Qodo docs ↗ |
widgetii
left a comment
There was a problem hiding this comment.
Thanks for splitting this out of #2256 — the diagnosis is right (mbedtls 2.25.0 really does die on CMake 4.x), but I believe this change is redundant: master already fixes CMake 4.x policy compat globally, for every package at once.
Already fixed in Makefile:7
export CMAKE_POLICY_VERSION_MINIMUM := 3.5Added in 656094d — "Fix build with modern host toolchains (GCC 15, CMake 4.x)" (#1978). That line is present on origin/master and on this PR's own branch.
Three things I checked rather than assumed, with host cmake 4.3.3:
- The failure is real. Configuring
mbedtls-openipc-2.25.0(cmake_minimum_required(VERSION 2.8.12)) bare →Compatibility with CMake < 3.5 has been removed from CMake.Hard error, as you say. - The env var alone is sufficient. Same tree,
CMAKE_POLICY_VERSION_MINIMUM=3.5 cmake -S … -B …with no-D→Build files have been written to. CMake honours it as an environment variable, not only as a-Dcache entry. - The export actually reaches cmake. Buildroot's
pkg-cmake.mkCONFIGURE_CMDSsetsPATHand thePKG_CONFIG_*vars but never scrubs the environment (noenv -i), so the top-level export propagates into every target and host cmake invocation.
So the -D here duplicates a value cmake already has. Harmless, but not load-bearing.
It would also be incomplete on its own
Even without the global export, patching mbedtls alone wouldn't get a board to build. Packages using cmake-package whose sources declare min < 3.5:
| package | cmake_minimum_required |
boards enabling |
|---|---|---|
mbedtls-openipc 2.25.0 |
2.8.12 | 93 ← this PR |
libwebsockets-openipc 4.2.2 |
2.8.12 | 18 ← would fail next |
mini / aura-httpd / usrsctp |
2.8.12 / 2.8 / 3.0 | 0 (dormant) |
Clean: aws-webrtc 3.6.3, libsrtp 3.21, baresip/libre 3.14, fdk-aac 3.5.1, yaml-cli 3.5, ipctool/jsonfilter 3.10. lzo (3.0) and libubox (2.6) are sub-3.5 cmake packages but enabled on no board. libzlib/libyaml/libcurl/libogg/opus have low minimums but build via generic/autotools infra, so cmake never runs on them.
That gap is itself the argument for keeping this global rather than per-package.
Minor
- The test plan checkbox is unticked and no checks have run on the branch yet —
gcc-compat.ymltriggers ongeneral/package/**/*.mk, so it should fire once approved. - Unrelated to this PR, but worth its own issue: mbedtls 2.25.0 is from Dec 2020 and long past EOL, shipping TLS on 93 boards.
If you are hitting a configure failure on current master, could you paste the error and your cmake --version? That would point at something the global export isn't covering, which would be worth fixing properly.
| -DENABLE_PROGRAMS=$(if $(BR2_PACKAGE_MBEDTLS_OPENIPC_PROGRAMS),ON,OFF) \ | ||
| -DENABLE_TESTING=OFF | ||
| -DENABLE_TESTING=OFF \ | ||
| -DCMAKE_POLICY_VERSION_MINIMUM=3.5 |
There was a problem hiding this comment.
This is already covered globally, so this line is a no-op in practice.
Makefile:7 on master has:
export CMAKE_POLICY_VERSION_MINIMUM := 3.5(from 656094d / #1978). CMake honours CMAKE_POLICY_VERSION_MINIMUM as an environment variable as well as a -D cache entry, and Buildroot's pkg-cmake.mk CONFIGURE_CMDS doesn't scrub the environment — so the export already reaches this package's cmake invocation.
Verified with host cmake 4.3.3 against the extracted mbedtls-openipc-2.25.0 tree:
$ cmake -S mbedtls-openipc-2.25.0 -B /tmp/a
CMake Error at CMakeLists.txt:23 (cmake_minimum_required):
Compatibility with CMake < 3.5 has been removed from CMake.
$ CMAKE_POLICY_VERSION_MINIMUM=3.5 cmake -S mbedtls-openipc-2.25.0 -B /tmp/c
-- Configuring done (0.7s)
-- Generating done (0.2s)
-- Build files have been written to: /tmp/cThe env-var form (which master already sets) is enough on its own.
|
This thread is closed as no response has been received |
Summary
-DCMAKE_POLICY_VERSION_MINIMUM=3.5sombedtls-openipcconfigures on newer host CMake.Test plan
make BOARD=gk7102_lite(or any board using mbedtls-openipc) configures mbedtls without CMake policy errorsPart of splitting #2256.
Made with Cursor