]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
python: Skip NODEV portion of test_makedev when linked to musl
authorKhem Raj <raj.khem@gmail.com>
Tue, 9 Sep 2025 19:49:52 +0000 (12:49 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 11 Sep 2025 09:45:08 +0000 (10:45 +0100)
backport the upstreamed patch which is available in 3.14+

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/python/python3/0001-gh-90548-Skip-NODEV-portion-of-test_makedev-when-lin.patch [new file with mode: 0644]
meta/recipes-devtools/python/python3/test_posix_nodev_disable.patch [deleted file]
meta/recipes-devtools/python/python3_3.13.7.bb

diff --git a/meta/recipes-devtools/python/python3/0001-gh-90548-Skip-NODEV-portion-of-test_makedev-when-lin.patch b/meta/recipes-devtools/python/python3/0001-gh-90548-Skip-NODEV-portion-of-test_makedev-when-lin.patch
new file mode 100644 (file)
index 0000000..4390e08
--- /dev/null
@@ -0,0 +1,24 @@
+From 2dc5e9f4c82888dbe21bd1eadb4b59b0efa9608c Mon Sep 17 00:00:00 2001
+From: Zachary Ware <zach@python.org>
+Date: Sat, 6 Sep 2025 13:20:12 -0500
+Subject: [PATCH] gh-90548: Skip NODEV portion of test_makedev when linked to musl
+
+Upstream-Status: Backport [https://github.com/python/cpython/pull/138593]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Lib/test/test_posix.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
+index c9cbe15..bfc1e2b 100644
+--- a/Lib/test/test_posix.py
++++ b/Lib/test/test_posix.py
+@@ -757,7 +757,7 @@ class PosixTester(unittest.TestCase):
+             self.assertRaises((ValueError, OverflowError), posix.makedev, x, minor)
+             self.assertRaises((ValueError, OverflowError), posix.makedev, major, x)
+-        if sys.platform == 'linux':
++        if sys.platform == 'linux' and not support.linked_to_musl():
+             NODEV = -1
+             self.assertEqual(posix.major(NODEV), NODEV)
+             self.assertEqual(posix.minor(NODEV), NODEV)
diff --git a/meta/recipes-devtools/python/python3/test_posix_nodev_disable.patch b/meta/recipes-devtools/python/python3/test_posix_nodev_disable.patch
deleted file mode 100644 (file)
index 85767e1..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-Disable part of test_posix.test_makedev that depends on the NODEV
-macro being defined (missing on musl).
-
-Upstream-Status: Submitted [https://github.com/python/cpython/pull/31794]
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
---- a/Lib/test/test_posix.py
-+++ b/Lib/test/test_posix.py
-@@ -757,7 +757,7 @@ class PosixTester(unittest.TestCase):
-             self.assertRaises((ValueError, OverflowError), posix.makedev, x, minor)
-             self.assertRaises((ValueError, OverflowError), posix.makedev, major, x)
--        if sys.platform == 'linux':
-+        if False:
-             NODEV = -1
-             self.assertEqual(posix.major(NODEV), NODEV)
-             self.assertEqual(posix.minor(NODEV), NODEV)
index a42b2c2a2d2455d2795aa53ba632c22e8f313faa..c682f1288ec9a97b8c8bc79289c65aabb3c5a887 100644 (file)
@@ -30,9 +30,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
            file://0001-test_active_children-skip-problematic-test.patch \
            file://0001-test_readline-skip-limited-history-test.patch \
            file://0001-Generate-data-for-OpenSSL-3.4-and-add-it-to-multissl.patch \
-           "
-SRC_URI:append:libc-musl = "\
-           file://test_posix_nodev_disable.patch \
+           file://0001-gh-90548-Skip-NODEV-portion-of-test_makedev-when-lin.patch \
            "
 SRC_URI:append:class-native = " \
            file://0001-Lib-sysconfig.py-use-prefix-value-from-build-configu.patch \