From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3FCC015808B for ; Tue, 12 Apr 2022 02:00:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7D97EE08D3; Tue, 12 Apr 2022 02:00:13 +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 pigeon.gentoo.org (Postfix) with ESMTPS id 1EEA7E08D3 for ; Tue, 12 Apr 2022 02:00:13 +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 2050B3419E0 for ; Tue, 12 Apr 2022 02:00:12 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 095F53A7 for ; Tue, 12 Apr 2022 02:00:09 +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: <1649728794.7aa2e188d6732088ae2a2926cc465988e4f117f9.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/60pkgconfig X-VCS-Directories: bin/install-qa-check.d/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 7aa2e188d6732088ae2a2926cc465988e4f117f9 X-VCS-Branch: master Date: Tue, 12 Apr 2022 02:00:09 +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: 07b9b40b-5e2d-4369-8c8c-97a6935f4193 X-Archives-Hash: 274fc9d7db436d7476f9e159236bbd0d commit: 7aa2e188d6732088ae2a2926cc465988e4f117f9 Author: Sam James gentoo org> AuthorDate: Wed Feb 23 01:26:11 2022 +0000 Commit: Sam James gentoo org> CommitDate: Tue Apr 12 01:59:54 2022 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=7aa2e188 install-qa-check.d/60pkgconfig: check for mismatched version We want to try catch cases where we're installing a pkg-config (.pc) file with an obviously incorrect version (here, we're testing for ${PV} != any version in all of the installed .pc files) because: 1. it's bad; 2. it has a large blast radius (breaking consumers). Bug: https://bugs.gentoo.org/833895 Bug: https://bugs.gentoo.org/833887 Bug: https://bugs.gentoo.org/833907 Bug: https://bugs.gentoo.org/833884 Bug: https://bugs.gentoo.org/833888 Signed-off-by: Sam James gentoo.org> bin/install-qa-check.d/60pkgconfig | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/bin/install-qa-check.d/60pkgconfig b/bin/install-qa-check.d/60pkgconfig index cb6660bcb..78c5b5a3c 100644 --- a/bin/install-qa-check.d/60pkgconfig +++ b/bin/install-qa-check.d/60pkgconfig @@ -78,6 +78,32 @@ pkgconfig_check() { eqatag -v pkgconfig.bad-libdir "${bad_libdir[@]}" fi + # Check for mismatched Version field vs ${PV} + # To be safe, let's make sure _all_ installed .pcs have a bad Version + # before warning, as this should catch the general cases we're worried + # about, while avoiding any pathological cases e.g. multiple libraries + # with different versioning within one package. + # Example bugs: bug #833895, bug #833887. + local all_bad=yes + # Record the last bad file matched + local bad_file + for f in "${files[@]}" ; do + if [[ ${PV} == $(pkg-config --modversion "${f}") ]] ; then + all_bad=no + break + fi + + bad_file=f + done + + # Skip result reporting if *_p* because for both _pN and _preN, we + # don't generally expect the versions to be exactly accurate, and + # we want to avoid false positives. + if [[ ${all_bad} == "yes" && ${PV} != *_p* ]] && ! has live ${PROPERTIES} ; then + eqawarn "QA Notice: pkg-config files with mismatched Version found!" + eqawarn "At least ${bad_file}'s Version field does not match ${PV}" + eqawarn "Please check all .pc files installed by this package." + fi } pkgconfig_check