Skip to contentSkip to conversation

mpdecimal: Add mpdecimal 4.0.1 as a new recipe in oe-core

PATCH Superseded Jaipaul Cheernam 2 participants 3 messages Oct 12 – Oct 13

v2 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 mpdecimal: Add mpdecimal 4.0.1 as a new recipe in oe-core

Python 3.15 removed the implicit fallback to the bundled copy of libmpdec, requiring a system libmpdecimal to build the _decimal module. [1]

- Volunteer to maintain mpdecimal

[1] https://github.com/python/cpython/issues/115119

---
Changes Since V1:
- Updated EXTRA_OEMAKE flags

 meta/conf/distro/include/maintainers.inc      |  1 +
 .../mpdecimal/mpdecimal_4.0.1.bb              | 23 +++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 meta/recipes-support/mpdecimal/mpdecimal_4.0.1.bb
meta/conf/distro/include/maintainers.inc +1 -0
index 94ab0ccace..952ca58cb1 100644
@@ -542,6 +542,7 @@ RECIPE_MAINTAINER:pn-mkfontscale = "Unassigned <[email protected]>"
 RECIPE_MAINTAINER:pn-mmc-utils = "Unassigned <[email protected]>"
 RECIPE_MAINTAINER:pn-mobile-broadband-provider-info = "Unassigned <[email protected]>"
 RECIPE_MAINTAINER:pn-modutils-initscripts = "Yi Zhao <[email protected]>"
+RECIPE_MAINTAINER:pn-mpdecimal = "Jaipaul Cheernam <[email protected]>"
 RECIPE_MAINTAINER:pn-mpfr = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER:pn-mpg123 = "Unassigned <[email protected]>"
 RECIPE_MAINTAINER:pn-msmtp = "Wang Mingyu <[email protected]>"
meta/recipes-support/mpdecimal/mpdecimal_4.0.1.bb new file +23 -0
new file mode 100644
index 0000000000..5d668a3826
@@ -0,0 +1,23 @@
+SUMMARY = "Library for arbitrary precision decimal floating point arithmetic"
+DESCRIPTION = "mpdecimal is a C/C++ library for correctly rounded arbitrary \
+precision decimal floating point arithmetic. It is a complete implementation \
+of Mike Cowlishaw/IBM's General Decimal Arithmetic Specification and provides \
+libmpdec (C) and libmpdec++ (C++)."
+HOMEPAGE = "https://www.bytereef.org/mpdecimal/"
+SECTION = "libs"
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://COPYRIGHT.txt;md5=61bb27059c72d53804ef475f5b18d38f"
+
+SRC_URI = "https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-${PV}.tar.gz"
+SRC_URI[sha256sum] = "96d33abb4bb0070c7be0fed4246cd38416188325f820468214471938545b1ac8"
+
+inherit autotools
+
+# libmpdec++ links using LDXXFLAGS instead of LDFLAGS
+EXTRA_OEMAKE += "LDXXFLAGS='${LDFLAGS}'"
+
+PACKAGES =+ "libmpdec libmpdec++"
+FILES:libmpdec = "${libdir}/libmpdec.so.*"
+FILES:libmpdec++ = "${libdir}/libmpdec++.so.*"
+
+BBCLASSEXTEND = "native nativesdk"
#1 lore raw

PATCH v2 2/2 python3: upgrade 3.14.7 -> 3.15.0

ReleaseNotes: https://docs.python.org/3/whatsnew/changelog.html#python-3-15-0-final

- Drop patches which are part of upstream release
- 0001-gh-146207-Add-support-for-OpenSSL-4.0.0.patch
- 0002-gh-148292-Update-_ssl._SSLSocket-for-OpenSSL-4.patch
- 0003-gh-148292-Remove-shutdown-test-in-test_ssl.test_got_eof.patch
- valid-dists.patch
- Add mpdecimal dependency and --with-system-libmpdec configure option
- Bump PYTHON_BASEVERSION to 3.15 in python3-dir.bbclass
- Update python3-manifest
- Refresh existing patches

