From patchwork Tue Oct 22 05:13:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 50998 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D099BD3C935 for ; Tue, 22 Oct 2024 05:13:22 +0000 (UTC) Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by mx.groups.io with SMTP id smtpd.web11.11602.1729573994330513978 for ; Mon, 21 Oct 2024 22:13:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ctpuWTfl; spf=pass (domain: gmail.com, ip: 209.85.210.178, mailfrom: raj.khem@gmail.com) Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-71e5a62031aso3605045b3a.1 for ; Mon, 21 Oct 2024 22:13:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729573993; x=1730178793; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=pKygS+w9C2a0sZq6nT1NqQc6jJlF59Nx0oHfVskn5ko=; b=ctpuWTfl9LpNH2X7L0qLYH6OzVRl3ellONRNKnc5HUS+de6pCWCeCaSXY/lufOSTof EsRYRk0MtlfNYppOWLwjPiWjBSTtlHwUtYxLZRTwxRnUdegCP2t2WDbeuBfnl1BneZbt kcK3sNs1iz8m2Xt8ZJnJ5aRAsYEWdkt0kBoYWzhggEG9dQfvr6se52UgSqRrDF40vdRL 1ogMYkIRNaENx/5F3zxbxvlvaSOkxY0Ef1Elv9QKt977BIKEMamc9zdwXkKPIA1qfHa8 tVQHvjHUT39CybDFlt/O7DIPiR8nb0OFLFfd4WU3OEjHzrBF/I+P38Lo3X7/m6DW0caB a66A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729573993; x=1730178793; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pKygS+w9C2a0sZq6nT1NqQc6jJlF59Nx0oHfVskn5ko=; b=BKsBfx1tq6vKbtTGdpcjXEmXkguQzMzZHPfaI6iTU4iL5zfTLc1+R8dBdPmD2hRX31 E/RTq/t3EJl5kWVMPyEnWKYYPOIH1p/b3DrtDELgd+5rFBgVriYRJ9nFYdNn3ukaESFJ p0g9tf/7An3NQFF+HO6sC1Pmtwk8mvbgPBUB/gWUtqb030j5vIahM6vepDVviLTPJDcm WsvEIZ4TziJ14pXfIEDKwZx+B8INz2LBS9kCqcIrv2i+5kqTjBpUO2cIKTYrMExO/jKk xt+qBA8qEhRDbAg0zau+8TfKz8cXWYuclSaylUoNOa0ZAk+AbUUjXcGQOhaCTUaa5I/m XZ2w== X-Gm-Message-State: AOJu0YxImRiO0+wosdMzb7dXWEBboLbQxvfT/16yxA3QZmYoaRlt5y1k Lou9WbEaR+Cj9/7ESPv+jZX3+PSQkdiWtX7KrH+duM2BW3nvURAK1xH/V3iq X-Google-Smtp-Source: AGHT+IGW2z4nxuWQD24fxaX9Arj/GLtoHGeJ4mWxSaGyuFuBn4rInF5yC1eTDMgtFCyu7PhJ7h08Sg== X-Received: by 2002:a05:6a00:2e11:b0:71e:16b3:e5dc with SMTP id d2e1a72fcca58-71ea31ec67emr17963522b3a.19.1729573993145; Mon, 21 Oct 2024 22:13:13 -0700 (PDT) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::2fbb]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71ec1407eafsm3831095b3a.208.2024.10.21.22.13.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2024 22:13:12 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH v2 1/3] python3: Fix platform triplet detection Date: Mon, 21 Oct 2024 22:13:08 -0700 Message-ID: <20241022051310.1846604-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 22 Oct 2024 05:13:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206135 Currently, platform is based upon build_os detection which works ok for native builds and where build_os and host_os are same i.e. glibc based systems, but it fails for musl based systems to load correct modules which are shared libraries e.g. python3-pydantic-core This is already fixed upstream in 3.13+ but we need this backported at minimum to get 3.12 or 3.11 working with musl see https://gitlab.alpinelinux.org/alpine/aports/-/issues/13227 https://github.com/meta-homeassistant/meta-homeassistant/issues/89 https://github.com/pypa/auditwheel/issues/349 https://github.com/PyO3/maturin/issues/1559 Signed-off-by: Khem Raj --- v2: Rebased ...r-platform-triplet-detection-code-ad.patch | 498 ++++++++++++++++++ .../recipes-devtools/python/python3_3.12.6.bb | 1 + 2 files changed, 499 insertions(+) create mode 100644 meta/recipes-devtools/python/python3/0001-gh-95855-Refactor-platform-triplet-detection-code-ad.patch diff --git a/meta/recipes-devtools/python/python3/0001-gh-95855-Refactor-platform-triplet-detection-code-ad.patch b/meta/recipes-devtools/python/python3/0001-gh-95855-Refactor-platform-triplet-detection-code-ad.patch new file mode 100644 index 00000000000..863fcc2d36b --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-gh-95855-Refactor-platform-triplet-detection-code-ad.patch @@ -0,0 +1,498 @@ +rom c163d7f0b67a568e9b64eeb9c1cbbaa127818596 Mon Sep 17 00:00:00 2001 +From: Jeffery To +Date: Thu, 24 Aug 2023 20:22:50 +0800 +Subject: [PATCH] gh-95855: Refactor platform triplet detection code, add + detection for MIPS soft float and musl libc (#107221) + +- Move platform triplet detection code into Misc/platform_triplet.c +- Refactor MIPS detection, use defined(__mips64) to detect MIPS64 +- Compute libc values in separate section +- Add detection for MIPS soft float +- Add detection for musl + +musl supports SPE with its soft-float ABI: +https://git.musl-libc.org/cgit/musl/commit/?id=7be59733d71ada3a32a98622507399253f1d5e48 + +Original patch by Christian Heimes. + +Upstream-Status: Backport [https://github.com/python/cpython/commit/c163d7f0b67a568e9b64eeb9c1cbbaa127818596] +Signed-off-by: Khem Raj +Co-authored-by: Christian Heimes +Co-authored-by: Erlend E. Aasland +--- + ...3-07-25-02-30-00.gh-issue-95855.wA7rAf.rst | 2 + + Misc/platform_triplet.c | 255 ++++++++++++++++++ + configure | 192 +------------ + configure.ac | 192 +------------ + 4 files changed, 265 insertions(+), 376 deletions(-) + create mode 100644 Misc/NEWS.d/next/Build/2023-07-25-02-30-00.gh-issue-95855.wA7rAf.rst + create mode 100644 Misc/platform_triplet.c + +--- /dev/null ++++ b/Misc/NEWS.d/next/Build/2023-07-25-02-30-00.gh-issue-95855.wA7rAf.rst +@@ -0,0 +1,2 @@ ++Refactor platform triplet detection code and add detection for MIPS soft ++float and musl libc. +--- /dev/null ++++ b/Misc/platform_triplet.c +@@ -0,0 +1,255 @@ ++/* Detect platform triplet from builtin defines ++ * cc -E Misc/platform_triplet.c | grep '^PLATFORM_TRIPLET=' | tr -d ' ' ++ */ ++#undef bfin ++#undef cris ++#undef fr30 ++#undef linux ++#undef hppa ++#undef hpux ++#undef i386 ++#undef mips ++#undef powerpc ++#undef sparc ++#undef unix ++#if defined(__ANDROID__) ++ # Android is not a multiarch system. ++#elif defined(__linux__) ++/* ++ * BEGIN of Linux block ++ */ ++// Detect libc (based on config.guess) ++# include ++# if defined(__UCLIBC__) ++# error uclibc not supported ++# elif defined(__dietlibc__) ++# error dietlibc not supported ++# elif defined(__GLIBC__) ++# define LIBC gnu ++# define LIBC_X32 gnux32 ++# if defined(__ARM_PCS_VFP) ++# define LIBC_ARM gnueabihf ++# else ++# define LIBC_ARM gnueabi ++# endif ++# if defined(__loongarch__) ++# if defined(__loongarch_soft_float) ++# define LIBC_LA gnusf ++# elif defined(__loongarch_single_float) ++# define LIBC_LA gnuf32 ++# elif defined(__loongarch_double_float) ++# define LIBC_LA gnu ++# else ++# error unknown loongarch floating-point base abi ++# endif ++# endif ++# if defined(_MIPS_SIM) ++# if defined(__mips_hard_float) ++# if _MIPS_SIM == _ABIO32 ++# define LIBC_MIPS gnu ++# elif _MIPS_SIM == _ABIN32 ++# define LIBC_MIPS gnuabin32 ++# elif _MIPS_SIM == _ABI64 ++# define LIBC_MIPS gnuabi64 ++# else ++# error unknown mips sim value ++# endif ++# else ++# if _MIPS_SIM == _ABIO32 ++# define LIBC_MIPS gnusf ++# elif _MIPS_SIM == _ABIN32 ++# define LIBC_MIPS gnuabin32sf ++# elif _MIPS_SIM == _ABI64 ++# define LIBC_MIPS gnuabi64sf ++# else ++# error unknown mips sim value ++# endif ++# endif ++# endif ++# if defined(__SPE__) ++# define LIBC_PPC gnuspe ++# else ++# define LIBC_PPC gnu ++# endif ++# else ++// Heuristic to detect musl libc ++# include ++# ifdef __DEFINED_va_list ++# define LIBC musl ++# define LIBC_X32 muslx32 ++# if defined(__ARM_PCS_VFP) ++# define LIBC_ARM musleabihf ++# else ++# define LIBC_ARM musleabi ++# endif ++# if defined(__loongarch__) ++# if defined(__loongarch_soft_float) ++# define LIBC_LA muslsf ++# elif defined(__loongarch_single_float) ++# define LIBC_LA muslf32 ++# elif defined(__loongarch_double_float) ++# define LIBC_LA musl ++# else ++# error unknown loongarch floating-point base abi ++# endif ++# endif ++# if defined(_MIPS_SIM) ++# if defined(__mips_hard_float) ++# if _MIPS_SIM == _ABIO32 ++# define LIBC_MIPS musl ++# elif _MIPS_SIM == _ABIN32 ++# define LIBC_MIPS musln32 ++# elif _MIPS_SIM == _ABI64 ++# define LIBC_MIPS musl ++# else ++# error unknown mips sim value ++# endif ++# else ++# if _MIPS_SIM == _ABIO32 ++# define LIBC_MIPS muslsf ++# elif _MIPS_SIM == _ABIN32 ++# define LIBC_MIPS musln32sf ++# elif _MIPS_SIM == _ABI64 ++# define LIBC_MIPS muslsf ++# else ++# error unknown mips sim value ++# endif ++# endif ++# endif ++# if defined(_SOFT_FLOAT) || defined(__NO_FPRS__) ++# define LIBC_PPC muslsf ++# else ++# define LIBC_PPC musl ++# endif ++# else ++# error unknown libc ++# endif ++# endif ++ ++# if defined(__x86_64__) && defined(__LP64__) ++PLATFORM_TRIPLET=x86_64-linux-LIBC ++# elif defined(__x86_64__) && defined(__ILP32__) ++PLATFORM_TRIPLET=x86_64-linux-LIBC_X32 ++# elif defined(__i386__) ++PLATFORM_TRIPLET=i386-linux-LIBC ++# elif defined(__aarch64__) && defined(__AARCH64EL__) ++# if defined(__ILP32__) ++PLATFORM_TRIPLET=aarch64_ilp32-linux-LIBC ++# else ++PLATFORM_TRIPLET=aarch64-linux-LIBC ++# endif ++# elif defined(__aarch64__) && defined(__AARCH64EB__) ++# if defined(__ILP32__) ++PLATFORM_TRIPLET=aarch64_be_ilp32-linux-LIBC ++# else ++PLATFORM_TRIPLET=aarch64_be-linux-LIBC ++# endif ++# elif defined(__alpha__) ++PLATFORM_TRIPLET=alpha-linux-LIBC ++# elif defined(__ARM_EABI__) ++# if defined(__ARMEL__) ++PLATFORM_TRIPLET=arm-linux-LIBC_ARM ++# else ++PLATFORM_TRIPLET=armeb-linux-LIBC_ARM ++# endif ++# elif defined(__hppa__) ++PLATFORM_TRIPLET=hppa-linux-LIBC ++# elif defined(__ia64__) ++PLATFORM_TRIPLET=ia64-linux-LIBC ++# elif defined(__loongarch__) && defined(__loongarch_lp64) ++PLATFORM_TRIPLET=loongarch64-linux-LIBC_LA ++# elif defined(__m68k__) && !defined(__mcoldfire__) ++PLATFORM_TRIPLET=m68k-linux-LIBC ++# elif defined(__mips__) ++# if defined(__mips_isa_rev) && (__mips_isa_rev >=6) ++# if defined(_MIPSEL) && defined(__mips64) ++PLATFORM_TRIPLET=mipsisa64r6el-linux-LIBC_MIPS ++# elif defined(_MIPSEL) ++PLATFORM_TRIPLET=mipsisa32r6el-linux-LIBC_MIPS ++# elif defined(__mips64) ++PLATFORM_TRIPLET=mipsisa64r6-linux-LIBC_MIPS ++# else ++PLATFORM_TRIPLET=mipsisa32r6-linux-LIBC_MIPS ++# endif ++# else ++# if defined(_MIPSEL) && defined(__mips64) ++PLATFORM_TRIPLET=mips64el-linux-LIBC_MIPS ++# elif defined(_MIPSEL) ++PLATFORM_TRIPLET=mipsel-linux-LIBC_MIPS ++# elif defined(__mips64) ++PLATFORM_TRIPLET=mips64-linux-LIBC_MIPS ++# else ++PLATFORM_TRIPLET=mips-linux-LIBC_MIPS ++# endif ++# endif ++# elif defined(__or1k__) ++PLATFORM_TRIPLET=or1k-linux-LIBC ++# elif defined(__powerpc64__) ++# if defined(__LITTLE_ENDIAN__) ++PLATFORM_TRIPLET=powerpc64le-linux-LIBC ++# else ++PLATFORM_TRIPLET=powerpc64-linux-LIBC ++# endif ++# elif defined(__powerpc__) ++PLATFORM_TRIPLET=powerpc-linux-LIBC_PPC ++# elif defined(__s390x__) ++PLATFORM_TRIPLET=s390x-linux-LIBC ++# elif defined(__s390__) ++PLATFORM_TRIPLET=s390-linux-LIBC ++# elif defined(__sh__) && defined(__LITTLE_ENDIAN__) ++PLATFORM_TRIPLET=sh4-linux-LIBC ++# elif defined(__sparc__) && defined(__arch64__) ++PLATFORM_TRIPLET=sparc64-linux-LIBC ++# elif defined(__sparc__) ++PLATFORM_TRIPLET=sparc-linux-LIBC ++# elif defined(__riscv) ++# if __riscv_xlen == 32 ++PLATFORM_TRIPLET=riscv32-linux-LIBC ++# elif __riscv_xlen == 64 ++PLATFORM_TRIPLET=riscv64-linux-LIBC ++# else ++# error unknown platform triplet ++# endif ++# else ++# error unknown platform triplet ++# endif ++/* ++ * END of Linux block ++ */ ++#elif defined(__FreeBSD_kernel__) ++# if defined(__LP64__) ++PLATFORM_TRIPLET=x86_64-kfreebsd-gnu ++# elif defined(__i386__) ++PLATFORM_TRIPLET=i386-kfreebsd-gnu ++# else ++# error unknown platform triplet ++# endif ++#elif defined(__gnu_hurd__) ++PLATFORM_TRIPLET=i386-gnu ++#elif defined(__APPLE__) ++PLATFORM_TRIPLET=darwin ++#elif defined(__VXWORKS__) ++PLATFORM_TRIPLET=vxworks ++#elif defined(__wasm32__) ++# if defined(__EMSCRIPTEN__) ++PLATFORM_TRIPLET=wasm32-emscripten ++# elif defined(__wasi__) ++# if defined(_REENTRANT) ++PLATFORM_TRIPLET=wasm32-wasi-threads ++# else ++PLATFORM_TRIPLET=wasm32-wasi ++# endif ++# else ++# error unknown wasm32 platform ++# endif ++#elif defined(__wasm64__) ++# if defined(__EMSCRIPTEN__) ++PLATFORM_TRIPLET=wasm64-emscripten ++# elif defined(__wasi__) ++PLATFORM_TRIPLET=wasm64-wasi ++# else ++# error unknown wasm64 platform ++# endif ++#else ++# error unknown platform triplet ++#endif +--- a/configure.ac ++++ b/configure.ac +@@ -927,198 +927,14 @@ fi + + + AC_MSG_CHECKING([for the platform triplet based on compiler characteristics]) +-cat > conftest.c <=6) && defined(_MIPSEL) +-# if _MIPS_SIM == _ABIO32 +- mipsisa32r6el-linux-gnu +-# elif _MIPS_SIM == _ABIN32 +- mipsisa64r6el-linux-gnuabin32 +-# elif _MIPS_SIM == _ABI64 +- mipsisa64r6el-linux-gnuabi64 +-# else +-# error unknown platform triplet +-# endif +-# elif defined(__mips_hard_float) && defined(__mips_isa_rev) && (__mips_isa_rev >=6) +-# if _MIPS_SIM == _ABIO32 +- mipsisa32r6-linux-gnu +-# elif _MIPS_SIM == _ABIN32 +- mipsisa64r6-linux-gnuabin32 +-# elif _MIPS_SIM == _ABI64 +- mipsisa64r6-linux-gnuabi64 +-# else +-# error unknown platform triplet +-# endif +-# elif defined(__mips_hard_float) && defined(_MIPSEL) +-# if _MIPS_SIM == _ABIO32 +- mipsel-linux-gnu +-# elif _MIPS_SIM == _ABIN32 +- mips64el-linux-gnuabin32 +-# elif _MIPS_SIM == _ABI64 +- mips64el-linux-gnuabi64 +-# else +-# error unknown platform triplet +-# endif +-# elif defined(__mips_hard_float) +-# if _MIPS_SIM == _ABIO32 +- mips-linux-gnu +-# elif _MIPS_SIM == _ABIN32 +- mips64-linux-gnuabin32 +-# elif _MIPS_SIM == _ABI64 +- mips64-linux-gnuabi64 +-# else +-# error unknown platform triplet +-# endif +-# elif defined(__or1k__) +- or1k-linux-gnu +-# elif defined(__powerpc__) && defined(__SPE__) +- powerpc-linux-gnuspe +-# elif defined(__powerpc64__) +-# if defined(__LITTLE_ENDIAN__) +- powerpc64le-linux-gnu +-# else +- powerpc64-linux-gnu +-# endif +-# elif defined(__powerpc__) +- powerpc-linux-gnu +-# elif defined(__s390x__) +- s390x-linux-gnu +-# elif defined(__s390__) +- s390-linux-gnu +-# elif defined(__sh__) && defined(__LITTLE_ENDIAN__) +- sh4-linux-gnu +-# elif defined(__sparc__) && defined(__arch64__) +- sparc64-linux-gnu +-# elif defined(__sparc__) +- sparc-linux-gnu +-# elif defined(__riscv) +-# if __riscv_xlen == 32 +- riscv32-linux-gnu +-# elif __riscv_xlen == 64 +- riscv64-linux-gnu +-# else +-# error unknown platform triplet +-# endif +-# else +-# error unknown platform triplet +-# endif +-#elif defined(__FreeBSD_kernel__) +-# if defined(__LP64__) +- x86_64-kfreebsd-gnu +-# elif defined(__i386__) +- i386-kfreebsd-gnu +-# else +-# error unknown platform triplet +-# endif +-#elif defined(__gnu_hurd__) +- i386-gnu +-#elif defined(__APPLE__) +- darwin +-#elif defined(__VXWORKS__) +- vxworks +-#elif defined(__wasm32__) +-# if defined(__EMSCRIPTEN__) +- wasm32-emscripten +-# elif defined(__wasi__) +-# if defined(_REENTRANT) +- wasm32-wasi-threads +-# else +- wasm32-wasi +-# endif +-# else +-# error unknown wasm32 platform +-# endif +-#elif defined(__wasm64__) +-# if defined(__EMSCRIPTEN__) +- wasm64-emscripten +-# elif defined(__wasi__) +- wasm64-wasi +-# else +-# error unknown wasm64 platform +-# endif +-#else +-# error unknown platform triplet +-#endif +- +-EOF +- +-if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then +- PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '` +- case "$build_os" in +- linux-musl*) +- PLATFORM_TRIPLET=`echo "$PLATFORM_TRIPLET" | sed 's/linux-gnu/linux-musl/'` +- ;; +- esac ++if $CPP $CPPFLAGS $srcdir/Misc/platform_triplet.c >conftest.out 2>/dev/null; then ++ PLATFORM_TRIPLET=`grep '^PLATFORM_TRIPLET=' conftest.out | tr -d ' '` ++ PLATFORM_TRIPLET="${PLATFORM_TRIPLET@%:@PLATFORM_TRIPLET=}" + AC_MSG_RESULT([$PLATFORM_TRIPLET]) + else + AC_MSG_RESULT([none]) + fi +-rm -f conftest.c conftest.out ++rm -f conftest.out + + AC_MSG_CHECKING([for multiarch]) + AS_CASE([$ac_sys_system], diff --git a/meta/recipes-devtools/python/python3_3.12.6.bb b/meta/recipes-devtools/python/python3_3.12.6.bb index 858124d104f..da1a0afad4c 100644 --- a/meta/recipes-devtools/python/python3_3.12.6.bb +++ b/meta/recipes-devtools/python/python3_3.12.6.bb @@ -34,6 +34,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ file://0001-test_deadlock-skip-problematic-test.patch \ file://0001-test_active_children-skip-problematic-test.patch \ file://0001-test_readline-skip-limited-history-test.patch \ + file://0001-gh-95855-Refactor-platform-triplet-detection-code-ad.patch \ " SRC_URI:append:class-native = " \ From patchwork Tue Oct 22 05:13:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 50997 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE157D15D9D for ; Tue, 22 Oct 2024 05:13:22 +0000 (UTC) Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by mx.groups.io with SMTP id smtpd.web11.11603.1729573994793641500 for ; Mon, 21 Oct 2024 22:13:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=kEbaGUJJ; spf=pass (domain: gmail.com, ip: 209.85.210.171, mailfrom: raj.khem@gmail.com) Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-71f5208217dso9098b3a.2 for ; Mon, 21 Oct 2024 22:13:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729573994; x=1730178794; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=279A60gXi8HE/CmZKJfRgCmDiNCYoZzgfndMpytuUNM=; b=kEbaGUJJkWTeQu9xDf0xkT0RdQEtM0JO0TFJuuHf5OwUxxX9r+145jCY2ObXr27RFN q87Fzj6/lQkAnI2vtwrIFnRhvVq5FD713GtgE0XQ/cNy82cead3bol2rzlpZcDgW8+YO lhSrNpl/6bOSfSzk6lCOpkhEmrv+RtZifXsrVJ+G4igKxImm2ZRdY+5vwh20Tv7ux5uK BX9DQywS0xxrjKpo3+Ki0iiKqVcYKPj0plivmfdOLVTMA5Hoo1nxEcEhxSgNna70Ja0f AehmnVfAKialWycdOhZ9vSoF4Cgftnl3L3TMYGJLCNZlvFxLT3yJrr6J3ZGI5+Wm+96f 2ArQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729573994; x=1730178794; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=279A60gXi8HE/CmZKJfRgCmDiNCYoZzgfndMpytuUNM=; b=u2zvsaVDzGzc+dwLQ6waaMUpY7VNKLpejpBBylzAkqPuMRIZsw1Hlz7XnFAjRIZHQ9 7/j2WmNnhh85WRi5Zrga7ibLZZzZ59i3p+Fu+EAuAuItz6C26EUjc9hawXwB963by/+j 8zwtrdqYFhdc27oXDlOwyJ6q9adQpDdrSz8uqbLobJSXypnOh9zPFbCcu7M3p+tvWUd3 Z9aeV2isk8DzuN8gXVjA9cMtTHmBE5+49N56cRi3axzccM2XW79tJP56P+/0lNP6TsXm Bu32Fm3rj9+PUhx6M8sKjugiNKiRVDlm9GsUfjhco8zPSsVHp34F4YvA8NCkgknekkq9 94PA== X-Gm-Message-State: AOJu0YwrflpCFCTbbjXuCg79ckKNIIz938Fqj6EJ9k6EM+OlnNSXq6NT yxXKdKWa4LbdB2dR+RtWbYn0hRKKsoj8B0oOGtTD3rSPpFnTynbJJw9/zVLz X-Google-Smtp-Source: AGHT+IFt7UANaK3dBsfzubHJ8wlje26+A2K50ULeTW+JrwcCRfstoQ7lpjcTProKCpzfQb2REMv+cg== X-Received: by 2002:a05:6a20:b22:b0:1d9:3456:b799 with SMTP id adf61e73a8af0-1d93456bec9mr12158101637.46.1729573993905; Mon, 21 Oct 2024 22:13:13 -0700 (PDT) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::2fbb]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71ec1407eafsm3831095b3a.208.2024.10.21.22.13.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2024 22:13:13 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH v2 2/3] python3-packaging: Ignore old glibc tests on musl Date: Mon, 21 Oct 2024 22:13:09 -0700 Message-ID: <20241022051310.1846604-2-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241022051310.1846604-1-raj.khem@gmail.com> References: <20241022051310.1846604-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 22 Oct 2024 05:13:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206136 These tests expect glibc to be the system C library ignore them for musl Signed-off-by: Khem Raj --- v2: Use bitbake variable for ignored tests meta/recipes-devtools/python/python3-packaging/run-ptest | 3 --- meta/recipes-devtools/python/python3-packaging/run-ptest.in | 2 ++ meta/recipes-devtools/python/python3-packaging_24.1.bb | 6 +++++- 3 files changed, 7 insertions(+), 4 deletions(-) delete mode 100644 meta/recipes-devtools/python/python3-packaging/run-ptest create mode 100644 meta/recipes-devtools/python/python3-packaging/run-ptest.in diff --git a/meta/recipes-devtools/python/python3-packaging/run-ptest b/meta/recipes-devtools/python/python3-packaging/run-ptest deleted file mode 100644 index 8d2017d39ce..00000000000 --- a/meta/recipes-devtools/python/python3-packaging/run-ptest +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -pytest --automake diff --git a/meta/recipes-devtools/python/python3-packaging/run-ptest.in b/meta/recipes-devtools/python/python3-packaging/run-ptest.in new file mode 100644 index 00000000000..508538463bb --- /dev/null +++ b/meta/recipes-devtools/python/python3-packaging/run-ptest.in @@ -0,0 +1,2 @@ +#!/bin/sh +pytest --automake IGNOREDTESTS diff --git a/meta/recipes-devtools/python/python3-packaging_24.1.bb b/meta/recipes-devtools/python/python3-packaging_24.1.bb index 20bcd55fbad..ac8fa4b73f9 100644 --- a/meta/recipes-devtools/python/python3-packaging_24.1.bb +++ b/meta/recipes-devtools/python/python3-packaging_24.1.bb @@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=faadaedca9251a90b205c9167578ce91" SRC_URI[sha256sum] = "026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002" -SRC_URI += "file://run-ptest" +SRC_URI += "file://run-ptest.in" inherit pypi python_flit_core ptest @@ -15,6 +15,9 @@ BBCLASSEXTEND = "native nativesdk" DEPENDS:remove:class-native = "python3-build-native" RDEPENDS:${PN} += "python3-profile" +SKIPLIST ?= "" +SKIPLIST:libc-musl = "--deselect tests/test_manylinux.py::test_is_manylinux_compatible_old --ignore=tests/test_tags.py" + do_compile:class-native () { python_flit_core_do_manual_build } @@ -23,6 +26,7 @@ do_install_ptest() { cp -r ${S}/tests ${D}${PTEST_PATH}/ # We don't need this script which is used to build the binaries rm -f ${D}${PTEST_PATH}/tests/manylinux/build.sh + sed -e 's|IGNOREDTESTS|${SKIPLIST}|' ${UNPACKDIR}/run-ptest.in > ${D}${PTEST_PATH}/run-ptest } RDEPENDS:${PN}-ptest = "\ From patchwork Tue Oct 22 05:13:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 50999 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF2CBD0E6FC for ; Tue, 22 Oct 2024 05:13:22 +0000 (UTC) Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by mx.groups.io with SMTP id smtpd.web10.11613.1729573996002895891 for ; Mon, 21 Oct 2024 22:13:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OoZ0T9lD; spf=pass (domain: gmail.com, ip: 209.85.210.180, mailfrom: raj.khem@gmail.com) Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-71eb1d0e3c2so2039828b3a.2 for ; Mon, 21 Oct 2024 22:13:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729573995; x=1730178795; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=24XxBZQdZFJc1afV9cAQ8JiwwG5w9/nVYr3ut7zSRH8=; b=OoZ0T9lDw76PVpKFswRJ+VmMNZEo3o42OsJTank4CCCuZuEYVAUu4L3GDU2Hbc6xaB lv+IsRXujoYpwG4ARVj6Zeu5u5wwRtTD6LCIU4umU4+wT6BsK9ePytCR7vJQ0SwO1//x nOgE1RAvH62YsvOZtPKeZLeQXeOc/EE5UXx0UztQUPk5FhY2uPGNdlcXLQ6yJn6oNc5q mJBerJ9foAMIX5OanwaviegDGe82r/zISq1fZUcv00p3RQ+xIehZqYGNj7dJaHBtqXgO VKpb09UmGrihG1SiYzccdxC1B4BYLJV3RRf0kk0SbtwDYzhLMrJTEVQ2e41T7tujuoRF pUHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729573995; x=1730178795; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=24XxBZQdZFJc1afV9cAQ8JiwwG5w9/nVYr3ut7zSRH8=; b=h3sKDkSiiKfdOc2ZAYUa5/TSk4Xyy4n8dL+kHWNyIJU8qggY8UR4VaYo2DyiCQVIyD yqfqgOHxlkBQyfGuaVcufikT8KRftnKrzMZkWo2WWbyEZq67po2pISJXfRKkW2U3rMeG EO+lIDXKB1HtJNhgRjXpbgd1RIcU/cK9tFAs6W0zRq1ATsBJlb/PvIHmyNOL6boZeCXT gj/Br+4dqlolaIzGx0zXYQUDdoZ2w/XNfAQJSFeT5q6ELlYeyuar5lbIN6PvW31S/DHA XgJXNKR7ccKbbXZmEevFEsU805ogOIBISn/ln3hlc6wUc7HDQ9M1XREvEIU8HHk3IjYB wJ5g== X-Gm-Message-State: AOJu0Yx+86VG3KQCG1vAUCgYqv3D53Uk0Vb/LS+LO1tDehI65acCfn2L +YgYrCqqB9vjSttkBGQNN4OwbrI8z2yp599fq212Ul8/Y+ljJxP2mjhqkzHF X-Google-Smtp-Source: AGHT+IHkc0mGnpCSiZy9YNOC0ZEi+1C3bMh337UVW3e6kPBVsisXDcG5HrMaRH40O24LOYVAXcGGGA== X-Received: by 2002:a05:6a00:1792:b0:71d:fe64:e3fa with SMTP id d2e1a72fcca58-71ea31e4c3amr19907774b3a.19.1729573995102; Mon, 21 Oct 2024 22:13:15 -0700 (PDT) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::2fbb]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71ec1407eafsm3831095b3a.208.2024.10.21.22.13.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2024 22:13:14 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Cc: Khem Raj Subject: [PATCH v2 3/3] python3-libarchive-c: Avoid using find_library python API Date: Mon, 21 Oct 2024 22:13:10 -0700 Message-ID: <20241022051310.1846604-3-raj.khem@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241022051310.1846604-1-raj.khem@gmail.com> References: <20241022051310.1846604-1-raj.khem@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 22 Oct 2024 05:13:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/206137 find_library API depends on platform to provide ldconfig, ld, gcc, objdump etc, so either we add these dependencies or avoid them by computing the libarchive library name during build, which we can be done. This ensures that ffi module works with musl as well as glibc equally as musl does not provide ldconfig like glibc does Signed-off-by: Khem Raj --- v2: Rebased meta/recipes-devtools/python/python3-libarchive-c_5.1.bb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/meta/recipes-devtools/python/python3-libarchive-c_5.1.bb b/meta/recipes-devtools/python/python3-libarchive-c_5.1.bb index 3116c6b62ec..510e2d9159c 100644 --- a/meta/recipes-devtools/python/python3-libarchive-c_5.1.bb +++ b/meta/recipes-devtools/python/python3-libarchive-c_5.1.bb @@ -16,6 +16,14 @@ inherit pypi setuptools3 ptest SRC_URI[sha256sum] = "7bcce24ea6c0fa3bc62468476c6d2f6264156db2f04878a372027c10615a2721" +DEPENDS += "patchelf-native libarchive" +# Avoid using find_library API which needs ldconfig and ld/objdump +# https://docs.python.org/3/library/ctypes.html#ctypes-reference +# +do_configure:append() { + sed -i -e "s|find_library('archive')|'${libdir}/$(patchelf --print-soname ${STAGING_LIBDIR}/libarchive.so)'|" ${S}/libarchive/ffi.py +} + RDEPENDS:${PN} += "\ libarchive \ python3-ctypes \