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 2C8171580F6 for ; Mon, 19 May 2025 18:45:20 +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 17960343140 for ; Mon, 19 May 2025 18:45:20 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 9E0C81104A8; Mon, 19 May 2025 18:44:36 +0000 (UTC) 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) server-digest SHA256) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id D30B21103DD for ; Mon, 19 May 2025 18:44:35 +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 D8DE43430B0; Mon, 19 May 2025 18:44:34 +0000 (UTC) From: Andreas Sturmlechner To: gentoo-dev@lists.gentoo.org, kde@gentoo.org, base-system@gentoo.org Subject: [gentoo-dev] [PATCH v2 1/3] cmake.eclass: Add recursive CMakeLists.txt unsupported version detection Date: Mon, 19 May 2025 20:44:29 +0200 Message-ID: <6166619.lOV4Wx5bFT@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="nextPart5020495.31r3eYUQgx"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Archives-Salt: 75ee3ebd-9760-4014-bd42-dacd5866b182 X-Archives-Hash: 10be1255e8012b3010c32f369e51a04e --nextPart5020495.31r3eYUQgx Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Andreas Sturmlechner Date: Mon, 19 May 2025 20:44:29 +0200 Message-ID: <6166619.lOV4Wx5bFT@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. Bug: https://bugs.gentoo.org/951350 Signed-off-by: Andreas Sturmlechner --- eclass/cmake.eclass | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass index 083b566d26..ca6c03f335 100644 --- a/eclass/cmake.eclass +++ b/eclass/cmake.eclass @@ -362,6 +362,18 @@ cmake_src_configure() { # Fix xdg collision with sandbox xdg_environment_reset + local file re="cmake_minimum_required *\( *VERSION( .*\.\.\.| )(([[:digit:]]+)\.([[:digit:]]+))" + local ver cmreq_isold + while read -d '' -r file ; do + [[ $(grep -hi "cmake_minimum_required" "$file") =~ $re ]] + ver="${BASH_REMATCH[2]}" + echo $file $ver + + if [[ -n $ver ]] && ver_test $ver -lt "3.5"; then + cmreq_isold=true + 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=${BUILD_DIR}/gentoo_rules.cmake @@ -543,6 +555,13 @@ cmake_src_configure() { cmakeargs+=( -C "${CMAKE_EXTRA_CACHE_FILE}" ) fi + 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." + fi + pushd "${BUILD_DIR}" > /dev/null || die debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakeargs_local[*]}" echo "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" -- 2.49.0 --nextPart5020495.31r3eYUQgx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQITBAABCgB9FiEEmaksxp6GvcraXyZQrlkbvHPk3V4FAmgrfA1fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDk5 QTkyQ0M2OUU4NkJEQ0FEQTVGMjY1MEFFNTkxQkJDNzNFNERENUUACgkQrlkbvHPk 3V5nhQv9GNj47xfR1zAK1SjEp4lxFFbpyt1iL7TgxAveIL7pD/JBpV9Ly53W0LNw gqHLOVqrJEFJKFiJodnsh7U4TH0huUy+bjGzlyY1O8IBYOd83Cx4sm/HZrETyKic GzNn9zaXAd9vDiiGq/5M2VKhpJ7MyTGuhqFP1/OtGFheZTjrXan/F8PgA0bOuCSS K2VK7aqwNrGnBd/B3ldcab+HPXVqiGTKSUREZc/OQx9OMGHjou+rAmfOTH5og/8M lmtpuQM5axdCfaVOeq47RQKeunvrdqoUdDukPDnV5McVxeAihosrbWEEid814BTm pA5hk/vBwwT7ukbKmKZMaYEJYZuENKcc7HuACNez6uqN11kgrJG2gfPwAyw4NjnX vOoeLzx1oGy7zs18iH3TLQXhYe6rohjIgcBUPCvZFnKOY9Hig4smzCdRYgt/b2Dj kDAWAdGyAQWnMj4GoBYK/3B7vyyH25H4ZhajQiWNEHnkpsYDQAgx4+tlhzsHtdej bSDtLw/y =0/3m -----END PGP SIGNATURE----- --nextPart5020495.31r3eYUQgx--