---
Changes since v1:
- Update python3-manifest

 meta/classes-recipe/python3-dir.bbclass       |   2 +-
 ...shebang-overflow-on-python-config.py.patch |   2 +-
 ...e-stdin-I-O-errors-same-way-as-maste.patch |   2 +-
 ...-use-prefix-value-from-build-configu.patch |   2 +-
 ...-qemu-wrapper-when-gathering-profile.patch |   2 +-
 ...est_sysconfig-for-posix_user-purelib.patch |   2 +-
 ...146207-Add-support-for-OpenSSL-4.0.0.patch | 257 ------------------
 .../0001-prefer-valid-entrypoints.patch       |   2 +-
 ...g.py-use-platlibdir-also-for-purelib.patch |   2 +-
 ...le.py-correct-the-test-output-format.patch |   2 +-
 ...Update-_ssl._SSLSocket-for-OpenSSL-4.patch | 234 ----------------
 ...utdown-test-in-test_ssl.test_got_eof.patch |  41 ---
 .../python/python3/makerace.patch             |   2 +-
 .../python/python3/python3-manifest.json      | 199 +++++---------
 .../python/python3/valid-dists.patch          | 164 -----------
 .../{python3_3.14.7.bb => python3_3.15.0.bb}  |  11 +-
 16 files changed, 87 insertions(+), 839 deletions(-)
 delete mode 100644 meta/recipes-devtools/python/python3/0001-gh-146207-Add-support-for-OpenSSL-4.0.0.patch
 delete mode 100644 meta/recipes-devtools/python/python3/0002-gh-148292-Update-_ssl._SSLSocket-for-OpenSSL-4.patch
 delete mode 100644 meta/recipes-devtools/python/python3/0003-gh-148292-Remove-shutdown-test-in-test_ssl.test_got_eof.patch
 delete mode 100644 meta/recipes-devtools/python/python3/valid-dists.patch
 rename meta/recipes-devtools/python/{python3_3.14.7.bb => python3_3.15.0.bb} (98%)
meta/classes-recipe/python3-dir.bbclass +1 -1
index 3eb0dea9b2..b26621f365 100644
@@ -4,7 +4,7 @@
 # SPDX-License-Identifier: MIT
 #
 
-PYTHON_BASEVERSION = "3.14"
+PYTHON_BASEVERSION = "3.15"
 PYTHON_ABI = ""
 PYTHON_DIR = "python${PYTHON_BASEVERSION}"
 PYTHON_PN = "python3"
meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch +1 -1
index 7a60538364..47ac29f209 100644
@@ -1,4 +1,4 @@
-From 3f2df0e1fce8c7425998dade00d084f1b101a982 Mon Sep 17 00:00:00 2001
+From b19edb306e2c035536a904c82c2fb4b18f529cf2 Mon Sep 17 00:00:00 2001
 From: Paulo Neves <[email protected]>
 Date: Tue, 7 Jun 2022 16:16:41 +0200
 Subject: [PATCH] Avoid shebang overflow on python-config.py
meta/recipes-devtools/python/python3/0001-Lib-pty.py-handle-stdin-I-O-errors-same-way-as-maste.patch +1 -1
index 532adfe69a..cc2fdf4bb8 100644
@@ -1,4 +1,4 @@
-From 9cd44429215352eb2753e0fd8e25fef24f714006 Mon Sep 17 00:00:00 2001
+From cb744d2ccf74d5ef21fa496a418d2963df28a38f Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <[email protected]>
 Date: Thu, 16 Sep 2021 16:35:37 +0200
 Subject: [PATCH] Lib/pty.py: handle stdin I/O errors same way as master I/O
meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-use-prefix-value-from-build-configu.patch +1 -1
index 60391e726b..0fce0fc027 100644
@@ -1,4 +1,4 @@
-From b5aad6a9b6c5add7a85861aed8aa030c1ad3d52f Mon Sep 17 00:00:00 2001
+From 5bd6a3c5f957cacdf51e07ae94c74fbf6e7f0f28 Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <[email protected]>
 Date: Fri, 17 Nov 2023 14:26:32 +0100
 Subject: [PATCH] Lib/sysconfig.py: use prefix value from build configuration
meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch +1 -1
index c7f14cad1e..d83d00e0cf 100644
@@ -1,4 +1,4 @@
-From d6f77e3a934616d1f6c083b7144c50a32e08b70a Mon Sep 17 00:00:00 2001
+From 64a42f1a618be7af4e5d31ffbeeb4169bad865a9 Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <[email protected]>
 Date: Wed, 30 Jan 2019 12:41:04 +0100
 Subject: [PATCH] Makefile.pre: use qemu wrapper when gathering profile data
meta/recipes-devtools/python/python3/0001-Update-test_sysconfig-for-posix_user-purelib.patch +1 -1
index 5509b7475a..95d7e4bd07 100644
@@ -1,4 +1,4 @@
-From c608cb4b3c8c31f1aa25ad1264ff58733fb99769 Mon Sep 17 00:00:00 2001
+From 2cca08e2cb4be0a725c4c9ea76234bfea5a8534c Mon Sep 17 00:00:00 2001
 From: Wentao Zhang <[email protected]>
 Date: Mon, 20 Mar 2023 13:39:52 +0800
 Subject: [PATCH] Update test_sysconfig for posix_user purelib
meta/recipes-devtools/python/python3/0001-gh-146207-Add-support-for-OpenSSL-4.0.0.patch deleted +0 -257

257 lines not on this page · raw message

