diff options
| author | Tim Orling <ticotimo@gmail.com> | 2021-10-20 18:57:24 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-11-08 23:40:59 +0000 |
| commit | d74def94da2147c6d0aa858dd5bda153c57e784c (patch) | |
| tree | db06997ac2b0e2dd064113dd1259731b98689084 | |
| parent | 907ca04187b15401dcc9e9f4a7a31e9491658563 (diff) | |
| download | poky-d74def94da2147c6d0aa858dd5bda153c57e784c.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
(From OE-Core rev: 2f9a362bfebc83ea6459b5294a6fab3c77ea6cb2)
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>
(cherry picked from commit f6fb99c53f779966fc902a629d0a8bbd9f84c6be)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-devtools/python/python3-setuptools/0001-_distutils-sysconfig-append-STAGING_LIBDIR-python-sy.patch | 34 | ||||
| -rw-r--r-- | meta/recipes-devtools/python/python3-setuptools_57.4.0.bb | 5 |
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 @@ | |||
| 1 | From 44349672cbff8945693c8d2821c82e9f04bfc8b5 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Tim Orling <timothy.t.orling@intel.com> | ||
| 3 | Date: Wed, 20 Oct 2021 17:38:10 +0000 | ||
| 4 | Subject: [PATCH] _distutils/sysconfig: append | ||
| 5 | STAGING_LIBDIR/python-sysconfigdata to sys.path | ||
| 6 | |||
| 7 | When python modules set SETUPTOOLS_USE_DISTULS='local', this uses the | ||
| 8 | vendored _distutils in setuptools rather than distutils in the Standard | ||
| 9 | Library. This is needed so that target configuration can be used with | ||
| 10 | python3-setuptools-native. | ||
| 11 | |||
| 12 | Based on python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch | ||
| 13 | from Alex Kanavin <alex.kanavin@gmail.com> | ||
| 14 | |||
| 15 | Upstream-Status: Inappropriate [oe-specific] | ||
| 16 | |||
| 17 | Signed-off-by: Tim Orling <timothy.t.orling@intel.com> | ||
| 18 | --- | ||
| 19 | setuptools/_distutils/sysconfig.py | 2 ++ | ||
| 20 | 1 file changed, 2 insertions(+) | ||
| 21 | |||
| 22 | diff --git a/setuptools/_distutils/sysconfig.py b/setuptools/_distutils/sysconfig.py | ||
| 23 | index 8832b3e..bbc7c08 100644 | ||
| 24 | --- a/setuptools/_distutils/sysconfig.py | ||
| 25 | +++ b/setuptools/_distutils/sysconfig.py | ||
| 26 | @@ -461,6 +461,8 @@ def _init_posix(): | ||
| 27 | platform=sys.platform, | ||
| 28 | multiarch=getattr(sys.implementation, '_multiarch', ''), | ||
| 29 | )) | ||
| 30 | + if 'STAGING_LIBDIR' in os.environ: | ||
| 31 | + sys.path.append(os.environ['STAGING_LIBDIR']+'/python-sysconfigdata') | ||
| 32 | try: | ||
| 33 | _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0) | ||
| 34 | except ImportError: | ||
diff --git a/meta/recipes-devtools/python/python3-setuptools_57.4.0.bb b/meta/recipes-devtools/python/python3-setuptools_57.4.0.bb index ae45936c39..fcf20e9efd 100644 --- a/meta/recipes-devtools/python/python3-setuptools_57.4.0.bb +++ b/meta/recipes-devtools/python/python3-setuptools_57.4.0.bb | |||
| @@ -8,7 +8,10 @@ inherit pypi setuptools3 | |||
| 8 | 8 | ||
| 9 | SRC_URI:append:class-native = " file://0001-conditionally-do-not-fetch-code-by-easy_install.patch" | 9 | SRC_URI:append:class-native = " file://0001-conditionally-do-not-fetch-code-by-easy_install.patch" |
| 10 | 10 | ||
| 11 | SRC_URI += "file://0001-change-shebang-to-python3.patch" | 11 | SRC_URI += "\ |
| 12 | file://0001-change-shebang-to-python3.patch \ | ||
| 13 | file://0001-_distutils-sysconfig-append-STAGING_LIBDIR-python-sy.patch \ | ||
| 14 | " | ||
| 12 | 15 | ||
| 13 | SRC_URI[sha256sum] = "6bac238ffdf24e8806c61440e755192470352850f3419a52f26ffe0a1a64f465" | 16 | SRC_URI[sha256sum] = "6bac238ffdf24e8806c61440e755192470352850f3419a52f26ffe0a1a64f465" |
| 14 | 17 | ||
