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 E189F1580E0 for ; Tue, 03 Jun 2025 17:01:06 +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) server-digest SHA256) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id CBFBC343003 for ; Tue, 03 Jun 2025 17:01:06 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id C916E1102CD; Tue, 03 Jun 2025 17:01:05 +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 BC7581102CD for ; Tue, 03 Jun 2025 17:01:05 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 smtp.gentoo.org (Postfix) with ESMTPS id 6CE7733BEED for ; Tue, 03 Jun 2025 17:01:05 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C49F01397 for ; Tue, 03 Jun 2025 17:01:03 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1748970006.36eee9f1329af293a276cba164e0f6256af2d1d5.asturm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/cmake.eclass X-VCS-Directories: eclass/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: 36eee9f1329af293a276cba164e0f6256af2d1d5 X-VCS-Branch: master Date: Tue, 03 Jun 2025 17:01:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c591366e-7ff1-4043-bfe8-46c62ffe067b X-Archives-Hash: a029dd70bdf1936ea7a911f9e2c99e11 commit: 36eee9f1329af293a276cba164e0f6256af2d1d5 Author: Andreas Sturmlechner gentoo org> AuthorDate: Sat May 17 17:09:31 2025 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Tue Jun 3 17:00:06 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=36eee9f1 cmake.eclass: Add recursive CMakeLists.txt unsupported version detection 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: - Make sed case-insensitive - CMake version range may have double- or triple-dots - 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 gentoo.org> Thanks-to: Ionen Wolkens gentoo.org> Thanks-to: Michał Górny gentoo.org> Bug: https://bugs.gentoo.org/951350 Signed-off-by: Andreas Sturmlechner gentoo.org> eclass/cmake.eclass | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass index c97f74e8a2ed..4c91afa160d9 100644 --- a/eclass/cmake.eclass +++ b/eclass/cmake.eclass @@ -445,6 +445,17 @@ cmake_src_configure() { # Fix xdg collision with sandbox xdg_environment_reset + local file ver cmreq_isold + while read -d '' -r file ; do + ver=$(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=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 @@ -625,6 +636,16 @@ 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, and take it upstream." + if [[ ${EAPI} == 7 ]]; then + eqawarn "QA Notice: EAPI=7 detected; this package is now a prime last-rites target." + fi + fi + pushd "${BUILD_DIR}" > /dev/null || die debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakeargs_local[*]}" echo "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}"