summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorTim Orling <ticotimo@gmail.com>2021-10-20 18:57:24 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-10-23 17:41:46 +0100
commitf6fb99c53f779966fc902a629d0a8bbd9f84c6be (patch)
treed8b070e68113b34044b5a0bd6b111c7b62d60c7a /meta/recipes-devtools
parent3d579fb7e4eb96fe0e20e2a7a5948940ca086f99 (diff)
downloadopenembedded-core-f6fb99c53f779966fc902a629d0a8bbd9f84c6be.tar.gz
python3-setuptools: _distutils/sysconfig fix
Add patch to append STAGING_LIBDIR python-sysconfigdata to sys.path so that packages which set SETUPTOOLS_USE_DISUTILS='local' cross-compile properly with python3-setuptools-native. Fixes: ModuleNotFoundError: No module named '_sysconfigdata' References: https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html#porting-from-distutils Signed-off-by: Tim Orling <timothy.t.orling@intel.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/python/python3-setuptools/0001-_distutils-sysconfig-append-STAGING_LIBDIR-python-sy.patch34
-rw-r--r--meta/recipes-devtools/python/python3-setuptools_58.2.0.bb5
2 files changed, 38 insertions, 1 deletions
diff --git a/meta/recipes-devtools/python/python3-setuptools/0001-_distutils-sysconfig-append-STAGING_LIBDIR-python-sy.patch b/meta/recipes-devtools/python/python3-setuptools/0001-_distutils-sysconfig-append-STAGING_LIBDIR-python-sy.patch
new file mode 100644
index 0000000000..565cf8ae8d
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-setuptools/0001-_distutils-sysconfig-append-STAGING_LIBDIR-python-sy.patch
@@ -0,0 +1,34 @@
+From 44349672cbff8945693c8d2821c82e9f04bfc8b5 Mon Sep 17 00:00:00 2001
+From: Tim Orling <timothy.t.orling@intel.com>
+Date: Wed, 20 Oct 2021 17:38:10 +0000
+Subject: [PATCH] _distutils/sysconfig: append
+ STAGING_LIBDIR/python-sysconfigdata to sys.path
+
+When python modules set SETUPTOOLS_USE_DISTULS='local', this uses the
+vendored _distutils in setuptools rather than distutils in the Standard
+Library. This is needed so that target configuration can be used with
+python3-setuptools-native.
+
+Based on python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch
+from Alex Kanavin <alex.kanavin@gmail.com>
+
+Upstream-Status: Inappropriate [oe-specific]
+
+Signed-off-by: Tim Orling <timothy.t.orling@intel.com>
+---
+ setuptools/_distutils/sysconfig.py | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/setuptools/_distutils/sysconfig.py b/setuptools/_distutils/sysconfig.py
+index 8832b3e..bbc7c08 100644
+--- a/setuptools/_distutils/sysconfig.py
++++ b/setuptools/_distutils/sysconfig.py
+@@ -461,6 +461,8 @@ def _init_posix():
+ platform=sys.platform,
+ multiarch=getattr(sys.implementation, '_multiarch', ''),
+ ))
++ if 'STAGING_LIBDIR' in os.environ:
++ sys.path.append(os.environ['STAGING_LIBDIR']+'/python-sysconfigdata')
+ try:
+ _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
+ except ImportError:
diff --git a/meta/recipes-devtools/python/python3-setuptools_58.2.0.bb b/meta/recipes-devtools/python/python3-setuptools_58.2.0.bb
index 0a05ac6079..b37c44854c 100644
--- a/meta/recipes-devtools/python/python3-setuptools_58.2.0.bb
+++ b/meta/recipes-devtools/python/python3-setuptools_58.2.0.bb
@@ -8,7 +8,10 @@ inherit pypi setuptools3
SRC_URI:append:class-native = " file://0001-conditionally-do-not-fetch-code-by-easy_install.patch"
-SRC_URI += "file://0001-change-shebang-to-python3.patch"
+SRC_URI += "\
+ file://0001-change-shebang-to-python3.patch \
+ file://0001-_distutils-sysconfig-append-STAGING_LIBDIR-python-sy.patch \
+"
SRC_URI[sha256sum] = "2c55bdb85d5bb460bd2e3b12052b677879cffcf46c0c688f2e5bf51d36001145"