meta/recipes-devtools/python/python3/0001-prefer-valid-entrypoints.patch +1 -1
index ae3698fac4..030f82f99b 100644
@@ -1,4 +1,4 @@
-From 8d7fcf04c6513841c7985e64b746b1ef5de0c426 Mon Sep 17 00:00:00 2001
+From 8889d373f2218253555d69b9ad022f52bc4ad78d Mon Sep 17 00:00:00 2001
 From: Ross Burton <[email protected]>
 Date: Fri, 17 Apr 2026 16:53:42 +0100
 Subject: [PATCH] prefer valid entrypoints
meta/recipes-devtools/python/python3/0001-sysconfig.py-use-platlibdir-also-for-purelib.patch +1 -1
index 7807827d9a..3ac97d348b 100644
@@ -1,4 +1,4 @@
-From c10d1b295a9fb93836830cce441da3f22e5c7cd7 Mon Sep 17 00:00:00 2001
+From 31ca770452781c56c19b98e584db3bc964116b44 Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <[email protected]>
 Date: Sun, 12 Sep 2021 21:44:36 +0200
 Subject: [PATCH] sysconfig.py: use platlibdir also for purelib
meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch +1 -1
index a60d082e2f..8e72a374d9 100644
@@ -1,4 +1,4 @@
-From f0ac5b479b99bfb7f5e937a941b31a596f4caafc Mon Sep 17 00:00:00 2001
+From a712d1ebb55ac8e5801a5c2179945ce26638a548 Mon Sep 17 00:00:00 2001
 From: Mingli Yu <[email protected]>
 Date: Mon, 5 Aug 2019 15:57:39 +0800
 Subject: [PATCH] test_locale.py: correct the test output format
meta/recipes-devtools/python/python3/0002-gh-148292-Update-_ssl._SSLSocket-for-OpenSSL-4.patch deleted +0 -234

234 lines not on this page · raw message

meta/recipes-devtools/python/python3/0003-gh-148292-Remove-shutdown-test-in-test_ssl.test_got_eof.patch deleted +0 -41

41 lines not on this page · raw message

meta/recipes-devtools/python/python3/makerace.patch +1 -1
index 248a521118..c6c01332ce 100644
@@ -1,4 +1,4 @@
-From b41557f570ff4451c477669d6ca5bfacabe21c66 Mon Sep 17 00:00:00 2001
+From 7b796f0e8953a9c9e9402c8c60eccc19a33874a9 Mon Sep 17 00:00:00 2001
 From: Richard Purdie <[email protected]>
 Date: Tue, 13 Jul 2021 23:19:29 +0100
 Subject: [PATCH] python3: Fix make race
meta/recipes-devtools/python/python3/python3-manifest.json +73 -126

470 lines not on this page · raw message

meta/recipes-devtools/python/python3/valid-dists.patch deleted +0 -164

164 lines not on this page · raw message

meta/recipes-devtools/python/python3_3.15.0.bb renamed from meta/recipes-devtools/python/python3_3.14.7.bb +4 -7
similarity index 98%
rename from meta/recipes-devtools/python/python3_3.14.7.bb
rename to meta/recipes-devtools/python/python3_3.15.0.bb
index f917edebd8..71a2973e20 100644
@@ -18,19 +18,15 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
            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://valid-dists.patch \
            file://0001-Avoid-shebang-overflow-on-python-config.py.patch \
            file://0001-Update-test_sysconfig-for-posix_user-purelib.patch \
            file://0001-prefer-valid-entrypoints.patch \
-           file://0001-gh-146207-Add-support-for-OpenSSL-4.0.0.patch \
-           file://0002-gh-148292-Update-_ssl._SSLSocket-for-OpenSSL-4.patch \
-           file://0003-gh-148292-Remove-shutdown-test-in-test_ssl.test_got_eof.patch \
            "
 SRC_URI:append:class-native = " \
            file://0001-Lib-sysconfig.py-use-prefix-value-from-build-configu.patch \
            "
 
-SRC_URI[sha256sum] = "3b48dac8fb59f62eaa67ac83c1eb12bda1b7a08406dd286e252c11a66be27f81"
+SRC_URI[sha256sum] = "ba4bed1ba346b916890b76d9e320451420aa69f6408997d33c66482eeae3d575"
 
 # exclude pre-releases for both python 2.x and 3.x
 UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
@@ -41,7 +37,7 @@ inherit upstream-stable-release-point
 
 CVE_PRODUCT = "python:python python_software_foundation:python cpython"
 
-PYTHON_MAJMIN = "3.14"
+PYTHON_MAJMIN = "3.15"
 
 S = "${UNPACKDIR}/Python-${PV}"
 
