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 B273F1584AD for ; Wed, 16 Apr 2025 00:54:46 +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 97EE9343100 for ; Wed, 16 Apr 2025 00:54:46 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id B5074110494; Wed, 16 Apr 2025 00:54:42 +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 A27B2110494 for ; Wed, 16 Apr 2025 00:54:42 +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 5374C343082 for ; Wed, 16 Apr 2025 00:54:42 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 891D41862 for ; Wed, 16 Apr 2025 00:54:40 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1744764870.f91d60f3961bc3a5f69dd629db9c299d5429f9ce.mgorny@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: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: f91d60f3961bc3a5f69dd629db9c299d5429f9ce X-VCS-Branch: master Date: Wed, 16 Apr 2025 00:54:40 +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: c6e5de50-28fb-48d2-809e-4d4275269bb8 X-Archives-Hash: 95422ba5401914a59e2e9ed6936fdc6b commit: f91d60f3961bc3a5f69dd629db9c299d5429f9ce Author: Michał Górny gentoo org> AuthorDate: Sun Apr 13 14:24:21 2025 +0000 Commit: Michał Górny gentoo org> CommitDate: Wed Apr 16 00:54:30 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f91d60f3 metadata/install-qa-check.d: Check for Python exts for wrong impl Add a QA check for Python extensions that were compiled for the wrong implementation. This is particularly a case when build is not properly isolated and extensions built for earlier Python versions end up being included in the subsequent installs. Bug: https://bugs.gentoo.org/953558 Signed-off-by: Michał Górny gentoo.org> metadata/install-qa-check.d/60python-site | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/metadata/install-qa-check.d/60python-site b/metadata/install-qa-check.d/60python-site index cd58fa3a5937..e4997ae2ebd6 100644 --- a/metadata/install-qa-check.d/60python-site +++ b/metadata/install-qa-check.d/60python-site @@ -1,4 +1,4 @@ -# Copyright 2019-2024 Gentoo Authors +# Copyright 2019-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # QA checks related to site-packages directory: @@ -34,6 +34,7 @@ python_site_check() { local eggs=() local outside_site=() local stray_packages=() + local wrong_ext=() # Avoid running the check if sufficiently new gpep517 is not installed # yet. It's valid to schedule (for merge order) >=gpep517-8 after @@ -104,6 +105,7 @@ python_site_check() { -name 'README.txt' \ ')' -print0 ) + # check for forbidden packages for f in "${forbidden_package_names[@]}"; do [[ -d ${sitedir}/${f} ]] && stray_packages+=( @@ -111,6 +113,22 @@ python_site_check() { ) done + # check for extensions compiled for wrong implementations + local ext_suffix=$( + "${impl}" - <<-EOF + import sysconfig + print(sysconfig.get_config_var("EXT_SUFFIX")) + EOF + ) + while IFS= read -d $'\0' -r f; do + wrong_ext+=( "${f#${ED}}" ) + done < <( + find "${sitedir}" '(' \ + -name "*.pypy*$(get_modname)" -o \ + -name "*.cpython*$(get_modname)" \ + ')' -a '!' -name "*${ext_suffix}" -print0 + ) + einfo "Verifying compiled files for ${impl}" local kind pyc py while IFS=: read -r kind pyc py extra; do @@ -244,6 +262,14 @@ python_site_check() { eqawarn eqatag -v python-site.stdlib "${outside_site[@]}" fi + + if [[ ${wrong_ext[@]} ]]; then + eqawarn + eqawarn "QA Notice: Extensions found compiled for the wrong Python version" + eqawarn "(likely broken build isolation):" + eqawarn + eqatag -v python-site.wrong-ext "${wrong_ext[@]}" + fi } python_site_check