From d832ee79631ac1502b107091cdcfd8f88237d533 Mon Sep 17 00:00:00 2001 From: Trevor Gamblin Date: Mon, 23 Dec 2024 11:20:52 -0500 Subject: python3: upgrade 3.13.0 -> 3.13.1 Changelog: https://docs.python.org/3/whatsnew/changelog.html#python-3-13-1-final - Patch 'fix-armv5.patch' is in 3.13.1, so no longer needed: |tgamblin@megalith ~/workspace/git/pythonsrc/cpython ((HEAD detached from v3.13.1))$ git tag --contains 18b9079ddbc149d6b99c922630c246812e4d8ae7 |v3.13.1 - While patch 'crosspythonpath.patch' is listed as 'Inappropriate [OE-Core integration specific]' specific in the commit message, it is now breaking the build, while removing it allows python3 to build OK. It appears that there is a similar change in upstream 3.13.1: https://github.com/python/cpython/commit/909d5ac2959e - gcc-symlinks had to be added to ptest RDEPENDS so that 'gcc' could be found on the path for the test_ctypes.test_dlerror.TestNullDlsym.test_null_dlsym test. - Also reformat the DEPENDS and RDEPENDS lists to be alphabetical and one-per-line, since that's easier to read and modify. - buildall-qemu output: |BUILDALL-QEMU LOG FOR python3 |START TIME: 2024-12-18_20:38:01 |HOSTNAME: megalith |HOST OS: Debian GNU/Linux 12 (bookworm) |HOST KERNEL: 6.1.0-28-amd64 |=============== |BUILD RESULTS: |[glibc] |FAIL: qemuloongarch64 |PASS: qemuriscv32 |PASS: qemuarmv5 |PASS: qemuppc |PASS: qemumips64 |PASS: qemuriscv64 |PASS: qemuarm64 |PASS: qemuarm |PASS: qemux86-64 |PASS: qemuppc64 |PASS: qemux86 |PASS: qemumips |[musl] |FAIL: qemuloongarch64 |FAIL: qemuriscv32 |PASS: qemuarmv5 |PASS: qemuppc |PASS: qemumips64 |PASS: qemuriscv64 |PASS: qemuarm64 |PASS: qemuarm |PASS: qemux86-64 |PASS: qemuppc64 |PASS: qemux86 |PASS: qemumips |=============== |PASSED: 21 |FAILED: 3 (From OE-Core rev: 08c44d3b140b220ead6334db26097b28612d445a) Signed-off-by: Trevor Gamblin Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- .../python/python3/crosspythonpath.patch | 33 -- .../python/python3/fix-armv5.patch | 65 --- meta/recipes-devtools/python/python3_3.13.0.bb | 484 ------------------- meta/recipes-devtools/python/python3_3.13.1.bb | 516 +++++++++++++++++++++ 4 files changed, 516 insertions(+), 582 deletions(-) delete mode 100644 meta/recipes-devtools/python/python3/crosspythonpath.patch delete mode 100644 meta/recipes-devtools/python/python3/fix-armv5.patch delete mode 100644 meta/recipes-devtools/python/python3_3.13.0.bb create mode 100644 meta/recipes-devtools/python/python3_3.13.1.bb (limited to 'meta/recipes-devtools/python') diff --git a/meta/recipes-devtools/python/python3/crosspythonpath.patch b/meta/recipes-devtools/python/python3/crosspythonpath.patch deleted file mode 100644 index f18898e4c4..0000000000 --- a/meta/recipes-devtools/python/python3/crosspythonpath.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 8840438e73e43b99bc9c83896a5f950e4259738f Mon Sep 17 00:00:00 2001 -From: Ricardo Ribalda -Date: Tue, 18 Nov 2014 03:35:33 -0500 -Subject: [PATCH] configure.ac: add CROSSPYTHONPATH into PYTHONPATH for - PYTHON_FOR_BUILD - -When building x86->x86 the system will try to execute .so and related items -from the default PYTHONPATH. This will fail if the target CPU contains -instructions that the host CPU does not have, add CROSSPYTHONPATH -into PYTHONPATH so we can prepend the list to find correct libs. - -Upstream-Status: Inappropriate [OE-Core integration specific] - -Credits-to: Mark Hatle -Credits-to: Jackie Huang -Signed-off-by: Ricardo Ribalda ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 58f5407..5101806 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -164,7 +164,7 @@ AC_ARG_WITH([build-python], - dnl Build Python interpreter is used for regeneration and freezing. - ac_cv_prog_PYTHON_FOR_REGEN=$with_build_python - PYTHON_FOR_FREEZE="$with_build_python" -- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$with_build_python -+ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(CROSSPYTHONPATH):$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$with_build_python - AC_MSG_RESULT([$with_build_python]) - ], [ - AS_VAR_IF([cross_compiling], [yes], diff --git a/meta/recipes-devtools/python/python3/fix-armv5.patch b/meta/recipes-devtools/python/python3/fix-armv5.patch deleted file mode 100644 index 961404b24f..0000000000 --- a/meta/recipes-devtools/python/python3/fix-armv5.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 18b9079ddbc149d6b99c922630c246812e4d8ae7 Mon Sep 17 00:00:00 2001 -From: "Miss Islington (bot)" - <31488909+miss-islington@users.noreply.github.com> -Date: Wed, 16 Oct 2024 16:48:40 +0200 -Subject: [PATCH] [3.13] gh-125444: Fix illegal instruction for older Arm - architectures (GH-125574) (GH-125595) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -On Arm v5 it is not possible to get the thread ID via c13 register -hence the illegal instruction. The c13 register started to provide -thread ID since Arm v6K architecture variant. Other variants of -Arm v6 (T2, Z and base) don’t provide the thread ID via c13. -For the sake of simplicity we group v5 and v6 together and -consider that instructions for Arm v7 only. -(cherry picked from commit feda9aa73ab95d17a291db22c416146f8e70edeb) - -Co-authored-by: Diego Russo - -Upstream-Status: Backport [https://github.com/python/cpython/commit/18b9079ddbc149d6b99c922630c246812e4d8ae7] -Signed-off-by: Alexander Kanavin ---- - Include/internal/mimalloc/mimalloc/prim.h | 4 ++-- - Include/object.h | 2 +- - .../2024-10-16-12-12-39.gh-issue-125444.9tG2X6.rst | 1 + - 3 files changed, 4 insertions(+), 3 deletions(-) - create mode 100644 Misc/NEWS.d/next/Core_and_Builtins/2024-10-16-12-12-39.gh-issue-125444.9tG2X6.rst - -diff --git a/Include/internal/mimalloc/mimalloc/prim.h b/Include/internal/mimalloc/mimalloc/prim.h -index 8a60d528458e6c..322ab29e6b41c2 100644 ---- a/Include/internal/mimalloc/mimalloc/prim.h -+++ b/Include/internal/mimalloc/mimalloc/prim.h -@@ -151,9 +151,9 @@ static inline mi_threadid_t _mi_prim_thread_id(void) mi_attr_noexcept { - // If you test on another platform and it works please send a PR :-) - // see also https://akkadia.org/drepper/tls.pdf for more info on the TLS register. - #elif defined(__GNUC__) && ( \ -- (defined(__GLIBC__) && (defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__))) \ -+ (defined(__GLIBC__) && (defined(__x86_64__) || defined(__i386__) || (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__))) \ - || (defined(__APPLE__) && (defined(__x86_64__) || defined(__aarch64__))) \ -- || (defined(__BIONIC__) && (defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__))) \ -+ || (defined(__BIONIC__) && (defined(__x86_64__) || defined(__i386__) || (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__))) \ - || (defined(__FreeBSD__) && (defined(__x86_64__) || defined(__i386__) || defined(__aarch64__))) \ - || (defined(__OpenBSD__) && (defined(__x86_64__) || defined(__i386__) || defined(__aarch64__))) \ - ) -diff --git a/Include/object.h b/Include/object.h -index 78aa7ad0f459ff..b53f9acfebdb0c 100644 ---- a/Include/object.h -+++ b/Include/object.h -@@ -259,7 +259,7 @@ _Py_ThreadId(void) - __asm__("movq %%gs:0, %0" : "=r" (tid)); // x86_64 macOSX uses GS - #elif defined(__x86_64__) - __asm__("movq %%fs:0, %0" : "=r" (tid)); // x86_64 Linux, BSD uses FS --#elif defined(__arm__) -+#elif defined(__arm__) && __ARM_ARCH >= 7 - __asm__ ("mrc p15, 0, %0, c13, c0, 3\nbic %0, %0, #3" : "=r" (tid)); - #elif defined(__aarch64__) && defined(__APPLE__) - __asm__ ("mrs %0, tpidrro_el0" : "=r" (tid)); -diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2024-10-16-12-12-39.gh-issue-125444.9tG2X6.rst b/Misc/NEWS.d/next/Core_and_Builtins/2024-10-16-12-12-39.gh-issue-125444.9tG2X6.rst -new file mode 100644 -index 00000000000000..13c1e745edf8d5 ---- /dev/null -+++ b/Misc/NEWS.d/next/Core_and_Builtins/2024-10-16-12-12-39.gh-issue-125444.9tG2X6.rst -@@ -0,0 +1 @@ -+Fix illegal instruction for older Arm architectures. Patch by Diego Russo, testing by Ross Burton. diff --git a/meta/recipes-devtools/python/python3_3.13.0.bb b/meta/recipes-devtools/python/python3_3.13.0.bb deleted file mode 100644 index b3170879b9..0000000000 --- a/meta/recipes-devtools/python/python3_3.13.0.bb +++ /dev/null @@ -1,484 +0,0 @@ -SUMMARY = "The Python Programming Language" -HOMEPAGE = "http://www.python.org" -DESCRIPTION = "Python is a programming language that lets you work more quickly and integrate your systems more effectively." -LICENSE = "PSF-2.0" -SECTION = "devel/python" - -LIC_FILES_CHKSUM = "file://LICENSE;md5=3f64a4ff490f884d562feb77bf2435f1" - -SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ - file://run-ptest \ - file://create_manifest3.py \ - file://get_module_deps3.py \ - file://python3-manifest.json \ - file://check_build_completeness.py \ - file://reformat_sysconfig.py \ - file://0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch \ - file://crosspythonpath.patch \ - file://0001-test_locale.py-correct-the-test-output-format.patch \ - file://0001-Skip-failing-tests-due-to-load-variability-on-YP-AB.patch \ - file://0001-test_ctypes.test_find-skip-without-tools-sdk.patch \ - file://makerace.patch \ - file://0001-sysconfig.py-use-platlibdir-also-for-purelib.patch \ - file://0001-Lib-pty.py-handle-stdin-I-O-errors-same-way-as-maste.patch \ - file://deterministic_imports.patch \ - file://0001-Avoid-shebang-overflow-on-python-config.py.patch \ - file://0001-Update-test_sysconfig-for-posix_user-purelib.patch \ - file://0001-skip-no_stdout_fileno-test-due-to-load-variability.patch \ - file://0001-test_storlines-skip-due-to-load-variability.patch \ - file://0001-test_shutdown-skip-problematic-test.patch \ - 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://fix-armv5.patch \ - file://0001-Generate-data-for-OpenSSL-3.4-and-add-it-to-multissl.patch \ - file://0001-ssl-Raise-OSError-for-ERR_LIB_SYS.patch \ - " - -SRC_URI:append:class-native = " \ - file://0001-Lib-sysconfig.py-use-prefix-value-from-build-configu.patch \ - " - -SRC_URI[sha256sum] = "086de5882e3cb310d4dca48457522e2e48018ecd43da9cdf827f6a0759efb07d" - -# exclude pre-releases for both python 2.x and 3.x -UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P\d+(\.\d+)+).tar" - -CVE_PRODUCT = "python cpython" - -CVE_STATUS[CVE-2007-4559] = "disputed: Upstream consider this expected behaviour" -CVE_STATUS[CVE-2019-18348] = "not-applicable-config: This is not exploitable when glibc has CVE-2016-10739 fixed" -CVE_STATUS[CVE-2020-15523] = "not-applicable-platform: Issue only applies on Windows" -CVE_STATUS[CVE-2022-26488] = "not-applicable-platform: Issue only applies on Windows" -# The module will be removed in the future and flaws documented. -CVE_STATUS[CVE-2015-20107] = "upstream-wontfix: The mailcap module is insecure by design, so this can't be fixed in a meaningful way" -CVE_STATUS[CVE-2023-36632] = "disputed: Not an issue, in fact expected behaviour" - -PYTHON_MAJMIN = "3.13" - -S = "${WORKDIR}/Python-${PV}" - -BBCLASSEXTEND = "native nativesdk" - -inherit autotools pkgconfig qemu ptest multilib_header update-alternatives - -MULTILIB_SUFFIX = "${@d.getVar('base_libdir',1).split('/')[-1]}" - -ALTERNATIVE:${PN}-dev = "python3-config" -ALTERNATIVE_LINK_NAME[python3-config] = "${bindir}/python${PYTHON_MAJMIN}-config" -ALTERNATIVE_TARGET[python3-config] = "${bindir}/python${PYTHON_MAJMIN}-config-${MULTILIB_SUFFIX}" - - -DEPENDS = "bzip2-replacement-native expat libffi bzip2 openssl sqlite3 zlib virtual/libintl xz virtual/crypt util-linux-libuuid libtirpc libnsl2 autoconf-archive-native ncurses" -DEPENDS:append:class-target = " python3-native" -DEPENDS:append:class-nativesdk = " python3-native" - -EXTRA_OECONF = " --without-ensurepip --enable-shared --with-platlibdir=${baselib} --with-system-expat" -EXTRA_OECONF:append:class-native = " --bindir=${bindir}/${PN}" -EXTRA_OECONF:append:class-target = " --with-build-python=nativepython3" -EXTRA_OECONF:append:class-nativesdk = " --with-build-python=nativepython3" - -export CROSSPYTHONPATH="${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/" - -EXTRANATIVEPATH += "python3-native" - -# LTO will be enabled via packageconfig depending upong distro features -LTO:class-target = "" - -CACHED_CONFIGUREVARS = " \ - ac_cv_file__dev_ptmx=yes \ - ac_cv_file__dev_ptc=no \ - ac_cv_working_tzset=yes \ -" -CACHED_CONFIGUREVARS:append:class-target = " \ - ac_cv_libatomic_needed=yes \ -" - -# set thread stack size to 2MB on musl for interpreter and stdlib C extensions -# so it does not run into stack limits due to musl's small thread stack -# This is only needed to build interpreter and not the subsequent modules -# Thats why CFLAGS_NODIST is modified instead of CFLAGS -CACHED_CONFIGUREVARS:append:libc-musl = "\ - CFLAGS_NODIST='${CFLAGS} -DTHREAD_STACK_SIZE=0x200000' \ -" - -# PGO currently causes builds to not be reproducible so disable by default, see YOCTO #13407 -PACKAGECONFIG ??= "editline gdbm ${@bb.utils.filter('DISTRO_FEATURES', 'lto', d)}" -PACKAGECONFIG[readline] = "--with-readline=readline,,readline,,,editline" -PACKAGECONFIG[editline] = "--with-readline=editline,,libedit,,,readline" -# Use profile guided optimisation by running PyBench inside qemu-user -PACKAGECONFIG[pgo] = "--enable-optimizations,,qemu-native" -PACKAGECONFIG[tk] = ",,tk" -PACKAGECONFIG[tcl] = ",,tcl" -PACKAGECONFIG[gdbm] = ",,gdbm" -PACKAGECONFIG[lto] = "--with-lto,--without-lto" -PACKAGECONFIG[staticlibpython] = "--with-static-libpython,--without-static-libpython" - -do_configure:prepend () { - mkdir -p ${B}/Modules - cat > ${B}/Modules/Setup.local << EOF -*disabled* -${@bb.utils.contains('PACKAGECONFIG', 'gdbm', '', '_gdbm _dbm', d)} -${@bb.utils.contains_any('PACKAGECONFIG', 'readline editline', '', 'readline', d)} -${@bb.utils.contains('PACKAGECONFIG', 'tk', '', '_tkinter', d)} -EOF -} - -CPPFLAGS += "-I${STAGING_INCDIR}/ncursesw -I${STAGING_INCDIR}/uuid" - -# COMPILEALL_OPTS= ensures that .pyc are not compiled in parallel -# This was found to lock up builds, break reproducibility, and produce strange file ownership -# races. -# -# The upstream commit introducing the change was: -# https://github.com/python/cpython/commit/1a2dd82f56bd813aacc570e172cefe55a8a41504 -# -# The build lock up issue is reported here: -# https://bugs.python.org/issue45945 -# -# The repro failures are documented here: -# https://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20211130-yr_o1a8d/packages/diff-html/ - -EXTRA_OEMAKE = '\ - STAGING_LIBDIR=${STAGING_LIBDIR} \ - STAGING_INCDIR=${STAGING_INCDIR} \ - LIB=${baselib} \ - COMPILEALL_OPTS= \ -' - -# Generate a Profile Guided Optimisation wrapper script that uses qemu-user for -# all cross builds. -write_pgo_wrapper:class-native = ":" -write_pgo_wrapper() { - if ${@bb.utils.contains('PACKAGECONFIG', 'pgo', 'true', 'false', d)}; then - cat >pgo-wrapper < ${B}/Modules/Setup.local << EOF +*disabled* +${@bb.utils.contains('PACKAGECONFIG', 'gdbm', '', '_gdbm _dbm', d)} +${@bb.utils.contains_any('PACKAGECONFIG', 'readline editline', '', 'readline', d)} +${@bb.utils.contains('PACKAGECONFIG', 'tk', '', '_tkinter', d)} +EOF +} + +CPPFLAGS += "-I${STAGING_INCDIR}/ncursesw -I${STAGING_INCDIR}/uuid" + +# COMPILEALL_OPTS= ensures that .pyc are not compiled in parallel +# This was found to lock up builds, break reproducibility, and produce strange file ownership +# races. +# +# The upstream commit introducing the change was: +# https://github.com/python/cpython/commit/1a2dd82f56bd813aacc570e172cefe55a8a41504 +# +# The build lock up issue is reported here: +# https://bugs.python.org/issue45945 +# +# The repro failures are documented here: +# https://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20211130-yr_o1a8d/packages/diff-html/ + +EXTRA_OEMAKE = '\ + STAGING_LIBDIR=${STAGING_LIBDIR} \ + STAGING_INCDIR=${STAGING_INCDIR} \ + LIB=${baselib} \ + COMPILEALL_OPTS= \ +' + +# Generate a Profile Guided Optimisation wrapper script that uses qemu-user for +# all cross builds. +write_pgo_wrapper:class-native = ":" +write_pgo_wrapper() { + if ${@bb.utils.contains('PACKAGECONFIG', 'pgo', 'true', 'false', d)}; then + cat >pgo-wrapper <