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 411071580F6 for ; Mon, 19 May 2025 18:52:38 +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 2C13434316B for ; Mon, 19 May 2025 18:52:38 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 90F041104A8; Mon, 19 May 2025 18:51:54 +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 C90451103DD for ; Mon, 19 May 2025 18:51:53 +0000 (UTC) Received: from [192.168.0.1] (c144-156.icpnet.pl [85.221.144.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 99D8934072E; Mon, 19 May 2025 18:51:52 +0000 (UTC) Message-ID: <4c331af88b5ec74a6971fb2942fd7fbcdd5409a2.camel@gentoo.org> Subject: Re: [gentoo-dev] [PATCH v2 1/3] cmake.eclass: Add recursive CMakeLists.txt unsupported version detection From: =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org, kde@gentoo.org, base-system@gentoo.org Date: Mon, 19 May 2025 20:51:49 +0200 In-Reply-To: <6166619.lOV4Wx5bFT@tuxbrain.fritz.box> References: <12677532.O9o76ZdvQC@tuxbrain.fritz.box> <6166619.lOV4Wx5bFT@tuxbrain.fritz.box> Organization: Gentoo Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-xE2qJjkg46G13I762vUx" User-Agent: Evolution 3.54.3 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 X-Archives-Salt: 6008df81-b83b-42bc-a89a-cc043d83002e X-Archives-Hash: 02900afc8a039d5a1812cb4131e6c437 --=-xE2qJjkg46G13I762vUx Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2025-05-19 at 20:44 +0200, Andreas Sturmlechner wrote: > 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}. >=20 > 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. >=20 > Bug: https://bugs.gentoo.org/951350 > Signed-off-by: Andreas Sturmlechner > --- > eclass/cmake.eclass | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) >=20 > 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 > =20 > + local file re=3D"cmake_minimum_required *\( *VERSION( .*\.\.\.| )(([[:d= igit:]]+)\.([[:digit:]]+))" > + local ver cmreq_isold > + while read -d '' -r file ; do > + [[ $(grep -hi "cmake_minimum_required" "$file") =3D~ $re ]] > + ver=3D"${BASH_REMATCH[2]}" So... you're using grep to find a line containing "cmake_minimum_required", then applying another regexp to that line?=20 This really looks like a case for a single sed call. > + echo $file $ver Is this leftover debug? > + > + if [[ -n $ver ]] && ver_test $ver -lt "3.5"; then > + cmreq_isold=3Dtrue > + fi > + done < <(find "${CMAKE_USE_DIR}" -type f -iname "CMakeLists.txt" -print= 0) || die > + > # Prepare Gentoo override rules (set valid compiler, append CPPFLAGS et= c.) > local build_rules=3D${BUILD_DIR}/gentoo_rules.cmake > =20 > @@ -543,6 +555,13 @@ 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 fr= om 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 ne= w one for" > + eqawarn "this package." > + fi > + > pushd "${BUILD_DIR}" > /dev/null || die > debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakea= rgs_local[*]}" > echo "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" --=20 Best regards, Micha=C5=82 G=C3=B3rny --=-xE2qJjkg46G13I762vUx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQFGBAABCgAwFiEEx2qEUJQJjSjMiybFY5ra4jKeJA4FAmgrfcUSHG1nb3JueUBn ZW50b28ub3JnAAoJEGOa2uIyniQODa4H+wQUhCviLnHWtYbQKCYOEVIiV2B3YmwU U+QyKewRVnS05cJnv/GdRcCWtB2v1eUk2xBpiRggWUx4OSIjG/O+bGiewgFC2b8D zqlR8rzbaVRRByRWf714ZAqNENW+tKOyeGBDijktHkU0U0WidgemgHFnuYxP4HO9 wvCb3XmVZdoddL+fEy+Xka4x065cNMCK/gc/LiEvGHQx0WkT6ddvXHrHSMoegizt O10G/wqYi33AGgTq8GsRc5aQS93Vy45KOxz1LqppioHDuBtIlMVLzuvhFzN0A2fD bEzMAqTjpYc3JfuQmHCl9IAdDRfGN/7viSjt4/mRswoD6m8VXAw7QVU= =o/Va -----END PGP SIGNATURE----- --=-xE2qJjkg46G13I762vUx--