]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
python3: Fix failing sysconfig.py test on x86(64 bit) using lib64 as baselib by updat...
authorWentao Zhang <wentao.zhang@windriver.com>
Mon, 27 Mar 2023 09:31:45 +0000 (17:31 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 3 Apr 2023 10:39:48 +0000 (11:39 +0100)
Steps to trigger the failed test:
Edit local.conf to add something as follows:
    BASELIB = "lib64"
    IMAGE_INSTALL:append = " python3-tests".
bitbake core-image-sato
runqemu qemux86-64 nographic slirp
Reproducer:
    $python3 -m test test_sysconfig

sysconfig.py use platlibdir for purelib. Update
test_sysconfig.test_user_similar() for the posix_user
scheme: "purelib" doesn't use sys.platlibdir.

Signed-off-by: Wentao Zhang <wentao.zhang@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
meta/recipes-devtools/python/python3/0001-Update-test_sysconfig-for-posix_user-purelib.patch [new file with mode: 0644]
meta/recipes-devtools/python/python3_3.11.2.bb

diff --git a/meta/recipes-devtools/python/python3/0001-Update-test_sysconfig-for-posix_user-purelib.patch b/meta/recipes-devtools/python/python3/0001-Update-test_sysconfig-for-posix_user-purelib.patch
new file mode 100644 (file)
index 0000000..5e11341
--- /dev/null
@@ -0,0 +1,39 @@
+From b9f825b298b555c4770024d1f68ef1df65aad20a Mon Sep 17 00:00:00 2001
+From: Wentao Zhang <wentao.zhang@windriver.com>
+Date: Mon, 20 Mar 2023 13:39:52 +0800
+Subject: [PATCH] Update test_sysconfig for posix_user purelib
+
+Steps to trigger the failed test:
+Edit local.conf to add something as follows:
+    BASELIB = "lib64"
+    IMAGE_INSTALL:append = " python3-tests".
+bitbake core-image-sato
+runqemu qemux86-64 nographic slirp
+Reproducer:
+    $python3 -m test test_sysconfig
+
+Update test_sysconfig.test_user_similar() for the posix_user scheme:
+"purelib" doesn't use sys.platlibdir.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Wentao Zhang <wentao.zhang@windriver.com>
+---
+ Lib/test/test_sysconfig.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py
+index d96371d..20aea4b 100644
+--- a/Lib/test/test_sysconfig.py
++++ b/Lib/test/test_sysconfig.py
+@@ -373,7 +373,7 @@ class TestSysConfig(unittest.TestCase):
+                 expected = os.path.normpath(global_path.replace(base, user, 1))
+                 # bpo-44860: platlib of posix_user doesn't use sys.platlibdir,
+                 # whereas posix_prefix does.
+-                if name == 'platlib':
++                if name == 'platlib' or name == 'purelib':
+                     # Replace "/lib64/python3.11/site-packages" suffix
+                     # with "/lib/python3.11/site-packages".
+                     py_version_short = sysconfig.get_python_version()
+-- 
+2.25.1
+
index 5060722beb9983a77b65fffbbf9761c6ad19203f..5bd8d32b140704662e502a3a15cac5c5f8e693b0 100644 (file)
@@ -31,6 +31,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
            file://0001-setup.py-Do-not-detect-multiarch-paths-when-cross-co.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 \
            "
 
 SRC_URI:append:class-native = " \