@@ -61,6 +57,7 @@ DEPENDS = "\
     bzip2-replacement-native \
     expat \
     libffi \
+    mpdecimal \
     ncurses \
     openssl \
     sqlite3 \
@@ -75,7 +72,7 @@ DEPENDS = "\
 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 = " --without-ensurepip --enable-shared --with-platlibdir=${baselib} --with-system-expat --with-system-libmpdec"
 EXTRA_OECONF:append:class-native = " --bindir=${bindir}/${PN}"
 EXTRA_OECONF:append:class-target = " --with-build-python=nativepython3 PLATFORM_TRIPLET=${HOST_ARCH}-${HOST_OS}"
 EXTRA_OECONF:append:class-nativesdk = " --with-build-python=nativepython3"
#2 lore raw

Re: [OE-core] [PATCH v2 2/2] python3: upgrade 3.14.7 -> 3.15.0

Quoted 12 lines · Jaipaul Cheernam

ReleaseNotes: https://docs.python.org/3/whatsnew/changelog.html#python-3-15-0-final

- Drop patches which are part of upstream release
- 0001-gh-146207-Add-support-for-OpenSSL-4.0.0.patch
- 0002-gh-148292-Update-_ssl._SSLSocket-for-OpenSSL-4.patch
- 0003-gh-148292-Remove-shutdown-test-in-test_ssl.test_got_eof.patch
- valid-dists.patch
- Add mpdecimal dependency and --with-system-libmpdec configure option
- Bump PYTHON_BASEVERSION to 3.15 in python3-dir.bbclass
- Update python3-manifest
- Refresh existing patches

Quoted 2 lines

---

Hi Jaipaul,

Thanks for the upgrade, but this is failing in various ways.

First, some builds are failing, probably musl related:

ERROR: python3-3.15.0-r0 do_compile: oe_runmake failed
...

| aarch64-poky-linux-musl-gcc  -mcpu=cortex-a57+crc -mbranch-protection=standard -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/srv/pokybuild/yocto-worker/qemuarm64-musl-ptest/build/build/tmp/work/cortexa57-poky-linux-musl/python3/3.15.0/recipe-sysroot -shared -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now    Modules/_ctypes/_ctypes_test.o -lm  -o Modules/_ctypes_test.cpython-315-aarch64-linux-musl.so
| aarch64-poky-linux-musl-gcc  -mcpu=cortex-a57+crc -mbranch-protection=standard -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/srv/pokybuild/yocto-worker/qemuarm64-musl-ptest/build/build/tmp/work/cortexa57-poky-linux-musl/python3/3.15.0/recipe-sysroot -shared -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now    Modules/_testinternalcapi.o Modules/_testinternalcapi/test_lock.o Modules/_testinternalcapi/pytime.o Modules/_testinternalcapi/set.o Modules/_testinternalcapi/test_critical_sections.o Modules/_testinternalcapi/complex.o Modules/_testinternalcapi/interpreter.o Modules/_testinternalcapi/tuple.o   -o Modules/_testinternalcapi.cpython-315-aarch64-linux-musl.so
| nativepython3: error while loading shared libraries: libc.so: cannot open shared object file: No such file or directory
| make: *** [Makefile:1796: checksharedmods] Error 127

https://autobuilder.yoctoproject.org/valkyrie/#/builders/109/builds/1368
https://autobuilder.yoctoproject.org/valkyrie/#/builders/110/builds/1355

Then, when build succeeds, some test is failing:

RESULTS - maturin.MaturinTest.test_maturin_list_python: FAILED (3.41s)
...
Testing 'maturin develop' requires Rust cross-canadian in the SDK
Testing 'maturin develop' requires Rust cross-canadian in the SDK
Traceback (most recent call last):
File "/srv/pokybuild/yocto-worker/qemuarmv5/build/layers/openembedded-core/meta/lib/oeqa/sdk/cases/maturin.py", line 30, in test_maturin_list_python

    self.assertIn(expected, output)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^

AssertionError: '3.15 at /srv/pokybuild/yocto-worker/qemuarmv5/build/build/tmp/work/qemuarmv5-poky-linux-gnueabi/core-image-minimal/1.0/testsdkext/buildtools/sysroots/x86_64-pokysdk-linux/usr/bin/python3' not found in '🐍 2 python interpreter found:\n - CPython 3.11 at /srv/pokybuild/buildbot-venv/bin/python3.11\n - CPython 3.13 at /srv/pokybuild/yocto-worker/qemuarmv5/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/bin/python3.13\n'

https://autobuilder.yoctoproject.org/valkyrie/#/builders/80/builds/4646
https://autobuilder.yoctoproject.org/valkyrie/#/builders/36/builds/4817
https://autobuilder.yoctoproject.org/valkyrie/#/builders/30/builds/4825

Also, I'm adding back a link to the issues we had with 3.14.8 upgrade. Some ptests were failing while building with musl. This might be fixed by upstream, but it might be worth checking:
https://lore.kernel.org/openembedded-core/[email protected]/

Thanks,
Mathieu

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com