commit:     d63f5075210bf225efcf59d42fab19fde4b61193
Author:     Matoro Mahri <matoro_gentoo <AT> matoro <DOT> tk>
AuthorDate: Thu Sep  5 00:46:35 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Oct  5 08:28:24 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d63f5075

dev-lang/python: skip tests when relevant kernel options missing

Signed-off-by: Matoro Mahri <matoro_gentoo <AT> matoro.tk>
Closes: https://github.com/gentoo/gentoo/pull/38417
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-lang/python/python-3.13.0_rc3.ebuild | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/dev-lang/python/python-3.13.0_rc3.ebuild 
b/dev-lang/python/python-3.13.0_rc3.ebuild
index 1d2b8874ca92..c50bf1ede300 100644
--- a/dev-lang/python/python-3.13.0_rc3.ebuild
+++ b/dev-lang/python/python-3.13.0_rc3.ebuild
@@ -7,8 +7,9 @@ LLVM_COMPAT=( 18 )
 LLVM_OPTIONAL=1
 WANT_LIBTOOL="none"
 
-inherit autotools check-reqs flag-o-matic llvm-r1 multiprocessing
-inherit pax-utils python-utils-r1 toolchain-funcs verify-sig
+inherit autotools check-reqs flag-o-matic linux-info llvm-r1
+inherit multiprocessing pax-utils python-utils-r1 toolchain-funcs
+inherit verify-sig
 
 MY_PV=${PV/_}
 MY_P="Python-${MY_PV%_p*}"
@@ -114,6 +115,11 @@ QA_PKGCONFIG_VERSION=${PYVER}
 # false positives -- functions specific to *BSD
 QA_CONFIG_IMPL_DECL_SKIP=( chflags lchflags )
 
+declare -rA PYTHON_KERNEL_CHECKS=(
+       ["CROSS_MEMORY_ATTACH"]="test_external_inspection" #bug 938589
+       ["DNOTIFY"]="test_fcntl" # bug 938662
+)
+
 pkg_pretend() {
        use test && check-reqs_pkg_pretend
 
@@ -129,6 +135,14 @@ pkg_pretend() {
 pkg_setup() {
        use jit && llvm-r1_pkg_setup
        use test && check-reqs_pkg_setup
+       if [[ "${MERGE_TYPE}" != binary ]] && { use test || use pgo; }
+       then
+               local CONFIG_CHECK
+               for f in "${!PYTHON_KERNEL_CHECKS[@]}"; do
+                       CONFIG_CHECK+="~${f} "
+               done
+               linux-info_pkg_setup
+       fi
 }
 
 src_unpack() {
@@ -297,6 +311,14 @@ src_configure() {
                        ;;
        esac
 
+       # Kernel-config specific skips
+       for option in "${!PYTHON_KERNEL_CHECKS[@]}"; do
+               if ! linux_config_exists || ! linux_chkconfig_present 
"${option}"
+               then
+                       COMMON_TEST_SKIPS+=( -x 
"${PYTHON_KERNEL_CHECKS[${option}]}" )
+               fi
+       done
+
        # musl-specific skips
        use elibc_musl && COMMON_TEST_SKIPS+=(
                # various musl locale deficiencies

Reply via email to