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 E3D521584AD for ; Sat, 19 Apr 2025 01:27:58 +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 A1EC8340BE2 for ; Sat, 19 Apr 2025 01:27:58 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 9543B110494; Sat, 19 Apr 2025 01:27:57 +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 89FEF110494 for ; Sat, 19 Apr 2025 01:27:57 +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 3A919340BE2 for ; Sat, 19 Apr 2025 01:27:57 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 688D91758 for ; Sat, 19 Apr 2025 01:27:55 +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: <1745022175.012e58054c1cb7a2f65a3959c8f42f191862585f.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: metadata/install-qa-check.d/ X-VCS-Repository: repo/gentoo X-VCS-Files: metadata/install-qa-check.d/60python-site X-VCS-Directories: metadata/install-qa-check.d/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 012e58054c1cb7a2f65a3959c8f42f191862585f X-VCS-Branch: master Date: Sat, 19 Apr 2025 01:27:55 +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: 820d3eaf-9193-4bf8-89af-581dc90bea26 X-Archives-Hash: d7ed7a8a7e36926704196ac65a9afd22 commit: 012e58054c1cb7a2f65a3959c8f42f191862585f Author: Eli Schwartz gentoo org> AuthorDate: Fri Apr 18 18:35:18 2025 +0000 Commit: Sam James gentoo org> CommitDate: Sat Apr 19 00:22:55 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=012e5805 metadata/install-qa-check.d: fix python checks for non-distutils software The existing check makes an intimidating value proposition: that all software being checked was installed using distutils-r1.eclass, hence moving the check from there as-is to a new home is sufficient. This includes the use of functions specific to the distutils-r1 eclass inheritance chain. In particular, get_modname is part of multilib.eclass, which distutils-r1 inherits, but python-single-r1 does not inherit. This results in the following QA warning: ``` /var/db/repos/gentoo/metadata/install-qa-check.d/60python-site: line 53: get_modname: command not found /var/db/repos/gentoo/metadata/install-qa-check.d/60python-site: line 53: get_modname: command not found /var/db/repos/gentoo/metadata/install-qa-check.d/60python-site: line 53: get_modname: command not found * Verifying compiled files for python3.12 * * QA Notice: Extensions found compiled for the wrong Python version * (likely broken build isolation): * * /usr/lib/python3.12/site-packages/__pycache__/init_calibre.cpython-312.pyc * /usr/lib/python3.12/site-packages/__pycache__/init_calibre.cpython-312.opt-1.pyc * /usr/lib/python3.12/site-packages/__pycache__/init_calibre.cpython-312.opt-2.pyc ``` because we are matching all files matching "*.cpython*" that are also named "*" instead of all files named "*$(get_modname)". Instead of using multilib.eclass, go directly to the preferred canonical source, and query cpython what *it* thinks a module extension should be. This is also more flexible since cpython itself doesn't really guarantee that extension modules are named anything like get_modname, but generally equals -- for backwards compatibility -- the final value from `_PyImport_DynLoadFiletab` / `_imp.extension_suffixes()` (and on Windows, that is .pyd instead of .dll, though admittedly, sysconfig.get_config_vars is pretty empty there; on the other hand, PyPy doesn't recognize unadorned .so because it doesn't need the compatibility, so we see that it's not really a guarantee, and might as well go for the sysconfig variable which is unambiguous where present). Signed-off-by: Eli Schwartz gentoo.org> Signed-off-by: Sam James gentoo.org> metadata/install-qa-check.d/60python-site | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/metadata/install-qa-check.d/60python-site b/metadata/install-qa-check.d/60python-site index 3791fa80ecdd..49d4b3a1a830 100644 --- a/metadata/install-qa-check.d/60python-site +++ b/metadata/install-qa-check.d/60python-site @@ -75,6 +75,13 @@ python_site_check() { local sitedir=( "${pydir}"/site-packages ) [[ -d ${sitedir} ]] || continue + local modname=$( + "${impl}" - <<-EOF + import sysconfig + print(sysconfig.get_config_var("SHLIB_SUFFIX")) + EOF + ) + # check for bad package versions while IFS= read -d $'\0' -r f; do bad_versions+=( "${f#${ED}}" ) @@ -107,7 +114,7 @@ python_site_check() { -name '*.pth' -o \ -name '*.py' -o \ -name '*.pyi' -o \ - -name "*$(get_modname)" -o \ + -name "*${modname}" -o \ -name 'README.txt' \ ')' -print0 ) @@ -130,8 +137,8 @@ python_site_check() { wrong_ext+=( "${f#${ED}}" ) done < <( find "${sitedir}" '(' \ - -name "*.pypy*$(get_modname)" -o \ - -name "*.cpython*$(get_modname)" \ + -name "*.pypy*${modname}" -o \ + -name "*.cpython*${modname}" \ ')' -a '!' -name "*${ext_suffix}" -print0 )