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 740071580EB for ; Fri, 30 May 2025 07:37:56 +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 5FA0B3430F6 for ; Fri, 30 May 2025 07:37:56 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 251A71104B3; Fri, 30 May 2025 07:37:41 +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)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 1C8601104A8 for ; Fri, 30 May 2025 07:37:41 +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)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C874D3430AC for ; Fri, 30 May 2025 07:37:40 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 91AF328F3 for ; Fri, 30 May 2025 07:37:38 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1748590652.c94b419216e44f9ff27f495003e9a0e50fd634b3.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/install-qa-check.d/ X-VCS-Repository: proj/portage X-VCS-Files: bin/install-qa-check.d/90gcc-warnings X-VCS-Directories: bin/install-qa-check.d/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: c94b419216e44f9ff27f495003e9a0e50fd634b3 X-VCS-Branch: master Date: Fri, 30 May 2025 07:37:38 +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: 8d93fba4-01c8-4a81-844e-02658a9cde19 X-Archives-Hash: b28fc12196c697182d90e2640816eb78 commit: c94b419216e44f9ff27f495003e9a0e50fd634b3 Author: Kerin Millar plushkava net> AuthorDate: Thu May 22 23:57:28 2025 +0000 Commit: Sam James gentoo org> CommitDate: Fri May 30 07:37:32 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=c94b4192 90gcc-warnings: convey warnings in a memory-efficient manner Rather than synchronously slurp all of the warnings matched against the contents of PORTAGE_LOG_FILE into a scalar variable before displaying, read the warnings line by line while asynchronously calling eqawarn for each. This may help to save memory in the case that many warnings are to be displayed. Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> bin/install-qa-check.d/90gcc-warnings | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/bin/install-qa-check.d/90gcc-warnings b/bin/install-qa-check.d/90gcc-warnings index bf749f74b6..571d6bd066 100644 --- a/bin/install-qa-check.d/90gcc-warnings +++ b/bin/install-qa-check.d/90gcc-warnings @@ -3,7 +3,7 @@ # TODO: add -Wformat-security gcc_warn_check() { - local abort f reset_xtrace + local i reset_xtrace local -a msgs # Evaluate misc gcc warnings @@ -147,7 +147,14 @@ gcc_warn_check() { #': warning: not enough variable arguments to fit a sentinel' ) - f=$( + while read -r; do + if (( i++ == 0 )); then + __vecho -ne '\n' + eqawarn "QA Notice: Package triggers severe warnings which indicate that it" + eqawarn " may exhibit random runtime failures." + fi + eqawarn "${REPLY}" + done < <( # Coerce C as the character type for performance reasons, per # bug #160234. Coerce C as the collation to guarantee that # ranges are handled appropriately. Also, pass -a to GNU grep @@ -164,26 +171,22 @@ gcc_warn_check() { | grep -E -a "${msgs[*]}" \ | uniq ) - if [[ -n ${f} ]] ; then - abort=1 - __vecho -ne '\n' - eqawarn "QA Notice: Package triggers severe warnings which indicate that it" - eqawarn " may exhibit random runtime failures." - eqawarn "${f}" + if (( i > 0 )); then __vecho -ne '\n' fi eval "${reset_xtrace}" - if (( abort )) ; then - echo "Please do not file a Gentoo bug and instead" \ - "report the above QA issues directly to the upstream" \ - "developers of this software." | fmt -w 70 | \ - while read -r line ; do eqawarn "${line}" ; done - eqawarn "Homepage: ${HOMEPAGE}" - has stricter ${FEATURES} && \ + if (( i > 0 )); then + while read -r; do eqawarn "${REPLY}"; done <<-EOF + Please do not file a Gentoo bug and instead report the above QA issues directly + to the upstream developers of this software. + Homepage: ${HOMEPAGE} + EOF + if has stricter ${FEATURES}; then die "install aborted due to severe warnings shown above" + fi fi }