From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id EDD471580E0 for ; Mon, 02 Jun 2025 20:45:27 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id AB984343011 for ; Mon, 02 Jun 2025 20:45:27 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 89BA61104A7; Mon, 02 Jun 2025 20:44:41 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id AAAAE1102CD for ; Mon, 02 Jun 2025 20:44:40 +0000 (UTC) Received: from tuxbrain.fritz.box (unknown [IPv6:2a04:9546:191d:b501:676c:7b0c:c3fa:aa8e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: asturm) by smtp.gentoo.org (Postfix) with ESMTPSA id 8CF3A34308A; Mon, 02 Jun 2025 20:44:39 +0000 (UTC) From: Andreas Sturmlechner To: gentoo-dev@lists.gentoo.org, kde@gentoo.org, base-system@gentoo.org Subject: [gentoo-dev] [PATCH v3 1/3] cmake.eclass: Add recursive CMakeLists.txt unsupported version detection Date: Mon, 02 Jun 2025 22:44:34 +0200 Message-ID: <1934159.tdWV9SEqCh@tuxbrain.fritz.box> In-Reply-To: <12677532.O9o76ZdvQC@tuxbrain.fritz.box> References: <12677532.O9o76ZdvQC@tuxbrain.fritz.box> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2236636.irdbgypaU6"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Archives-Salt: 3a4f7d4c-1295-471e-b7e4-8d541fd084c1 X-Archives-Hash: 8035c8eccc300fa97becf12849e0d120 --nextPart2236636.irdbgypaU6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Andreas Sturmlechner Date: Mon, 02 Jun 2025 22:44:34 +0200 Message-ID: <1934159.tdWV9SEqCh@tuxbrain.fritz.box> In-Reply-To: <12677532.O9o76ZdvQC@tuxbrain.fritz.box> References: <12677532.O9o76ZdvQC@tuxbrain.fritz.box> MIME-Version: 1.0 We need to ramp up detection of unsupported CMake build systems with CMake 4. This will detect CMakeLists.txt files setting insufficient cmake_minimum_required VERSION level even in project subdirectories, putting out appropriate eqawarn message about the need to fix ${PN}. That makes us not rely on tinderbox runs w/ unmasked cmake-4 slowly being able to build everything up to leaf packages, and also helps detect insufficient subproject minimums that could otherwise be masked by USE flag choice. Problems fixed along the way: =2D Make sed case-insensitive =2D CMake version range may have double- or triple-dots =2D Exit after first match We don't want more than one version for the subsequent ver_test. Besides, any follow-up cmake_minimum_required call will most likely be conditional for some type of workarounds. Thanks-to: Sam James Thanks-to: Ionen Wolkens Thanks-to: Micha=C5=82 G=C3=B3rny Bug: https://bugs.gentoo.org/951350 Signed-off-by: Andreas Sturmlechner =2D-- eclass/cmake.eclass | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass index c97f74e8a2ed..4c91afa160d9 100644 =2D-- a/eclass/cmake.eclass +++ b/eclass/cmake.eclass @@ -445,6 +445,17 @@ cmake_src_configure() { # Fix xdg collision with sandbox xdg_environment_reset =20 + local file ver cmreq_isold + while read -d '' -r file ; do + ver=3D$(sed -ne "/cmake_minimum_required/I{s/.*\(\.\.\.*\|\s\)\([0-9.]*\= )\([)]\|\s\).*$/\2/p;q}" \ + "${file}" 2>/dev/null \ + ) + + if [[ -n $ver ]] && ver_test $ver -lt "3.5"; then + cmreq_isold=3Dtrue + fi + done < <(find "${CMAKE_USE_DIR}" -type f -iname "CMakeLists.txt" -print0) + # Prepare Gentoo override rules (set valid compiler, append CPPFLAGS etc.) local build_rules=3D${BUILD_DIR}/gentoo_rules.cmake =20 @@ -625,6 +636,16 @@ cmake_src_configure() { cmakeargs+=3D( -C "${CMAKE_EXTRA_CACHE_FILE}" ) fi =20 + if [[ ${cmreq_isold} ]]; then + eqawarn "QA Notice: Compatibility with CMake < 3.5 has been removed from= CMake 4," + eqawarn "${CATEGORY}/${PN} will fail to build w/o a fix." + eqawarn "See also tracker bug #951350; check existing bug or file a new = one for" + eqawarn "this package, and take it upstream." + if [[ ${EAPI} =3D=3D 7 ]]; then + eqawarn "QA Notice: EAPI=3D7 detected; this package is now a prime last= =2Drites target." + fi + fi + pushd "${BUILD_DIR}" > /dev/null || die debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakearg= s_local[*]}" echo "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" =2D-=20 2.49.0 --nextPart2236636.irdbgypaU6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQITBAABCgB9FiEEmaksxp6GvcraXyZQrlkbvHPk3V4FAmg+DTJfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDk5 QTkyQ0M2OUU4NkJEQ0FEQTVGMjY1MEFFNTkxQkJDNzNFNERENUUACgkQrlkbvHPk 3V7zaAv/TYqMgEaxjbJUzzxPir03IDKCInK7+/wzL1tDpYFW/vgpTsSvAMwhiD4w MUzNvf1nU0N94jVWDtkBd8/zre8NImk8K0tQ3hz6E61nCEc5+KQQUqXqfuRTbpHR RjIcOLrz8ftAPnvX5NxjSc5COk/+VTMcyQEPgzatkMOwhBN3DtXQuNUr2n/Gx0hj reM6ZycCeuQhHhSeOTpjRNu9silN3QpUFK4wPxbuVhQjEX4MryYGJi59K2V2y1MK 7fz+tG+W3L3JyrytIN6CgdLAjdc1DVt7yLEJcJo7hrfGjCxBit6Siy2aRKIiNsDR TaIWMTJYVf4zO46VR5iEv2LkRuaIK6XjNAzQBwIEdQRacarsCSTqbKJBlO2QRwo8 6W81D0ZyYDMKNqYnFMbPSaXbu0EQJOu1GXkBo9tp1KpQU1Jlv9QvPUAkBpa6c+tB m7T5szeKIksPBqpkcxjV8yKRcIMqjcQSaebLY5XKab5IxSaTUn9/yiZHP7Mgv73N 8ykmbIp3 =9gEh -----END PGP SIGNATURE----- --nextPart2236636.irdbgypaU6--