diff options
Diffstat (limited to 'meta/recipes-devtools/python/python3')
42 files changed, 860 insertions, 1275 deletions
diff --git a/meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch b/meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch new file mode 100644 index 0000000000..0d807db39f --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch @@ -0,0 +1,30 @@ +From 365399f17d35719d828ddd49182dcb401fb7791c Mon Sep 17 00:00:00 2001 +From: Paulo Neves <ptsneves@gmail.com> +Date: Tue, 7 Jun 2022 16:16:41 +0200 +Subject: [PATCH] Avoid shebang overflow on python-config.py + +The whole native path may be too big, leading to shebang +overflow. Let's just use the env shebang. + +Denial reason: [1] + +Upstream-Status: Denied [distribution] + +[1] https://github.com/python/cpython/pull/93760#pullrequestreview-1005365737 +--- + Makefile.pre.in | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 77bf09a..6353c57 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -2339,6 +2339,8 @@ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh + @ # Substitution happens here, as the completely-expanded BINDIR + @ # is not available in configure + sed -e "s,@EXENAME@,$(EXENAME)," < $(srcdir)/Misc/python-config.in >python-config.py ++ @ # Otherwise we might get huge shebangs with native paths ++ sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' python-config.py + @ # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR} + LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config + @ # On Darwin, always use the python version of the script, the shell diff --git a/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch b/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch deleted file mode 100644 index 59592821d7..0000000000 --- a/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 039c53dd5baddec3359a05be0bff46a3b32bbb84 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Fri, 25 Jan 2019 19:04:13 +0100 -Subject: [PATCH] Do not add /usr/lib/termcap to linker flags to avoid host - contamination - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - ---- - setup.py | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/setup.py b/setup.py -index 20d7f35..ab18ff0 100644 ---- a/setup.py -+++ b/setup.py -@@ -957,7 +957,6 @@ class PyBuildExt(build_ext): - 'termcap'): - readline_libs.append('termcap') - self.add(Extension('readline', ['readline.c'], -- library_dirs=['/usr/lib/termcap'], - extra_link_args=readline_extra_link_args, - libraries=readline_libs)) - else: diff --git a/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch b/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch deleted file mode 100644 index 112c979441..0000000000 --- a/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch +++ /dev/null @@ -1,214 +0,0 @@ -From a078b6ff1492e848ad1055764fb9a414abaf3e12 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Tue, 5 Feb 2019 15:52:02 +0100 -Subject: [PATCH] Do not hardcode "lib" as location for modules, site-packages - and lib-dynload - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - ---- - Include/pythonrun.h | 2 ++ - Lib/site.py | 4 ++-- - Makefile.pre.in | 5 +++-- - Modules/getpath.c | 22 ++++++++++++++-------- - Python/getplatform.c | 10 ++++++++++ - Python/sysmodule.c | 2 ++ - 6 files changed, 33 insertions(+), 12 deletions(-) - -diff --git a/Include/pythonrun.h b/Include/pythonrun.h -index 46091e0..61b2e15 100644 ---- a/Include/pythonrun.h -+++ b/Include/pythonrun.h -@@ -7,6 +7,8 @@ - extern "C" { - #endif - -+PyAPI_FUNC(const char *) Py_GetLib(void); -+ - #ifndef Py_LIMITED_API - PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *); - PyAPI_FUNC(int) PyRun_AnyFileExFlags( -diff --git a/Lib/site.py b/Lib/site.py -index a065ab0..1d720ef 100644 ---- a/Lib/site.py -+++ b/Lib/site.py -@@ -335,12 +335,12 @@ def getsitepackages(prefixes=None): - seen.add(prefix) - - if os.sep == '/': -- sitepackages.append(os.path.join(prefix, "lib", -+ sitepackages.append(os.path.join(prefix, sys.lib, - "python%d.%d" % sys.version_info[:2], - "site-packages")) - else: - sitepackages.append(prefix) -- sitepackages.append(os.path.join(prefix, "lib", "site-packages")) -+ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages")) - return sitepackages - - def addsitepackages(known_paths, prefixes=None): -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 65665df..be49140 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -143,7 +143,7 @@ LIBDIR= @libdir@ - MANDIR= @mandir@ - INCLUDEDIR= @includedir@ - CONFINCLUDEDIR= $(exec_prefix)/include --SCRIPTDIR= $(prefix)/lib -+SCRIPTDIR= @libdir@ - ABIFLAGS= @ABIFLAGS@ - - # Detailed destination directories -@@ -753,6 +753,7 @@ Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile - -DEXEC_PREFIX='"$(exec_prefix)"' \ - -DVERSION='"$(VERSION)"' \ - -DVPATH='"$(VPATH)"' \ -+ -DLIB='"$(LIB)"' \ - -o $@ $(srcdir)/Modules/getpath.c - - Programs/python.o: $(srcdir)/Programs/python.c -@@ -868,7 +869,7 @@ regen-symbol: $(srcdir)/Include/graminit.h - Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o Python/future.o Parser/parsetok.o: $(srcdir)/Include/graminit.h $(srcdir)/Include/Python-ast.h - - Python/getplatform.o: $(srcdir)/Python/getplatform.c -- $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c -+ $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c - - Python/importdl.o: $(srcdir)/Python/importdl.c - $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c -diff --git a/Modules/getpath.c b/Modules/getpath.c -index b727f66..c003e46 100644 ---- a/Modules/getpath.c -+++ b/Modules/getpath.c -@@ -128,6 +128,7 @@ typedef struct { - wchar_t *exec_prefix; /* EXEC_PREFIX macro */ - - wchar_t *lib_python; /* "lib/pythonX.Y" */ -+ wchar_t *multilib_python; /* "lib[suffix]/pythonX.Y" */ - - int prefix_found; /* found platform independent libraries? */ - int exec_prefix_found; /* found the platform dependent libraries? */ -@@ -386,7 +387,7 @@ search_for_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig, - if (delim) { - *delim = L'\0'; - } -- status = joinpath(prefix, calculate->lib_python, prefix_len); -+ status = joinpath(prefix, calculate->multilib_python, prefix_len); - if (_PyStatus_EXCEPTION(status)) { - return status; - } -@@ -444,7 +445,7 @@ search_for_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig, - do { - /* Path: <argv0_path or substring> / <lib_python> / LANDMARK */ - size_t n = wcslen(prefix); -- status = joinpath(prefix, calculate->lib_python, prefix_len); -+ status = joinpath(prefix, calculate->multilib_python, prefix_len); - if (_PyStatus_EXCEPTION(status)) { - return status; - } -@@ -467,7 +468,7 @@ search_for_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig, - if (safe_wcscpy(prefix, calculate->prefix, prefix_len) < 0) { - return PATHLEN_ERR(); - } -- status = joinpath(prefix, calculate->lib_python, prefix_len); -+ status = joinpath(prefix, calculate->multilib_python, prefix_len); - if (_PyStatus_EXCEPTION(status)) { - return status; - } -@@ -510,7 +511,7 @@ calculate_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig, - if (safe_wcscpy(prefix, calculate->prefix, prefix_len) < 0) { - return PATHLEN_ERR(); - } -- status = joinpath(prefix, calculate->lib_python, prefix_len); -+ status = joinpath(prefix, calculate->multilib_python, prefix_len); - if (_PyStatus_EXCEPTION(status)) { - return status; - } -@@ -635,7 +636,7 @@ search_for_exec_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig, - return PATHLEN_ERR(); - } - } -- status = joinpath(exec_prefix, calculate->lib_python, exec_prefix_len); -+ status = joinpath(exec_prefix, calculate->multilib_python, exec_prefix_len); - if (_PyStatus_EXCEPTION(status)) { - return status; - } -@@ -667,7 +668,7 @@ search_for_exec_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig, - do { - /* Path: <argv0_path or substring> / <lib_python> / "lib-dynload" */ - size_t n = wcslen(exec_prefix); -- status = joinpath(exec_prefix, calculate->lib_python, exec_prefix_len); -+ status = joinpath(exec_prefix, calculate->multilib_python, exec_prefix_len); - if (_PyStatus_EXCEPTION(status)) { - return status; - } -@@ -689,7 +690,7 @@ search_for_exec_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig, - if (safe_wcscpy(exec_prefix, calculate->exec_prefix, exec_prefix_len) < 0) { - return PATHLEN_ERR(); - } -- status = joinpath(exec_prefix, calculate->lib_python, exec_prefix_len); -+ status = joinpath(exec_prefix, calculate->multilib_python, exec_prefix_len); - if (_PyStatus_EXCEPTION(status)) { - return status; - } -@@ -928,7 +929,7 @@ calculate_argv0_path(PyCalculatePath *calculate, const wchar_t *program_full_pat - return PATHLEN_ERR(); - } - reduce(argv0_path); -- status = joinpath(argv0_path, calculate->lib_python, argv0_path_len); -+ status = joinpath(argv0_path, calculate->multilib_python, argv0_path_len); - if (_PyStatus_EXCEPTION(status)) { - PyMem_RawFree(wbuf); - return status; -@@ -1201,6 +1202,10 @@ calculate_init(PyCalculatePath *calculate, const PyConfig *config) - if (!calculate->lib_python) { - return DECODE_LOCALE_ERR("EXEC_PREFIX define", len); - } -+ calculate->multilib_python = Py_DecodeLocale(LIB "/python" VERSION, &len); -+ if (!calculate->multilib_python) { -+ return DECODE_LOCALE_ERR("EXEC_PREFIX define", len); -+ } - - calculate->warnings = config->pathconfig_warnings; - calculate->pythonpath_env = config->pythonpath_env; -@@ -1216,6 +1221,7 @@ calculate_free(PyCalculatePath *calculate) - PyMem_RawFree(calculate->prefix); - PyMem_RawFree(calculate->exec_prefix); - PyMem_RawFree(calculate->lib_python); -+ PyMem_RawFree(calculate->multilib_python); - PyMem_RawFree(calculate->path_env); - } - -diff --git a/Python/getplatform.c b/Python/getplatform.c -index 81a0f7a..d55396b 100644 ---- a/Python/getplatform.c -+++ b/Python/getplatform.c -@@ -10,3 +10,13 @@ Py_GetPlatform(void) - { - return PLATFORM; - } -+ -+#ifndef LIB -+#define LIB "lib" -+#endif -+ -+const char * -+Py_GetLib(void) -+{ -+ return LIB; -+} -diff --git a/Python/sysmodule.c b/Python/sysmodule.c -index 5b0fb81..0dce754 100644 ---- a/Python/sysmodule.c -+++ b/Python/sysmodule.c -@@ -2668,6 +2668,8 @@ _PySys_InitCore(_PyRuntimeState *runtime, PyInterpreterState *interp, - PyUnicode_FromString(Py_GetCopyright())); - SET_SYS_FROM_STRING("platform", - PyUnicode_FromString(Py_GetPlatform())); -+ SET_SYS_FROM_STRING("lib", -+ PyUnicode_FromString(Py_GetLib())); - SET_SYS_FROM_STRING("maxsize", - PyLong_FromSsize_t(PY_SSIZE_T_MAX)); - SET_SYS_FROM_STRING("float_info", diff --git a/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch b/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch deleted file mode 100644 index 83fd52d87f..0000000000 --- a/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 148861fa16f2aaacd518770f337ea54b5182f981 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Tue, 29 Jan 2019 15:03:01 +0100 -Subject: [PATCH] Do not use the shell version of python-config that was - introduced in 3.4 - -Revert instead to the original python version: it has our tweaks and -outputs directories correctly. - -Upstream-Status: Inappropriate [oe-specific] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - Makefile.pre.in | 9 +++------ - 1 file changed, 3 insertions(+), 6 deletions(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 2d2e11f..cc19942 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -1431,12 +1431,9 @@ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh - sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py - @ # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR} - LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config -- @ # On Darwin, always use the python version of the script, the shell -- @ # version doesn't use the compiler customizations that are provided -- @ # in python (_osx_support.py). -- @if test `uname -s` = Darwin; then \ -- cp python-config.py python-config; \ -- fi -+ @ # In OpenEmbedded, always use the python version of the script, the shell -+ @ # version is broken in multiple ways, and doesn't return correct directories -+ cp python-config.py python-config - - - # Install the include files diff --git a/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch b/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch deleted file mode 100644 index acf8e1e9b5..0000000000 --- a/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 85e8f86ad2b7dec0848cd55b8e810a5e2722b20a Mon Sep 17 00:00:00 2001 -From: Jeremy Puhlman <jpuhlman@mvista.com> -Date: Wed, 4 Mar 2020 00:06:42 +0000 -Subject: [PATCH] Don't search system for headers/libraries - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com> ---- - setup.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/setup.py b/setup.py -index 9da1b3a..59782c0 100644 ---- a/setup.py -+++ b/setup.py -@@ -674,8 +674,8 @@ class PyBuildExt(build_ext): - add_dir_to_list(self.compiler.include_dirs, - sysconfig.get_config_var("INCLUDEDIR")) - -- system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib'] -- system_include_dirs = ['/usr/include'] -+ system_lib_dirs = [] -+ system_include_dirs = [] - # lib_dirs and inc_dirs are used to search for files; - # if a file is found in one of those directories, it can - # be assumed that no additional -I,-L directives are needed. --- -2.24.1 - diff --git a/meta/recipes-devtools/python/python3/0001-Lib-pty.py-handle-stdin-I-O-errors-same-way-as-maste.patch b/meta/recipes-devtools/python/python3/0001-Lib-pty.py-handle-stdin-I-O-errors-same-way-as-maste.patch new file mode 100644 index 0000000000..026150f0e2 --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-Lib-pty.py-handle-stdin-I-O-errors-same-way-as-maste.patch @@ -0,0 +1,47 @@ +From f8a664cf1fc73e381d57d6927207286059744837 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex@linutronix.de> +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 + errors + +reading stdin can throw the same I/O errors as reading from master fd does, +e.g. when running under Yocto's test harness: +====================================================================== +ERROR: test_spawn_doesnt_hang (test.test_pty.PtyTest) +---------------------------------------------------------------------- +Traceback (most recent call last): + File "/usr/lib/python3.10/test/test_pty.py", line 316, in test_spawn_doesnt_hang + pty.spawn([sys.executable, '-c', 'print("hi there")']) + File "/usr/lib/python3.10/pty.py", line 181, in spawn + _copy(master_fd, master_read, stdin_read) + File "/usr/lib/python3.10/pty.py", line 157, in _copy + data = stdin_read(STDIN_FILENO) + File "/usr/lib/python3.10/pty.py", line 132, in _read + return os.read(fd, 1024) +OSError: [Errno 5] Input/output error + +So let's treat both channels the same. + +Upstream-Status: Submitted [https://github.com/python/cpython/pull/28388] +Signed-off-by: Alexander Kanavin <alex@linutronix.de> + +--- + Lib/pty.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/Lib/pty.py b/Lib/pty.py +index 1d97994..fa8821b 100644 +--- a/Lib/pty.py ++++ b/Lib/pty.py +@@ -178,7 +178,10 @@ def _copy(master_fd, master_read=_read, stdin_read=_read): + i_buf = i_buf[n:] + + if stdin_avail and STDIN_FILENO in rfds: +- data = stdin_read(STDIN_FILENO) ++ try: ++ data = stdin_read(STDIN_FILENO) ++ except OSError: ++ data = b"" + if not data: + stdin_avail = False + else: diff --git a/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch b/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch deleted file mode 100644 index b97583682a..0000000000 --- a/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch +++ /dev/null @@ -1,31 +0,0 @@ -From a21f4f8fa5e5c0601898740b4ac08ec84f41e190 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Thu, 18 Apr 2019 17:11:06 +0200 -Subject: [PATCH] Lib/sysconfig.py: fix another place where 'lib' is hardcoded - as the library path - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - Lib/sysconfig.py | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py -index d15cec8..87fa5e6 100644 ---- a/Lib/sysconfig.py -+++ b/Lib/sysconfig.py -@@ -20,10 +20,10 @@ __all__ = [ - - _INSTALL_SCHEMES = { - 'posix_prefix': { -- 'stdlib': '{installed_base}/lib/python{py_version_short}', -- 'platstdlib': '{platbase}/lib/python{py_version_short}', -- 'purelib': '{base}/lib/python{py_version_short}/site-packages', -- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages', -+ 'stdlib': '{LIBDEST}', -+ 'platstdlib': '{LIBDEST}', -+ 'purelib': '{LIBDEST}/site-packages', -+ 'platlib': '{LIBDEST}/site-packages', - 'include': - '{installed_base}/include/python{py_version_short}{abiflags}', - 'platinclude': diff --git a/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-use-prefix-value-from-build-configu.patch b/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-use-prefix-value-from-build-configu.patch new file mode 100644 index 0000000000..680254fab9 --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-use-prefix-value-from-build-configu.patch @@ -0,0 +1,32 @@ +From 71c194077bb907bfe423d3f3275f33a6c8ca0e74 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex@linutronix.de> +Date: Fri, 17 Nov 2023 14:26:32 +0100 +Subject: [PATCH] Lib/sysconfig.py: use prefix value from build configuration + file + +This allows correctly substituting them for target installs using +native python. + +Upstream-Status: Inappropriate [oe-core cross builds] +Signed-off-by: Alexander Kanavin <alex@linutronix.de> + +--- + Lib/sysconfig.py | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py +index 79c0510..91ebcb6 100644 +--- a/Lib/sysconfig.py ++++ b/Lib/sysconfig.py +@@ -668,6 +668,11 @@ def _init_config_vars(): + _CONFIG_VARS['VPATH'] = sys._vpath + if os.name == 'posix': + _init_posix(_CONFIG_VARS) ++ _CONFIG_VARS['installed_base'] = _CONFIG_VARS['prefix'] ++ _CONFIG_VARS['base'] = _CONFIG_VARS['prefix'] ++ _CONFIG_VARS['installed_platbase'] = _CONFIG_VARS['prefix'] ++ _CONFIG_VARS['platbase'] = _CONFIG_VARS['prefix'] ++ _CONFIG_VARS['platlibdir'] = _CONFIG_VARS['PLATLIBDIR'] + if _HAS_USER_BASE: + # Setting 'userbase' is done below the call to the + # init function to enable using 'get_config_var' in diff --git a/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch b/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch deleted file mode 100644 index b1bceac512..0000000000 --- a/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch +++ /dev/null @@ -1,58 +0,0 @@ -From c501e121a872cbcef8ffe626c1de173a125be9f8 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Thu, 16 Jan 2020 12:34:20 +0100 -Subject: [PATCH] Makefile: do not compile .pyc in parallel - -This was found to break reproducibility, and produce strange file ownership -races. - -The upstream commit introducing the change was: -https://github.com/python/cpython/commit/1a2dd82f56bd813aacc570e172cefe55a8a41504 - -Upstream-Status: Pending -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - Makefile.pre.in | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 1241112..5dfdf44 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -1457,30 +1457,30 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c - fi - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ - $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ -- -j0 -d $(LIBDEST) -f \ -+ -d $(LIBDEST) -f \ - -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ - $(DESTDIR)$(LIBDEST) - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ - $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \ -- -j0 -d $(LIBDEST) -f \ -+ -d $(LIBDEST) -f \ - -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ - $(DESTDIR)$(LIBDEST) - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ - $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \ -- -j0 -d $(LIBDEST) -f \ -+ -d $(LIBDEST) -f \ - -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ - $(DESTDIR)$(LIBDEST) - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ - $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ -- -j0 -d $(LIBDEST)/site-packages -f \ -+ -d $(LIBDEST)/site-packages -f \ - -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ - $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \ -- -j0 -d $(LIBDEST)/site-packages -f \ -+ -d $(LIBDEST)/site-packages -f \ - -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ - $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \ -- -j0 -d $(LIBDEST)/site-packages -f \ -+ -d $(LIBDEST)/site-packages -f \ - -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages - -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ - $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt diff --git a/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch b/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch deleted file mode 100644 index 237645bc60..0000000000 --- a/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 840fda32c82550259d02a7a56a78a9c05162b1a1 Mon Sep 17 00:00:00 2001 -From: Changqing Li <changqing.li@windriver.com> -Date: Wed, 8 May 2019 16:10:29 +0800 -Subject: [PATCH] Makefile: fix Issue36464 (parallel build race problem) - -When using make -j with the 'install' target, it's possible for altbininstall -(which normally creates BINDIR) and libainstall (which doesn't, though it -installs python-config there) to race, resulting in a failure due to -attempting to install python-config into a nonexistent BINDIR. Ensure it also -exists in the libainstall target. - -Upstream-Status: Submitted [https://github.com/python/cpython/pull/13186] - -Signed-off-by: Changqing Li <changqing.li@windriver.com> ---- - Makefile.pre.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 15f3687..7e9f173 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -1456,7 +1456,7 @@ LIBPL= @LIBPL@ - LIBPC= $(LIBDIR)/pkgconfig - - libainstall: @DEF_MAKE_RULE@ python-config -- @for i in $(LIBDIR) $(LIBPL) $(LIBPC); \ -+ @for i in $(LIBDIR) $(LIBPL) $(LIBPC) $(BINDIR); \ - do \ - if test ! -d $(DESTDIR)$$i; then \ - echo "Creating directory $$i"; \ --- -2.7.4 - diff --git a/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch b/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch index fa7735ff93..ee33128fa1 100644 --- a/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch +++ b/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch @@ -1,4 +1,4 @@ -From cf6a9100902484e4d028ee88742dd2487b014a98 Mon Sep 17 00:00:00 2001 +From 38278339832a57dbf5fa3ef21accaa03e2c814d7 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin <alex.kanavin@gmail.com> Date: Wed, 30 Jan 2019 12:41:04 +0100 Subject: [PATCH] Makefile.pre: use qemu wrapper when gathering profile data @@ -10,16 +10,16 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile.pre.in b/Makefile.pre.in -index a3a02a7..d5503dd 100644 +index dd5e69f..381feb0 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -507,8 +507,7 @@ build_all_generate_profile: - $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)" - - run_profile_task: +@@ -658,8 +658,7 @@ profile-run-stamp: + # enabled. + $(MAKE) profile-gen-stamp + # Next, run the profile task to generate the profile information. - @ # FIXME: can't run for a cross build - $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true + ./pgo-wrapper ./python -m test.regrtest --pgo test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_support || true - - build_all_merge_profile: $(LLVM_PROF_MERGER) + # Remove profile generation binary since we are done with it. + $(MAKE) clean-retain-profile diff --git a/meta/recipes-devtools/python/python3/0001-Skip-failing-tests-due-to-load-variability-on-YP-AB.patch b/meta/recipes-devtools/python/python3/0001-Skip-failing-tests-due-to-load-variability-on-YP-AB.patch new file mode 100644 index 0000000000..197daa71a5 --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-Skip-failing-tests-due-to-load-variability-on-YP-AB.patch @@ -0,0 +1,72 @@ +From 3471e3478e0760c42e04f8046cee2367ab5706d2 Mon Sep 17 00:00:00 2001 +From: Yi Fan Yu <yifan.yu@windriver.com> +Date: Thu, 1 Apr 2021 13:08:37 -0700 +Subject: [PATCH] Skip failing tests due to load variability on YP AB + +Skip these tests until AB-INT is solved. + +[YOCTO #14296] + +Upstream-Status: Inappropriate [OE-Specific] + +Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com> + +Skip two additional tests due to suspected load variability failures. + +[YOCTO #15131] +[YOCTO #15177] + +Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> +--- + Lib/test/_test_multiprocessing.py | 3 +++ + Lib/test/test_time.py | 2 ++ + 2 files changed, 5 insertions(+) + +diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py +index e42c7ab..dff5227 100644 +--- a/Lib/test/_test_multiprocessing.py ++++ b/Lib/test/_test_multiprocessing.py +@@ -682,6 +682,7 @@ class _TestProcess(BaseTestCase): + close_queue(q) + + @support.requires_resource('walltime') ++ @unittest.skip('timing related test, dependent on load') + def test_many_processes(self): + if self.TYPE == 'threads': + self.skipTest('test not appropriate for {}'.format(self.TYPE)) +@@ -2066,6 +2067,7 @@ class _TestBarrier(BaseTestCase): + except threading.BrokenBarrierError: + results.append(True) + ++ @unittest.skip('timing related test, dependent on load') + def test_timeout(self): + """ + Test wait(timeout) +@@ -5024,6 +5026,7 @@ class TestWait(unittest.TestCase): + time.sleep(period) + + @support.requires_resource('walltime') ++ @unittest.skip('timing related test, dependent on load') + def test_wait_integer(self): + from multiprocessing.connection import wait + +diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py +index 02cc3f4..51a4548 100644 +--- a/Lib/test/test_time.py ++++ b/Lib/test/test_time.py +@@ -492,6 +492,7 @@ class TimeTestCase(unittest.TestCase): + @unittest.skipIf( + support.is_wasi, "process_time not available on WASI" + ) ++ @unittest.skip('timing related test, dependent on load') + def test_process_time(self): + # process_time() should not include time spend during a sleep + start = time.process_time() +@@ -505,6 +506,7 @@ class TimeTestCase(unittest.TestCase): + self.assertTrue(info.monotonic) + self.assertFalse(info.adjustable) + ++ @unittest.skip('timing related test, dependent on load') + def test_thread_time(self): + if not hasattr(time, 'thread_time'): + if sys.platform.startswith(('linux', 'win')): 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 index 0000000000..b6c6ac5a28 --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-Update-test_sysconfig-for-posix_user-purelib.patch @@ -0,0 +1,37 @@ +From 37d058e841ba3bd89b5746cc5381afb014b11581 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 b6dbf3d..5672590 100644 +--- a/Lib/test/test_sysconfig.py ++++ b/Lib/test/test_sysconfig.py +@@ -372,7 +372,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() diff --git a/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch b/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch deleted file mode 100644 index 957839bf3e..0000000000 --- a/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 6c8ea7c1dacd42f3ba00440231ec0e6b1a38300d Mon Sep 17 00:00:00 2001 -From: Inada Naoki <songofacandy@gmail.com> -Date: Sat, 14 Jul 2018 00:46:11 +0900 -Subject: [PATCH] Use FLAG_REF always for interned strings - -Upstream-Status: Submitted [https://github.com/python/cpython/pull/8226] -Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> ---- - Python/marshal.c | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/Python/marshal.c b/Python/marshal.c -index 6d06266c6a..51db2e3b2e 100644 ---- a/Python/marshal.c -+++ b/Python/marshal.c -@@ -275,9 +275,14 @@ w_ref(PyObject *v, char *flag, WFILE *p) - if (p->version < 3 || p->hashtable == NULL) - return 0; /* not writing object references */ - -- /* if it has only one reference, it definitely isn't shared */ -- if (Py_REFCNT(v) == 1) -+ /* If it has only one reference, it definitely isn't shared. -+ * But we use TYPE_REF always for interned string, to PYC file stable -+ * as possible. -+ */ -+ if (Py_REFCNT(v) == 1 && -+ !(PyUnicode_CheckExact(v) && PyUnicode_CHECK_INTERNED(v))) { - return 0; -+ } - - entry = _Py_HASHTABLE_GET_ENTRY(p->hashtable, v); - if (entry != NULL) { --- -2.21.0 - diff --git a/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch b/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch deleted file mode 100644 index c4fae09a5b..0000000000 --- a/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch +++ /dev/null @@ -1,209 +0,0 @@ -From 1ad771d86728ee2ed30e202e9768d8d825f96467 Mon Sep 17 00:00:00 2001 -From: Matthias Schoepfer <matthias.schoepfer@ithinx.io> -Date: Fri, 31 May 2019 15:34:34 +0200 -Subject: [PATCH] bpo-36852: proper detection of mips architecture for soft - float - -When (cross) compiling for softfloat mips, __mips_hard_float will not be -defined and detection of OS triplet in configure.ac / configure will fail. - -This also has to do with the custom detection of the build triplet. Trying -to do this in a more autoconf/autotools manner. - -Upstream-Status: Submitted [https://github.com/python/cpython/pull/13196] -Signed-off-by: Matthias Schoepfer <matthias.schoepfer@ithinx.io> - -%% original patch: 0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch ---- - configure.ac | 175 +++++++-------------------------------------------- - 1 file changed, 21 insertions(+), 154 deletions(-) - -diff --git a/configure.ac b/configure.ac -index ede710e..bc81b0b 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -710,160 +710,27 @@ fi - MULTIARCH=$($CC --print-multiarch 2>/dev/null) - AC_SUBST(MULTIARCH) - --AC_MSG_CHECKING([for the platform triplet based on compiler characteristics]) --cat >> conftest.c <<EOF --#undef bfin --#undef cris --#undef fr30 --#undef linux --#undef hppa --#undef hpux --#undef i386 --#undef mips --#undef powerpc --#undef sparc --#undef unix --#if defined(__ANDROID__) -- # Android is not a multiarch system. --#elif defined(__linux__) --# if defined(__x86_64__) && defined(__LP64__) -- x86_64-linux-gnu --# elif defined(__x86_64__) && defined(__ILP32__) -- x86_64-linux-gnux32 --# elif defined(__i386__) -- i386-linux-gnu --# elif defined(__aarch64__) && defined(__AARCH64EL__) --# if defined(__ILP32__) -- aarch64_ilp32-linux-gnu --# else -- aarch64-linux-gnu --# endif --# elif defined(__aarch64__) && defined(__AARCH64EB__) --# if defined(__ILP32__) -- aarch64_be_ilp32-linux-gnu --# else -- aarch64_be-linux-gnu --# endif --# elif defined(__alpha__) -- alpha-linux-gnu --# elif defined(__ARM_EABI__) && defined(__ARM_PCS_VFP) --# if defined(__ARMEL__) -- arm-linux-gnueabihf --# else -- armeb-linux-gnueabihf --# endif --# elif defined(__ARM_EABI__) && !defined(__ARM_PCS_VFP) --# if defined(__ARMEL__) -- arm-linux-gnueabi --# else -- armeb-linux-gnueabi --# endif --# elif defined(__hppa__) -- hppa-linux-gnu --# elif defined(__ia64__) -- ia64-linux-gnu --# elif defined(__m68k__) && !defined(__mcoldfire__) -- m68k-linux-gnu --# elif defined(__mips_hard_float) && defined(__mips_isa_rev) && (__mips_isa_rev >=6) && defined(_MIPSEL) --# if _MIPS_SIM == _ABIO32 -- mipsisa32r6el-linux-gnu --# elif _MIPS_SIM == _ABIN32 -- mipsisa64r6el-linux-gnuabin32 --# elif _MIPS_SIM == _ABI64 -- mipsisa64r6el-linux-gnuabi64 --# else --# error unknown platform triplet --# endif --# elif defined(__mips_hard_float) && defined(__mips_isa_rev) && (__mips_isa_rev >=6) --# if _MIPS_SIM == _ABIO32 -- mipsisa32r6-linux-gnu --# elif _MIPS_SIM == _ABIN32 -- mipsisa64r6-linux-gnuabin32 --# elif _MIPS_SIM == _ABI64 -- mipsisa64r6-linux-gnuabi64 --# else --# error unknown platform triplet --# endif --# elif defined(__mips_hard_float) && defined(_MIPSEL) --# if _MIPS_SIM == _ABIO32 -- mipsel-linux-gnu --# elif _MIPS_SIM == _ABIN32 -- mips64el-linux-gnuabin32 --# elif _MIPS_SIM == _ABI64 -- mips64el-linux-gnuabi64 --# else --# error unknown platform triplet --# endif --# elif defined(__mips_hard_float) --# if _MIPS_SIM == _ABIO32 -- mips-linux-gnu --# elif _MIPS_SIM == _ABIN32 -- mips64-linux-gnuabin32 --# elif _MIPS_SIM == _ABI64 -- mips64-linux-gnuabi64 --# else --# error unknown platform triplet --# endif --# elif defined(__or1k__) -- or1k-linux-gnu --# elif defined(__powerpc__) && defined(__SPE__) -- powerpc-linux-gnuspe --# elif defined(__powerpc64__) --# if defined(__LITTLE_ENDIAN__) -- powerpc64le-linux-gnu --# else -- powerpc64-linux-gnu --# endif --# elif defined(__powerpc__) -- powerpc-linux-gnu --# elif defined(__s390x__) -- s390x-linux-gnu --# elif defined(__s390__) -- s390-linux-gnu --# elif defined(__sh__) && defined(__LITTLE_ENDIAN__) -- sh4-linux-gnu --# elif defined(__sparc__) && defined(__arch64__) -- sparc64-linux-gnu --# elif defined(__sparc__) -- sparc-linux-gnu --# elif defined(__riscv) --# if __riscv_xlen == 32 -- riscv32-linux-gnu --# elif __riscv_xlen == 64 -- riscv64-linux-gnu --# else --# error unknown platform triplet --# endif --# else --# error unknown platform triplet --# endif --#elif defined(__FreeBSD_kernel__) --# if defined(__LP64__) -- x86_64-kfreebsd-gnu --# elif defined(__i386__) -- i386-kfreebsd-gnu --# else --# error unknown platform triplet --# endif --#elif defined(__gnu_hurd__) -- i386-gnu --#elif defined(__APPLE__) -- darwin --#elif defined(__VXWORKS__) -- vxworks --#else --# error unknown platform triplet --#endif -- --EOF -- --if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then -- PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '` -- AC_MSG_RESULT([$PLATFORM_TRIPLET]) --else -- AC_MSG_RESULT([none]) --fi --rm -f conftest.c conftest.out -+AC_CANONICAL_TARGET -+## Not using $target to filter out vendor -+## Need to handle macos, vxworks and hurd special (?) :-/ -+case ${target_os} in -+ darwin*) -+ PLATFORM_TRIPLET=darwin -+ ;; -+ hurd*) -+ PLATFORM_TRIPLET=i386-gnu -+ ;; -+ vxworks*) -+ PLATFORM_TRIPLET=vxworks -+ ;; -+ *) -+ if test "${target_cpu}" != "i686"; then -+ PLATFORM_TRIPLET=${target_cpu}-${target_os} -+ else -+ PLATFORM_TRIPLET=i386-${target_os} -+ fi -+ ;; -+esac - - if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then - if test x$PLATFORM_TRIPLET != x$MULTIARCH; then --- -2.24.1 - diff --git a/meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch b/meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch deleted file mode 100644 index 123ce3a2dc..0000000000 --- a/meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch +++ /dev/null @@ -1,35 +0,0 @@ -From acce3d441e7eadadd2d3ce38654155dc43f1f607 Mon Sep 17 00:00:00 2001 -From: Changqing Li <changqing.li@windriver.com> -Date: Fri, 7 Feb 2020 09:36:25 +0800 -Subject: [PATCH] configure.ac: fix LIBPL - -Use LIBDIR rather than prefix/lib, so that it would work when lib64. - -Upstream-Status: Inappropriate [oe-core specific] - -Signed-off-by: Robert Yang <liezhi.yang@windriver.com> -Signed-off-by: Li Zhou <li.zhou@windriver.c> -Signed-off-by: Changqing Li <changqing.li@windriver.com> ---- - configure.ac | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/configure.ac b/configure.ac -index ce04258..915f475 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -4532,9 +4532,9 @@ fi - dnl define LIBPL after ABIFLAGS and LDVERSION is defined. - AC_SUBST(PY_ENABLE_SHARED) - if test x$PLATFORM_TRIPLET = x; then -- LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}" -+ LIBPL='$(LIBDIR)'"/python${VERSION}/config-${LDVERSION}" - else -- LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}" -+ LIBPL='$(LIBDIR)'"/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}" - fi - AC_SUBST(LIBPL) - --- -2.7.4 - diff --git a/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch b/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch deleted file mode 100644 index e7af3c6f5c..0000000000 --- a/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 7ada9c749f6beb51c13a3debc850755e911548a6 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Thu, 31 Jan 2019 16:46:30 +0100 -Subject: [PATCH] distutils/sysconfig: append - STAGING_LIBDIR/python-sysconfigdata to sys.path - -So that target configuration can be used when running native python - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - ---- - Lib/distutils/sysconfig.py | 2 ++ - Lib/sysconfig.py | 2 ++ - 2 files changed, 4 insertions(+) - -diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py -index b51629e..2df348c 100644 ---- a/Lib/distutils/sysconfig.py -+++ b/Lib/distutils/sysconfig.py -@@ -438,6 +438,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') - _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0) - build_time_vars = _temp.build_time_vars - global _config_vars -diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py -index b2d790b..405273c 100644 ---- a/Lib/sysconfig.py -+++ b/Lib/sysconfig.py -@@ -419,6 +419,8 @@ def _init_posix(vars): - """Initialize the module as appropriate for POSIX systems.""" - # _sysconfigdata is generated at build time, see _generate_posix_vars() - name = _get_sysconfigdata_name() -+ if 'STAGING_LIBDIR' in os.environ: -+ sys.path.append(os.environ['STAGING_LIBDIR']+'/python-sysconfigdata') - _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0) - build_time_vars = _temp.build_time_vars - vars.update(build_time_vars) diff --git a/meta/recipes-devtools/python/python3/0001-gh-107811-tarfile-treat-overflow-in-UID-GID-as-failu.patch b/meta/recipes-devtools/python/python3/0001-gh-107811-tarfile-treat-overflow-in-UID-GID-as-failu.patch new file mode 100644 index 0000000000..88b84c6024 --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-gh-107811-tarfile-treat-overflow-in-UID-GID-as-failu.patch @@ -0,0 +1,40 @@ +From 999d4e74d34afa233ad8ad0c70b989d77a21957f Mon Sep 17 00:00:00 2001 +From: Petr Viktorin <encukou@gmail.com> +Date: Wed, 23 Aug 2023 20:00:07 +0200 +Subject: [PATCH] gh-107811: tarfile: treat overflow in UID/GID as failure to + set it (#108369) + +Upstream-Status: Backport [https://github.com/python/cpython/pull/108369] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + Lib/tarfile.py | 3 ++- + .../Library/2023-08-23-17-34-39.gh-issue-107811.3Fng72.rst | 3 +++ + 2 files changed, 5 insertions(+), 1 deletion(-) + create mode 100644 Misc/NEWS.d/next/Library/2023-08-23-17-34-39.gh-issue-107811.3Fng72.rst + +diff --git a/Lib/tarfile.py b/Lib/tarfile.py +index 3bbbcaa..473167d 100755 +--- a/Lib/tarfile.py ++++ b/Lib/tarfile.py +@@ -2557,7 +2557,8 @@ class TarFile(object): + os.lchown(targetpath, u, g) + else: + os.chown(targetpath, u, g) +- except OSError as e: ++ except (OSError, OverflowError) as e: ++ # OverflowError can be raised if an ID doesn't fit in `id_t` + raise ExtractError("could not change owner") from e + + def chmod(self, tarinfo, targetpath): +diff --git a/Misc/NEWS.d/next/Library/2023-08-23-17-34-39.gh-issue-107811.3Fng72.rst b/Misc/NEWS.d/next/Library/2023-08-23-17-34-39.gh-issue-107811.3Fng72.rst +new file mode 100644 +index 0000000..ffca413 +--- /dev/null ++++ b/Misc/NEWS.d/next/Library/2023-08-23-17-34-39.gh-issue-107811.3Fng72.rst +@@ -0,0 +1,3 @@ ++:mod:`tarfile`: extraction of members with overly large UID or GID (e.g. on ++an OS with 32-bit :c:type:`!id_t`) now fails in the same way as failing to ++set the ID. +-- +2.45.0 + diff --git a/meta/recipes-devtools/python/python3/0001-gh-114492-Initialize-struct-termios-before-calling-t.patch b/meta/recipes-devtools/python/python3/0001-gh-114492-Initialize-struct-termios-before-calling-t.patch new file mode 100644 index 0000000000..8406ef30a2 --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-gh-114492-Initialize-struct-termios-before-calling-t.patch @@ -0,0 +1,26 @@ +From 439aa02f42d6e6715c172076261757fcb89a936a Mon Sep 17 00:00:00 2001 +From: "Miss Islington (bot)" + <31488909+miss-islington@users.noreply.github.com> +Date: Tue, 23 Jan 2024 23:02:02 +0100 +Subject: [PATCH] gh-114492: Initialize struct termios before calling + tcgetattr() (GH-114495) (GH-114502) + +On Alpine Linux it could leave some field non-initialized. +(cherry picked from commit d22c066b802592932f9eb18434782299e80ca42e) + +Upstream-Status: Backport [https://github.com/python/cpython/commit/386c72d9928c51aa2c855ce592bd8022da3b407f] +Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + .../next/Library/2024-01-23-21-20-40.gh-issue-114492.vKxl5o.rst | 2 ++ + 1 file changed, 2 insertions(+) + create mode 100644 Misc/NEWS.d/next/Library/2024-01-23-21-20-40.gh-issue-114492.vKxl5o.rst + +diff --git a/Misc/NEWS.d/next/Library/2024-01-23-21-20-40.gh-issue-114492.vKxl5o.rst b/Misc/NEWS.d/next/Library/2024-01-23-21-20-40.gh-issue-114492.vKxl5o.rst +new file mode 100644 +index 0000000..8df8299 +--- /dev/null ++++ b/Misc/NEWS.d/next/Library/2024-01-23-21-20-40.gh-issue-114492.vKxl5o.rst +@@ -0,0 +1,2 @@ ++Make the result of :func:`termios.tcgetattr` reproducible on Alpine Linux. ++Previously it could leave a random garbage in some fields. diff --git a/meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch b/meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch deleted file mode 100644 index fe031b9983..0000000000 --- a/meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch +++ /dev/null @@ -1,43 +0,0 @@ -From bb711b53f10d32a90a27ccf4b0dc51e4a701d862 Mon Sep 17 00:00:00 2001 -From: Changqing Li <changqing.li@windriver.com> -Date: Fri, 7 Feb 2020 09:42:09 +0800 -Subject: [PATCH] python3: Do not hardcode "lib" for distutils - -Get the sys.lib from python3 itself and do not use -hardcoded value of 'lib' for distutils. - -Upstream-Status: Inappropriate [oe-core specific] - -Signed-off-by: Li Zhou <li.zhou@windriver.com> -Signed-off-by: Changqing Li <changqing.li@windriver.com> ---- - Lib/distutils/command/install.py | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py -index c625c95..8e32f54 100644 ---- a/Lib/distutils/command/install.py -+++ b/Lib/distutils/command/install.py -@@ -19,6 +19,8 @@ from site import USER_BASE - from site import USER_SITE - HAS_USER_SITE = True - -+libname = sys.lib -+ - WINDOWS_SCHEME = { - 'purelib': '$base/Lib/site-packages', - 'platlib': '$base/Lib/site-packages', -@@ -29,8 +31,8 @@ WINDOWS_SCHEME = { - - INSTALL_SCHEMES = { - 'unix_prefix': { -- 'purelib': '$base/lib/python$py_version_short/site-packages', -- 'platlib': '$platbase/lib/python$py_version_short/site-packages', -+ 'purelib': '$base/' + libname + '/python$py_version_short/site-packages', -+ 'platlib': '$platbase/' + libname + '/python$py_version_short/site-packages', - 'headers': '$base/include/python$py_version_short$abiflags/$dist_name', - 'scripts': '$base/bin', - 'data' : '$base', --- -2.7.4 - diff --git a/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch b/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch index fb10ca94b3..bbeabe4389 100644 --- a/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch +++ b/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch @@ -1,4 +1,4 @@ -From 994783da5c21cab81b6589ed2d4275e665a946f9 Mon Sep 17 00:00:00 2001 +From ababc7b1db8c406910766e11cdd04cbef7a706c9 Mon Sep 17 00:00:00 2001 From: Changqing Li <changqing.li@windriver.com> Date: Mon, 22 Oct 2018 15:19:51 +0800 Subject: [PATCH] python3: use cc_basename to replace CC for checking compiler @@ -14,40 +14,39 @@ x86_64-wrs-linux-gcc: error: unrecognized command line option '-fp-model' Here use cc_basename to replace CC for checking compiler to avoid such kind of issue. -Upstream-Status: Pending +Upstream-Status: Submitted [https://github.com/python/cpython/pull/96399] Signed-off-by: Li Zhou <li.zhou@windriver.com> patch originally from Li Zhou, I just rework it to new version Signed-off-by: Changqing Li <changqing.li@windriver.com> - --- configure.ac | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac -index a189d42..0f85486 100644 +index 384718d..5a1d58b 100644 --- a/configure.ac +++ b/configure.ac -@@ -54,6 +54,7 @@ AC_CONFIG_HEADER(pyconfig.h) +@@ -137,6 +137,7 @@ AC_CONFIG_HEADERS([pyconfig.h]) AC_CANONICAL_HOST - AC_SUBST(build) - AC_SUBST(host) + AC_SUBST([build]) + AC_SUBST([host]) +LT_INIT - # pybuilddir.txt will be created by --generate-posix-vars in the Makefile - rm -f pybuilddir.txt -@@ -671,7 +672,7 @@ AC_MSG_RESULT($with_cxx_main) + AS_VAR_IF([cross_compiling], [maybe], + [AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])] +@@ -896,7 +897,7 @@ AC_SUBST([CXX]) preset_cxx="$CXX" if test -z "$CXX" then - case "$CC" in + case "$cc_basename" in - gcc) AC_PATH_TOOL(CXX, [g++], [g++], [notfound]) ;; - cc) AC_PATH_TOOL(CXX, [c++], [c++], [notfound]) ;; - clang|*/clang) AC_PATH_TOOL(CXX, [clang++], [clang++], [notfound]) ;; -@@ -957,7 +958,7 @@ rmdir CaseSensitiveTestDir + gcc) AC_PATH_TOOL([CXX], [g++], [g++], [notfound]) ;; + cc) AC_PATH_TOOL([CXX], [c++], [c++], [notfound]) ;; + clang|*/clang) AC_PATH_TOOL([CXX], [clang++], [clang++], [notfound]) ;; +@@ -1328,7 +1329,7 @@ rmdir CaseSensitiveTestDir case $ac_sys_system in hp*|HP*) @@ -56,16 +55,16 @@ index a189d42..0f85486 100644 cc|*/cc) CC="$CC -Ae";; esac;; esac -@@ -1335,7 +1336,7 @@ else - fi], - [AC_MSG_RESULT(no)]) +@@ -1854,7 +1855,7 @@ esac + ], + [AC_MSG_RESULT([no])]) if test "$Py_LTO" = 'true' ; then - case $CC in + case $cc_basename in *clang*) - AC_SUBST(LLVM_AR) - AC_PATH_TOOL(LLVM_AR, llvm-ar, '', ${llvm_path}) -@@ -1425,7 +1426,7 @@ then + LDFLAGS_NOLTO="-fno-lto" + dnl Clang linker requires -flto in order to link objects with LTO information. +@@ -1983,7 +1984,7 @@ then fi fi LLVM_PROF_ERR=no @@ -74,7 +73,7 @@ index a189d42..0f85486 100644 *clang*) # Any changes made here should be reflected in the GCC+Darwin case below PGO_PROF_GEN_FLAG="-fprofile-instr-generate" -@@ -1486,7 +1487,7 @@ esac +@@ -2147,7 +2148,7 @@ AC_MSG_RESULT([$BOLT_APPLY_FLAGS]) # compiler and platform. BASECFLAGS tweaks need to be made even if the # user set OPT. @@ -83,25 +82,25 @@ index a189d42..0f85486 100644 *clang*) cc_is_clang=1 ;; -@@ -1622,7 +1623,7 @@ yes) +@@ -2419,7 +2420,7 @@ yes) # ICC doesn't recognize the option, but only emits a warning ## XXX does it emit an unused result warning and can it be disabled? -- case "$CC" in -+ case "$cc_basename" in - *icc*) - ac_cv_disable_unused_result_warning=no +- AS_CASE([$CC], ++ AS_CASE([$cc_basename], + [*icc*], [ac_cv_disable_unused_result_warning=no] + [PY_CHECK_CC_WARNING([disable], [unused-result])]) + AS_VAR_IF([ac_cv_disable_unused_result_warning], [yes], +@@ -2665,7 +2666,7 @@ yes) ;; -@@ -1943,7 +1944,7 @@ yes) esac - # ICC needs -fp-model strict or floats behave badly -case "$CC" in +case "$cc_basename" in - *icc*) - CFLAGS_NODIST="$CFLAGS_NODIST -fp-model strict" + *mpicc*) + CFLAGS_NODIST="$CFLAGS_NODIST" ;; -@@ -2711,7 +2712,7 @@ then +@@ -3482,7 +3483,7 @@ then then LINKFORSHARED="-Wl,--export-dynamic" fi;; @@ -110,12 +109,12 @@ index a189d42..0f85486 100644 *gcc*) if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null then -@@ -5362,7 +5363,7 @@ if test "$have_gcc_asm_for_x87" = yes; then +@@ -6803,7 +6804,7 @@ if test "$ac_cv_gcc_asm_for_x87" = yes; then # Some versions of gcc miscompile inline asm: # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46491 # http://gcc.gnu.org/ml/gcc/2010-11/msg00366.html - case $CC in + case $cc_basename in *gcc*) - AC_MSG_CHECKING(for gcc ipa-pure-const bug) + AC_MSG_CHECKING([for gcc ipa-pure-const bug]) saved_cflags="$CFLAGS" diff --git a/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch b/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch deleted file mode 100644 index d38ed61dd7..0000000000 --- a/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 7019ba184b828ed7253750cf409fc5760ef90a54 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Thu, 9 Jan 2020 17:44:05 +0100 -Subject: [PATCH] setup.py: pass missing libraries to Extension for - multiprocessing module - -In the following commit: -... -commit e711cafab13efc9c1fe6c5cd75826401445eb585 -Author: Benjamin Peterson <benjamin@python.org> -Date: Wed Jun 11 16:44:04 2008 +0000 - - Merged revisions 64104,64117 via svnmerge from - svn+ssh://pythondev@svn.python.org/python/trunk -... -(see diff in setup.py) -It assigned libraries for multiprocessing module according -the host_platform, but not pass it to Extension. - -In glibc, the following commit caused two definition of -sem_getvalue are different. -https://sourceware.org/git/?p=glibc.git;a=commit;h=042e1521c794a945edc43b5bfa7e69ad70420524 -(see diff in nptl/sem_getvalue.c for detail) -`__new_sem_getvalue' is the latest sem_getvalue@@GLIBC_2.1 -and `__old_sem_getvalue' is to compat the old version -sem_getvalue@GLIBC_2.0. - -To build python for embedded Linux systems: -http://www.yoctoproject.org/docs/2.3.1/yocto-project-qs/yocto-project-qs.html -If not explicitly link to library pthread (-lpthread), it will -load glibc's sem_getvalue randomly at runtime. - -Such as build python on linux x86_64 host and run the python -on linux x86_32 target. If not link library pthread, it caused -multiprocessing bounded semaphore could not work correctly. -... ->>> import multiprocessing ->>> pool_sema = multiprocessing.BoundedSemaphore(value=1) ->>> pool_sema.acquire() -True ->>> pool_sema.release() -Traceback (most recent call last): - File "<stdin>", line 1, in <module> -ValueError: semaphore or lock released too many times -... - -And the semaphore issue also caused multiprocessing.Queue().put() hung. - -Upstream-Status: Pensing - -Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - setup.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/setup.py b/setup.py -index ec3f2a4..b0f1541 100644 ---- a/setup.py -+++ b/setup.py -@@ -1671,7 +1671,7 @@ class PyBuildExt(build_ext): - libraries=libs, - include_dirs=["Modules/_multiprocessing"])) - -- self.add(Extension('_multiprocessing', multiprocessing_srcs, -+ self.add(Extension('_multiprocessing', multiprocessing_srcs, libraries=['pthread'], - include_dirs=["Modules/_multiprocessing"])) - - def detect_uuid(self): diff --git a/meta/recipes-devtools/python/python3/0001-skip-no_stdout_fileno-test-due-to-load-variability.patch b/meta/recipes-devtools/python/python3/0001-skip-no_stdout_fileno-test-due-to-load-variability.patch new file mode 100644 index 0000000000..2d7bca6a77 --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-skip-no_stdout_fileno-test-due-to-load-variability.patch @@ -0,0 +1,29 @@ +From 217cea231462e7703e8c9ea39c0a6833f799a420 Mon Sep 17 00:00:00 2001 +From: Trevor Gamblin <tgamblin@baylibre.com> +Date: Fri, 15 Sep 2023 08:48:33 -0400 +Subject: [PATCH] skip no_stdout_fileno test due to load variability + +Skip test_input_no_stdout_fileno so that it doesn't fail on systems +under heavy load. + +Upstream-Status: Inappropriate [OE-Specific] + +[YOCTO #15210] + +Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> +--- + Lib/test/test_builtin.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py +index 4d03c46..b329b7a 100644 +--- a/Lib/test/test_builtin.py ++++ b/Lib/test/test_builtin.py +@@ -2326,6 +2326,7 @@ class PtyTests(unittest.TestCase): + # Check stdin/stdout error handler is used when invoking PyOS_Readline() + self.check_input_tty("prompté", b"quux\xe9", "ascii") + ++ @unittest.skip("Test may fail under heavy load") + def test_input_no_stdout_fileno(self): + # Issue #24402: If stdin is the original terminal but stdout.fileno() + # fails, do not use the original stdout file descriptor diff --git a/meta/recipes-devtools/python/python3/0001-sysconfig.py-use-platlibdir-also-for-purelib.patch b/meta/recipes-devtools/python/python3/0001-sysconfig.py-use-platlibdir-also-for-purelib.patch new file mode 100644 index 0000000000..fc52fdac26 --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-sysconfig.py-use-platlibdir-also-for-purelib.patch @@ -0,0 +1,28 @@ +From a5d429a0e1a4809c1ded7be7e45dcabeb82c53d8 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex@linutronix.de> +Date: Sun, 12 Sep 2021 21:44:36 +0200 +Subject: [PATCH] sysconfig.py: use platlibdir also for purelib + +This is needed in multilib configurations where hardcoding 'lib' +is not correct. + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin <alex@linutronix.de> + +--- + Lib/sysconfig.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py +index 122d441..79c0510 100644 +--- a/Lib/sysconfig.py ++++ b/Lib/sysconfig.py +@@ -28,7 +28,7 @@ _INSTALL_SCHEMES = { + 'posix_prefix': { + 'stdlib': '{installed_base}/{platlibdir}/python{py_version_short}', + 'platstdlib': '{platbase}/{platlibdir}/python{py_version_short}', +- 'purelib': '{base}/lib/python{py_version_short}/site-packages', ++ 'purelib': '{base}/{platlibdir}/python{py_version_short}/site-packages', + 'platlib': '{platbase}/{platlibdir}/python{py_version_short}/site-packages', + 'include': + '{installed_base}/include/python{py_version_short}{abiflags}', diff --git a/meta/recipes-devtools/python/python3/0001-test_ctypes.test_find-skip-without-tools-sdk.patch b/meta/recipes-devtools/python/python3/0001-test_ctypes.test_find-skip-without-tools-sdk.patch new file mode 100644 index 0000000000..b4fe946cba --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-test_ctypes.test_find-skip-without-tools-sdk.patch @@ -0,0 +1,34 @@ +From b64c131a576a4b4f821514e711ab91b1394fb4ff Mon Sep 17 00:00:00 2001 +From: Tim Orling <timothy.t.orling@intel.com> +Date: Fri, 18 Jun 2021 11:56:50 -0700 +Subject: [PATCH] test_ctypes.test_find: skip without tools-sdk + +These tests need full packagegroup-core-buildessential, the +easiest way to dynamically check for that is looking for +'tools-sdk' in IMAGE_FEATURES. + +Upstream-Status: Inappropriate [oe-specific] + +Signed-off-by: Tim Orling <timothy.t.orling@intel.com> + +--- + Lib/test/test_ctypes/test_find.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Lib/test/test_ctypes/test_find.py b/Lib/test/test_ctypes/test_find.py +index 1ff9d01..59def26 100644 +--- a/Lib/test/test_ctypes/test_find.py ++++ b/Lib/test/test_ctypes/test_find.py +@@ -113,10 +113,12 @@ class FindLibraryLinux(unittest.TestCase): + # LD_LIBRARY_PATH) + self.assertEqual(find_library(libname), 'lib%s.so' % libname) + ++ @unittest.skip("Needs IMAGE_FEATURE += \"tools-sdk\"") + def test_find_library_with_gcc(self): + with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None): + self.assertNotEqual(find_library('c'), None) + ++ @unittest.skip("Needs IMAGE_FEATURE += \"tools-sdk\"") + def test_find_library_with_ld(self): + with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None), \ + unittest.mock.patch("ctypes.util._findLib_gcc", lambda *args: None): diff --git a/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch b/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch index 35b7e0c480..410a9fc7f1 100644 --- a/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch +++ b/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch @@ -1,4 +1,4 @@ -From b94995e0c694ec9561efec0d1a59b323340e6105 Mon Sep 17 00:00:00 2001 +From ef5728f0af14da5c9f80b0f038fe5bf6d44cb0e9 Mon Sep 17 00:00:00 2001 From: Mingli Yu <mingli.yu@windriver.com> Date: Mon, 5 Aug 2019 15:57:39 +0800 Subject: [PATCH] test_locale.py: correct the test output format @@ -23,24 +23,24 @@ Before this patch: Upstream-Status: Submitted [https://github.com/python/cpython/pull/15132] +Rebased for 3.9.4, still not accepted upstream Signed-off-by: Alejandro Hernandez <alejandro@enedino.org> + Signed-off-by: Mingli Yu <mingli.yu@windriver.com> + --- Lib/test/test_locale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py -index e2c2178..558d63c 100644 +index b0d7998..cb12153 100644 --- a/Lib/test/test_locale.py +++ b/Lib/test/test_locale.py -@@ -527,7 +527,7 @@ class TestMiscellaneous(unittest.TestCase): +@@ -557,7 +557,7 @@ class TestMiscellaneous(unittest.TestCase): self.skipTest('test needs Turkish locale') loc = locale.getlocale(locale.LC_CTYPE) if verbose: - print('testing with %a' % (loc,), end=' ', flush=True) + print('testing with %a...' % (loc,), end=' ', flush=True) - locale.setlocale(locale.LC_CTYPE, loc) - self.assertEqual(loc, locale.getlocale(locale.LC_CTYPE)) - --- -2.7.4 - + try: + locale.setlocale(locale.LC_CTYPE, loc) + except locale.Error as exc: diff --git a/meta/recipes-devtools/python/python3/0001-test_shutdown-skip-problematic-test.patch b/meta/recipes-devtools/python/python3/0001-test_shutdown-skip-problematic-test.patch new file mode 100644 index 0000000000..1d4cda18b1 --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-test_shutdown-skip-problematic-test.patch @@ -0,0 +1,46 @@ +From 9d4cdbde100798ba9fa1cf3f82dbaf18fd10a543 Mon Sep 17 00:00:00 2001 +From: Trevor Gamblin <tgamblin@baylibre.com> +Date: Wed, 8 May 2024 11:58:09 -0400 +Subject: [PATCH] test_shutdown: skip problematic test + +This test hangs frequently when run on the Autobuilder. Disable it in +testing until the cause can be determined. + +Upstream-Status: Inappropriate [OE-Specific] + +Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> +--- + Lib/test/test_concurrent_futures/test_shutdown.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/Lib/test/test_concurrent_futures/test_shutdown.py b/Lib/test/test_concurrent_futures/test_shutdown.py +index 7a4065afd4..6b878a48bf 100644 +--- a/Lib/test/test_concurrent_futures/test_shutdown.py ++++ b/Lib/test/test_concurrent_futures/test_shutdown.py +@@ -20,6 +20,7 @@ def sleep_and_print(t, msg): + sys.stdout.flush() + + ++@unittest.skip("skipping problematic test") + class ExecutorShutdownTest: + def test_run_after_shutdown(self): + self.executor.shutdown() +@@ -156,6 +157,7 @@ def timeout(_signum, _frame): + signal.signal(signal.SIGALRM, old_handler) + + ++@unittest.skip("skipping problematic test") + class ThreadPoolShutdownTest(ThreadPoolMixin, ExecutorShutdownTest, BaseTestCase): + def test_threads_terminate(self): + def acquire_lock(lock): +@@ -252,6 +254,7 @@ def test_cancel_futures_wait_false(self): + self.assertIn(out.strip(), [b"apple", b""]) + + ++@unittest.skip("skipping problematic test") + class ProcessPoolShutdownTest(ExecutorShutdownTest): + def test_processes_terminate(self): + def acquire_lock(lock): +-- +2.45.0 + diff --git a/meta/recipes-devtools/python/python3/0001-test_storlines-skip-due-to-load-variability.patch b/meta/recipes-devtools/python/python3/0001-test_storlines-skip-due-to-load-variability.patch new file mode 100644 index 0000000000..0d0eb08459 --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-test_storlines-skip-due-to-load-variability.patch @@ -0,0 +1,30 @@ +From dc69a1afdb3ba619705ff71e14f19ed3142e422f Mon Sep 17 00:00:00 2001 +From: Trevor Gamblin <tgamblin@baylibre.com> +Date: Fri, 6 Oct 2023 10:59:44 -0400 +Subject: [PATCH] test_storlines: skip due to load variability + +This is yet another test that intermittently fails on the Yocto AB when +a worker is under heavy load, so skip it during testing. + +Upstream-Status: Inappropriate [OE-Specific] + +[YOCTO #14933] + +Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> + +--- + Lib/test/test_ftplib.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py +index 2f191ea..dc29346 100644 +--- a/Lib/test/test_ftplib.py ++++ b/Lib/test/test_ftplib.py +@@ -626,6 +626,7 @@ class TestFTPClass(TestCase): + self.client.storbinary('stor', f, rest=r) + self.assertEqual(self.server.handler_instance.rest, str(r)) + ++ @unittest.skip('timing related test, dependent on load') + def test_storlines(self): + data = RETR_DATA.replace('\r\n', '\n').encode(self.client.encoding) + f = io.BytesIO(data) diff --git a/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch b/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch deleted file mode 100644 index 4bd98f62fd..0000000000 --- a/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch +++ /dev/null @@ -1,32 +0,0 @@ -From a2dd127b4163aff6cc35af0d0251321964232ad4 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Mon, 7 Oct 2019 13:22:14 +0200 -Subject: [PATCH] setup.py: do not report missing dependencies for disabled - modules - -Reporting those missing dependencies is misleading as the modules would not -have been built anyway. This particularly matters in oe-core's automated -build completeness checker which relies on the report. - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - ---- - setup.py | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/setup.py b/setup.py -index 7691258..ec3f2a4 100644 ---- a/setup.py -+++ b/setup.py -@@ -408,6 +408,10 @@ class PyBuildExt(build_ext): - print("%-*s %-*s %-*s" % (longest, e, longest, f, - longest, g)) - -+ # There is no need to report missing module dependencies, -+ # if the modules have been disabled in the first place. -+ self.missing = list(set(self.missing) - set(sysconf_dis)) -+ - if self.missing: - print() - print("Python build finished successfully!") diff --git a/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch b/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch index e04a91605c..0661249bfd 100644 --- a/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch +++ b/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch @@ -1,8 +1,7 @@ -From 863c09f640a5dfd33ff22915b0d5fee7bc5df70a Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Sun, 16 Feb 2020 17:50:25 +0100 -Subject: [PATCH] configure.ac, setup.py: do not add a curses include path from - the host +From d0205c60d08f51d84bd8ddc07a57e8c71710fdad Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex@linutronix.de> +Date: Fri, 17 Nov 2023 14:16:40 +0100 +Subject: [PATCH] configure.ac: do not add a curses include path from the host This leads to host contamination, and particularly can cause curses modules to fail at runtime if the host curses is configured @@ -13,16 +12,15 @@ Upstream-Status: Inappropriate [oe-core specific] Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> --- configure.ac | 6 ------ - setup.py | 2 -- - 2 files changed, 8 deletions(-) + 1 file changed, 6 deletions(-) diff --git a/configure.ac b/configure.ac -index 915f475..c911011 100644 +index c49cd4f..affdedf 100644 --- a/configure.ac +++ b/configure.ac -@@ -4828,12 +4828,6 @@ then - [Define if you have struct stat.st_mtimensec]) - fi +@@ -6508,12 +6508,6 @@ AS_VAR_IF([have_panel], [no], [ + AC_MSG_RESULT([$have_panel (CFLAGS: $PANEL_CFLAGS, LIBS: $PANEL_LIBS)]) + ]) -# first curses header check -ac_save_cppflags="$CPPFLAGS" @@ -30,19 +28,6 @@ index 915f475..c911011 100644 - CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" -fi - - AC_CHECK_HEADERS(curses.h ncurses.h) - # On Solaris, term.h requires curses.h -diff --git a/setup.py b/setup.py -index b0f1541..7208cd0 100644 ---- a/setup.py -+++ b/setup.py -@@ -973,8 +973,6 @@ class PyBuildExt(build_ext): - panel_library = 'panel' - if curses_library == 'ncursesw': - curses_defines.append(('HAVE_NCURSESW', '1')) -- if not CROSS_COMPILING: -- curses_includes.append('/usr/include/ncursesw') - # Bug 1464056: If _curses.so links with ncursesw, - # _curses_panel.so must link with panelw. - panel_library = 'panelw' + AC_CHECK_HEADERS([term.h], [], [], [ + #ifdef HAVE_CURSES_H diff --git a/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch deleted file mode 100644 index 61ac3e71dc..0000000000 --- a/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 251347fc970a397a9cd63ed3f87c5e6c52e15187 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Tue, 14 May 2013 15:00:26 -0700 -Subject: [PATCH] python3: Add target and native recipes - -Upstream-Status: Inappropriate [embedded specific] - -02/2015 Rebased for Python 3.4.2 - -# The proper prefix is inside our staging area. -# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de> -# Signed-off-by: Phil Blundell <philb@gnu.org> -# Signed-off-by: Khem Raj <raj.khem@gmail.com> -# Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> - ---- - Lib/distutils/sysconfig.py | 14 +++++++++++--- - 1 file changed, 11 insertions(+), 3 deletions(-) - -diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py -index 2df348c..4f8db84 100644 ---- a/Lib/distutils/sysconfig.py -+++ b/Lib/distutils/sysconfig.py -@@ -96,7 +96,9 @@ def get_python_inc(plat_specific=0, prefix=None): - If 'prefix' is supplied, use it instead of sys.base_prefix or - sys.base_exec_prefix -- i.e., ignore 'plat_specific'. - """ -- if prefix is None: -+ if prefix is None and os.environ.get('STAGING_INCDIR', ""): -+ prefix = os.environ['STAGING_INCDIR'].rstrip('include') -+ elif prefix is None: - prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX - if os.name == "posix": - if python_build: -@@ -139,7 +141,13 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): - If 'prefix' is supplied, use it instead of sys.base_prefix or - sys.base_exec_prefix -- i.e., ignore 'plat_specific'. - """ -- if prefix is None: -+ if os.environ.get('STAGING_LIBDIR', ""): -+ lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1] -+ else: -+ lib_basename = "lib" -+ if prefix is None and os.environ.get('STAGING_LIBDIR', ""): -+ prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename) -+ elif prefix is None: - if standard_lib: - prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX - else: -@@ -147,7 +155,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): - - if os.name == "posix": - libpython = os.path.join(prefix, -- "lib", "python" + get_python_version()) -+ lib_basename, "python" + get_python_version()) - if standard_lib: - return libpython - else: diff --git a/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch b/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch deleted file mode 100644 index 184540e794..0000000000 --- a/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch +++ /dev/null @@ -1,31 +0,0 @@ -From ba7202700578d435b07cfdfb7b57e83185752800 Mon Sep 17 00:00:00 2001 -From: Andrei Gherzan <andrei@gherzan.ro> -Date: Mon, 28 Jan 2019 15:57:54 +0000 -Subject: [PATCH] _tkinter module needs tk module along with tcl. tk is not yet - integrated in yocto so we skip the check for this module. Avoid a warning by - not adding this module to missing variable. - -Upstream-Status: Inappropriate [distribution] - -Also simply disable the tk module since its not in DEPENDS. -Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> - ---- - setup.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/setup.py b/setup.py -index ab18ff0..7691258 100644 ---- a/setup.py -+++ b/setup.py -@@ -1706,8 +1706,8 @@ class PyBuildExt(build_ext): - self.detect_decimal() - self.detect_ctypes() - self.detect_multiprocessing() -- if not self.detect_tkinter(): -- self.missing.append('_tkinter') -+# if not self.detect_tkinter(): -+# self.missing.append('_tkinter') - self.detect_uuid() - - ## # Uncomment these lines if you want to play with xxmodule.c diff --git a/meta/recipes-devtools/python/python3/cgi_py.patch b/meta/recipes-devtools/python/python3/cgi_py.patch index 6c4ba54320..8262c88e73 100644 --- a/meta/recipes-devtools/python/python3/cgi_py.patch +++ b/meta/recipes-devtools/python/python3/cgi_py.patch @@ -1,4 +1,4 @@ -From 62336285cba38017b35cb761c03f0c7e80a671a3 Mon Sep 17 00:00:00 2001 +From a56778372fe8dc7c42f5ffd911d89498c22dd064 Mon Sep 17 00:00:00 2001 From: Mark Hatle <mark.hatle@windriver.com> Date: Wed, 21 Sep 2011 20:55:33 -0500 Subject: [PATCH] Lib/cgi.py: Update the script as mentioned in the comment @@ -12,7 +12,7 @@ Signed-off-by: Mark Hatle <mark.hatle@windriver.com> 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Lib/cgi.py b/Lib/cgi.py -index 8cf6687..094c7b4 100755 +index 8787567..ebe8652 100755 --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -1,13 +1,4 @@ diff --git a/meta/recipes-devtools/python/python3/create_manifest3.py b/meta/recipes-devtools/python/python3/create_manifest3.py index 4da02a2991..045240ea0b 100644 --- a/meta/recipes-devtools/python/python3/create_manifest3.py +++ b/meta/recipes-devtools/python/python3/create_manifest3.py @@ -36,7 +36,7 @@ # Tha method to handle cached files does not work when a module includes a folder which # itself contains the pycache folder, gladly this is almost never the case. # -# Author: Alejandro Enedino Hernandez Samaniego "aehs29" <aehs29 at gmail dot com> +# Author: Alejandro Enedino Hernandez Samaniego <alejandro at enedino dot org> import sys @@ -45,6 +45,11 @@ import json import os import collections +if '-d' in sys.argv: + debugFlag = '-d' +else: + debugFlag = '' + # Get python version from ${PYTHON_MAJMIN} pyversion = str(sys.argv[1]) @@ -84,6 +89,12 @@ def prepend_comments(comments, json_manifest): manifest.seek(0, 0) manifest.write(comments + json_contents) +def print_indent(msg, offset): + for l in msg.splitlines(): + msg = ' ' * offset + l + print(msg) + + # Read existing JSON manifest with open('python3-manifest.json') as manifest: # The JSON format doesn't allow comments so we hack the call to keep the comments using a marker @@ -99,7 +110,7 @@ with open('python3-manifest.json') as manifest: # Not exactly the same so it should not be a function # -print ('Getting dependencies for package: core') +print_indent('Getting dependencies for package: core', 0) # This special call gets the core dependencies and @@ -109,7 +120,7 @@ print ('Getting dependencies for package: core') # on the new core package, they will still find them # even when checking the old_manifest -output = subprocess.check_output([sys.executable, 'get_module_deps3.py', 'python-core-package']).decode('utf8') +output = subprocess.check_output([sys.executable, 'get_module_deps3.py', 'python-core-package', '%s' % debugFlag]).decode('utf8') for coredep in output.split(): coredep = coredep.replace(pyversion,'${PYTHON_MAJMIN}') if isCached(coredep): @@ -149,17 +160,16 @@ for filedep in old_manifest['core']['files']: # Get actual module name , shouldnt be affected by libdir/bindir, etc. pymodule = os.path.splitext(os.path.basename(os.path.normpath(filedep)))[0] - # We now know that were dealing with a python module, so we can import it # and check what its dependencies are. # We launch a separate task for each module for deterministic behavior. # Each module will only import what is necessary for it to work in specific. # The output of each task will contain each module's dependencies - print ('Getting dependencies for module: %s' % pymodule) - output = subprocess.check_output([sys.executable, 'get_module_deps3.py', '%s' % pymodule]).decode('utf8') - print ('The following dependencies were found for module %s:\n' % pymodule) - print (output) + print_indent('Getting dependencies for module: %s' % pymodule, 2) + output = subprocess.check_output([sys.executable, 'get_module_deps3.py', '%s' % pymodule, '%s' % debugFlag]).decode('utf8') + print_indent('The following dependencies were found for module %s:\n' % pymodule, 4) + print_indent(output, 6) for pymodule_dep in output.split(): @@ -178,12 +188,13 @@ for filedep in old_manifest['core']['files']: # all others will use this a base. +print('\n\nChecking for directories...\n') # To improve the script speed, we check which packages contain directories # since we will be looping through (only) those later. for pypkg in old_manifest: for filedep in old_manifest[pypkg]['files']: if isFolder(filedep): - print ('%s is a folder' % filedep) + print_indent('%s is a directory' % filedep, 2) if pypkg not in hasfolders: hasfolders.append(pypkg) if filedep not in allfolders: @@ -221,14 +232,14 @@ for pypkg in old_manifest: print('\n') print('--------------------------') - print ('Handling package %s' % pypkg) + print('Handling package %s' % pypkg) print('--------------------------') # Handle special cases, we assume that when they were manually added # to the manifest we knew what we were doing. special_packages = ['misc', 'modules', 'dev', 'tests'] if pypkg in special_packages or 'staticdev' in pypkg: - print('Passing %s package directly' % pypkg) + print_indent('Passing %s package directly' % pypkg, 2) new_manifest[pypkg] = old_manifest[pypkg] continue @@ -259,7 +270,7 @@ for pypkg in old_manifest: # Get actual module name , shouldnt be affected by libdir/bindir, etc. # We need to check if the imported module comes from another (e.g. sqlite3.dump) - path,pymodule = os.path.split(filedep) + path, pymodule = os.path.split(filedep) path = os.path.basename(path) pymodule = os.path.splitext(os.path.basename(pymodule))[0] @@ -279,10 +290,10 @@ for pypkg in old_manifest: # Each module will only import what is necessary for it to work in specific. # The output of each task will contain each module's dependencies - print ('\nGetting dependencies for module: %s' % pymodule) - output = subprocess.check_output([sys.executable, 'get_module_deps3.py', '%s' % pymodule]).decode('utf8') - print ('The following dependencies were found for module %s:\n' % pymodule) - print (output) + print_indent('\nGetting dependencies for module: %s' % pymodule, 2) + output = subprocess.check_output([sys.executable, 'get_module_deps3.py', '%s' % pymodule, '%s' % debugFlag]).decode('utf8') + print_indent('The following dependencies were found for module %s:\n' % pymodule, 4) + print_indent(output, 6) reportFILES = [] reportRDEPS = [] @@ -325,7 +336,7 @@ for pypkg in old_manifest: # print('Checking folder %s on package %s' % (pymodule_dep,pypkg_with_folder)) for folder_dep in old_manifest[pypkg_with_folder]['files'] or folder_dep in old_manifest[pypkg_with_folder]['cached']: if folder_dep == folder: - print ('%s folder found in %s' % (folder, pypkg_with_folder)) + print ('%s directory found in %s' % (folder, pypkg_with_folder)) folderFound = True if pypkg_with_folder not in new_manifest[pypkg]['rdepends'] and pypkg_with_folder != pypkg: new_manifest[pypkg]['rdepends'].append(pypkg_with_folder) @@ -424,7 +435,7 @@ prepend_comments(comments,'python3-manifest.json.new') if (repeated): error_msg = '\n\nERROR:\n' - error_msg += 'The following files are repeated (contained in more than one package),\n' + error_msg += 'The following files were found in more than one package),\n' error_msg += 'this is likely to happen when new files are introduced after an upgrade,\n' error_msg += 'please check which package should get it,\n modify the manifest accordingly and re-run the create_manifest task:\n' error_msg += '\n'.join(repeated) diff --git a/meta/recipes-devtools/python/python3/crosspythonpath.patch b/meta/recipes-devtools/python/python3/crosspythonpath.patch index d789ab57d4..2c4aef0511 100644 --- a/meta/recipes-devtools/python/python3/crosspythonpath.patch +++ b/meta/recipes-devtools/python/python3/crosspythonpath.patch @@ -1,4 +1,8 @@ -configure.ac: add CROSSPYTHONPATH into PYTHONPATH for PYTHON_FOR_BUILD +From 5b66463c10fec1440e977d5a21a0167862d6d79c Mon Sep 17 00:00:00 2001 +From: Ricardo Ribalda <ricardo@ribalda.com> +Date: Tue, 18 Nov 2014 03:35:33 -0500 +Subject: [PATCH] configure.ac: add CROSSPYTHONPATH into PYTHONPATH for + PYTHON_FOR_BUILD When building x86->x86 the system will try to execute .so and related items from the default PYTHONPATH. This will fail if the target CPU contains @@ -10,16 +14,21 @@ Upstream-Status: Inappropriate [OE-Core integration specific] Credits-to: Mark Hatle <mark.hatle@windriver.com> Credits-to: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com> + +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + diff --git a/configure.ac b/configure.ac -index 4ab19a6..7036a53 100644 +index cb9e198..d81c19a 100644 --- a/configure.ac +++ b/configure.ac -@@ -76,7 +76,7 @@ if test "$cross_compiling" = yes; then - AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found]) - fi - AC_MSG_RESULT($interp) -- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$interp -+ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(CROSSPYTHONPATH):$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$interp - fi - elif test "$cross_compiling" = maybe; then - AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH]) +@@ -165,7 +165,7 @@ AC_ARG_WITH([build-python], + dnl Build Python interpreter is used for regeneration and freezing. + ac_cv_prog_PYTHON_FOR_REGEN=$with_build_python + PYTHON_FOR_FREEZE="$with_build_python" +- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$with_build_python ++ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(CROSSPYTHONPATH):$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$with_build_python + AC_MSG_RESULT([$with_build_python]) + ], [ + AS_VAR_IF([cross_compiling], [yes], diff --git a/meta/recipes-devtools/python/python3/deterministic_imports.patch b/meta/recipes-devtools/python/python3/deterministic_imports.patch new file mode 100644 index 0000000000..104df94964 --- /dev/null +++ b/meta/recipes-devtools/python/python3/deterministic_imports.patch @@ -0,0 +1,40 @@ +From 039d5e652796b55f1132afa568c7432b6ed89afd Mon Sep 17 00:00:00 2001 +From: Richard Purdie <richard.purdie@linuxfoundation.org> +Date: Fri, 27 May 2022 17:05:44 +0100 +Subject: [PATCH] python3: Ensure stale empty python module directories don't + +There are two issues here. Firstly, the modules are accessed in on disk order. This +means behaviour seen on one system might not reproduce on another and is a real headache. + +Secondly, empty directories left behind by previous modules might be looked at. This +has caused a long string of different issues for us. + +As a result, patch this to a behaviour which works for us. + +Upstream-Status: Pending [need to talk to upstream to see if they'll take one or both fixes] +Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> + +--- + Lib/importlib/metadata/__init__.py | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/Lib/importlib/metadata/__init__.py b/Lib/importlib/metadata/__init__.py +index 82e0ce1..969cac4 100644 +--- a/Lib/importlib/metadata/__init__.py ++++ b/Lib/importlib/metadata/__init__.py +@@ -710,7 +710,14 @@ class Lookup: + self.infos = FreezableDefaultDict(list) + self.eggs = FreezableDefaultDict(list) + +- for child in path.children(): ++ for child in sorted(path.children()): ++ childpath = pathlib.Path(path.root, child) ++ try: ++ if childpath.is_dir() and not any(childpath.iterdir()): ++ # Empty directories aren't interesting ++ continue ++ except PermissionError: ++ continue + low = child.lower() + if low.endswith((".dist-info", ".egg-info")): + # rpartition is faster than splitext and suitable for this purpose. diff --git a/meta/recipes-devtools/python/python3/get_module_deps3.py b/meta/recipes-devtools/python/python3/get_module_deps3.py index fd12baad84..8e432b49af 100644 --- a/meta/recipes-devtools/python/python3/get_module_deps3.py +++ b/meta/recipes-devtools/python/python3/get_module_deps3.py @@ -3,12 +3,17 @@ # them out, the output of this execution will have all dependencies # for a specific module, which will be parsed an dealt on create_manifest.py # -# Author: Alejandro Enedino Hernandez Samaniego "aehs29" <aehs29@gmail.com> +# Author: Alejandro Enedino Hernandez Samaniego <alejandro at enedino dot org> -# We can get a log per module, for all the dependencies that were found, but its messy. -debug=False import sys +import os + +# We can get a log per module, for all the dependencies that were found, but its messy. +if '-d' in sys.argv: + debug = True +else: + debug = False # We can get a list of the modules which are currently required to run python # so we run python-core and get its modules, we then import what we need @@ -18,16 +23,16 @@ import sys # We use importlib to achieve this, so we also need to know what modules importlib needs import importlib -core_deps=set(sys.modules) +core_deps = set(sys.modules) def fix_path(dep_path): import os # We DONT want the path on our HOST system - pivot='recipe-sysroot-native' - dep_path=dep_path[dep_path.find(pivot)+len(pivot):] + pivot = 'recipe-sysroot-native' + dep_path = dep_path[dep_path.find(pivot)+len(pivot):] if '/usr/bin' in dep_path: - dep_path = dep_path.replace('/usr/bin''${bindir}') + dep_path = dep_path.replace('/usr/bin','${bindir}') # Handle multilib, is there a better way? if '/usr/lib32' in dep_path: @@ -45,19 +50,30 @@ def fix_path(dep_path): # Module to import was passed as an argument current_module = str(sys.argv[1]).rstrip() -if(debug==True): - log = open('log_%s' % current_module,'w') +if debug == True: + log = open('temp/log_%s' % current_module.strip('.*'),'w') log.write('Module %s generated the following dependencies:\n' % current_module) -try: - importlib.import_module('%s' % current_module) +try: + m = importlib.import_module(current_module) + # handle python packages which may not include all modules in the __init__ + if hasattr(m, '__file__') and os.path.basename(m.__file__) == "__init__.py": + modulepath = os.path.dirname(m.__file__) + for i in os.listdir(modulepath): + if i.startswith("_") or not(i.endswith(".py")): + continue + submodule = "{}.{}".format(current_module, i[:-3]) + try: + importlib.import_module(submodule) + except: + pass # ignore all import or other exceptions raised during import except ImportError as e: - if (debug==True): - log.write('Module was not found') + if debug == True: + log.write('Module was not found\n') pass # Get current module dependencies, dif will contain a list of specific deps for this module -module_deps=set(sys.modules) +module_deps = set(sys.modules) # We handle the core package (1st pass on create_manifest.py) as a special case if current_module == 'python-core-package': @@ -69,14 +85,18 @@ else: # Check where each dependency came from for item in dif: - dep_path='' + # Main module returns script filename, __main matches mp_main__ as well + if 'main__' in item: + continue + + dep_path = '' try: - if (debug==True): - log.write('Calling: sys.modules[' + '%s' % item + '].__file__\n') + if debug == True: + log.write('\nCalling: sys.modules[' + '%s' % item + '].__file__\n') dep_path = sys.modules['%s' % item].__file__ except AttributeError as e: # Deals with thread (builtin module) not having __file__ attribute - if debug==True: + if debug == True: log.write(item + ' ') log.write(str(e)) log.write('\n') @@ -84,11 +104,16 @@ for item in dif: except NameError as e: # Deals with NameError: name 'dep_path' is not defined # because module is not found (wasn't compiled?), e.g. bddsm - if (debug==True): + if debug == True: log.write(item+' ') log.write(str(e)) pass + if dep_path == '': + continue + if debug == True: + log.write('Dependency path found:\n%s\n' % dep_path) + # Site-customize is a special case since we (OpenEmbedded) put it there manually if 'sitecustomize' in dep_path: dep_path = '${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py' @@ -99,48 +124,51 @@ for item in dif: dep_path = fix_path(dep_path) import sysconfig - soabi=sysconfig.get_config_var('SOABI') + soabi = sysconfig.get_config_var('SOABI') # Check if its a shared library and deconstruct it if soabi in dep_path: - if (debug==True): - log.write('Shared library found in %s' % dep_path) + if debug == True: + log.write('Shared library found in %s\n' % dep_path) dep_path = dep_path.replace(soabi,'*') print (dep_path) continue + if "_sysconfigdata" in dep_path: + dep_path = dep_path.replace(sysconfig._get_sysconfigdata_name(), "_sysconfigdata*") - if (debug==True): + if debug == True: log.write(dep_path+'\n') # Prints out result, which is what will be used by create_manifest print (dep_path) - import imp - cpython_tag = imp.get_tag() - cached='' + cpython_tag = sys.implementation.cache_tag + cached = '' # Theres no naive way to find *.pyc files on python3 try: - if (debug==True): - log.write('Calling: sys.modules[' + '%s' % item + '].__cached__\n') + if debug == True: + log.write('\nCalling: sys.modules[' + '%s' % item + '].__cached__\n') cached = sys.modules['%s' % item].__cached__ except AttributeError as e: # Deals with thread (builtin module) not having __cached__ attribute - if debug==True: + if debug == True: log.write(item + ' ') log.write(str(e)) log.write('\n') pass except NameError as e: # Deals with NameError: name 'cached' is not defined - if (debug==True): + if debug == True: log.write(item+' ') log.write(str(e)) pass if cached is not None: - if (debug==True): - log.write(cached) + if debug == True: + log.write(cached + '\n') cached = fix_path(cached) cached = cached.replace(cpython_tag,'*') + if "_sysconfigdata" in cached: + cached = cached.replace(sysconfig._get_sysconfigdata_name(), "_sysconfigdata*") print (cached) -if debug==True: +if debug == True: log.close() diff --git a/meta/recipes-devtools/python/python3/makerace.patch b/meta/recipes-devtools/python/python3/makerace.patch new file mode 100644 index 0000000000..c1b20703e6 --- /dev/null +++ b/meta/recipes-devtools/python/python3/makerace.patch @@ -0,0 +1,31 @@ +From 9f827c29adbe656af3c8fc963fdd8f47aec0c442 Mon Sep 17 00:00:00 2001 +From: Richard Purdie <richard.purdie@linuxfoundation.org> +Date: Tue, 13 Jul 2021 23:19:29 +0100 +Subject: [PATCH] python3: Fix make race + +libainstall installs python-config.py but the .pyc cache files are generated +by the libinstall target. This means some builds may not generate the pyc files +for python-config.py depending on the order things happen in. This means builds +are not always reproducible. + +Add a dependency to avoid the race. + +Upstream-Status: Pending +Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> +--- + Makefile.pre.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 381feb0..77bf09a 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -2250,7 +2250,7 @@ COMPILEALL_OPTS=-j0 + TEST_MODULES=@TEST_MODULES@ + + .PHONY: libinstall +-libinstall: all $(srcdir)/Modules/xxmodule.c ++libinstall: all $(srcdir)/Modules/xxmodule.c libainstall + @for i in $(SCRIPTDIR) $(LIBDEST); \ + do \ + if test ! -d $(DESTDIR)$$i; then \ diff --git a/meta/recipes-devtools/python/python3/python-config.patch b/meta/recipes-devtools/python/python3/python-config.patch deleted file mode 100644 index c8a8f3d4aa..0000000000 --- a/meta/recipes-devtools/python/python3/python-config.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 07df0ae0d70cba6d1847fe1c24a71063930bec60 Mon Sep 17 00:00:00 2001 -From: Tyler Hall <tylerwhall@gmail.com> -Date: Sun, 4 May 2014 20:06:43 -0400 -Subject: [PATCH] python-config: Revert to using distutils.sysconfig - -The newer sysconfig module shares some code with distutils.sysconfig, but the same modifications as in - -12-distutils-prefix-is-inside-staging-area.patch makes distutils.sysconfig - -affect the native runtime as well as cross building. Use the old, patched -implementation which returns paths in the staging directory and for the target, -as appropriate. - -Upstream-Status: Inappropriate [Embedded Specific] - -Signed-off-by: Tyler Hall <tylerwhall@gmail.com> -: - ---- - Misc/python-config.in | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/Misc/python-config.in b/Misc/python-config.in -index 727c4a8..c702829 100644 ---- a/Misc/python-config.in -+++ b/Misc/python-config.in -@@ -6,7 +6,7 @@ - import getopt - import os - import sys --import sysconfig -+from distutils import sysconfig - - valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags', - 'ldflags', 'extension-suffix', 'help', 'abiflags', 'configdir', -@@ -35,14 +35,14 @@ if '--help' in opt_flags: - - for opt in opt_flags: - if opt == '--prefix': -- print(sysconfig.get_config_var('prefix')) -+ print(sysconfig.PREFIX) - - elif opt == '--exec-prefix': -- print(sysconfig.get_config_var('exec_prefix')) -+ print(sysconfig.EXEC_PREFIX) - - elif opt in ('--includes', '--cflags'): -- flags = ['-I' + sysconfig.get_path('include'), -- '-I' + sysconfig.get_path('platinclude')] -+ flags = ['-I' + sysconfig.get_python_inc(), -+ '-I' + sysconfig.get_python_inc(plat_specific=True)] - if opt == '--cflags': - flags.extend(getvar('CFLAGS').split()) - print(' '.join(flags)) diff --git a/meta/recipes-devtools/python/python3/python3-manifest.json b/meta/recipes-devtools/python/python3/python3-manifest.json index 251271cb84..46092d4004 100644 --- a/meta/recipes-devtools/python/python3/python3-manifest.json +++ b/meta/recipes-devtools/python/python3/python3-manifest.json @@ -122,8 +122,7 @@ "logging", "netclient", "numbers", - "stringold", - "typing" + "stringold" ], "files": [ "${libdir}/python${PYTHON_MAJMIN}/asyncio", @@ -153,6 +152,23 @@ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/wave.*.pyc" ] }, + "cgitb": { + "summary": "Special exception handler for Python scripts", + "rdepends": [ + "core", + "crypt", + "html", + "io", + "math", + "pydoc" + ], + "files": [ + "${libdir}/python${PYTHON_MAJMIN}/cgitb.py" + ], + "cached": [ + "${libdir}/python${PYTHON_MAJMIN}/__pycache__/cgitb.*.pyc" + ] + }, "codecs": { "summary": "Python codec", "rdepends": [ @@ -173,10 +189,12 @@ ], "files": [ "${libdir}/python${PYTHON_MAJMIN}/compileall.py", + "${libdir}/python${PYTHON_MAJMIN}/filecmp.py", "${libdir}/python${PYTHON_MAJMIN}/py_compile.py" ], "cached": [ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/compileall.*.pyc", + "${libdir}/python${PYTHON_MAJMIN}/__pycache__/filecmp.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/py_compile.*.pyc" ] }, @@ -188,12 +206,12 @@ "files": [ "${libdir}/python${PYTHON_MAJMIN}/gzip.py", "${libdir}/python${PYTHON_MAJMIN}/tarfile.py", - "${libdir}/python${PYTHON_MAJMIN}/zipfile.py" + "${libdir}/python${PYTHON_MAJMIN}/zipfile", + "${libdir}/python${PYTHON_MAJMIN}/zipfile/_path" ], "cached": [ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/gzip.*.pyc", - "${libdir}/python${PYTHON_MAJMIN}/__pycache__/tarfile.*.pyc", - "${libdir}/python${PYTHON_MAJMIN}/__pycache__/zipfile.*.pyc" + "${libdir}/python${PYTHON_MAJMIN}/__pycache__/tarfile.*.pyc" ] }, "core": { @@ -231,6 +249,7 @@ "${libdir}/python${PYTHON_MAJMIN}/copy.py", "${libdir}/python${PYTHON_MAJMIN}/copyreg.py", "${libdir}/python${PYTHON_MAJMIN}/csv.py", + "${libdir}/python${PYTHON_MAJMIN}/dataclasses.py", "${libdir}/python${PYTHON_MAJMIN}/dis.py", "${libdir}/python${PYTHON_MAJMIN}/encodings", "${libdir}/python${PYTHON_MAJMIN}/encodings/aliases.py", @@ -245,6 +264,7 @@ "${libdir}/python${PYTHON_MAJMIN}/heapq.py", "${libdir}/python${PYTHON_MAJMIN}/imp.py", "${libdir}/python${PYTHON_MAJMIN}/importlib", + "${libdir}/python${PYTHON_MAJMIN}/importlib/_abc.py", "${libdir}/python${PYTHON_MAJMIN}/importlib/_bootstrap.py", "${libdir}/python${PYTHON_MAJMIN}/importlib/_bootstrap_external.py", "${libdir}/python${PYTHON_MAJMIN}/importlib/abc.py", @@ -252,6 +272,7 @@ "${libdir}/python${PYTHON_MAJMIN}/importlib/util.py", "${libdir}/python${PYTHON_MAJMIN}/inspect.py", "${libdir}/python${PYTHON_MAJMIN}/io.py", + "${libdir}/python${PYTHON_MAJMIN}/ipaddress.py", "${libdir}/python${PYTHON_MAJMIN}/keyword.py", "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/__pycache__/_struct.*.so", "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/__pycache__/binascii.*.so", @@ -265,6 +286,7 @@ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_opcode.*.so", "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_posixsubprocess.*.so", "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_struct.*.so", + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_typing.*.so", "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/array.*.so", "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/binascii.*.so", "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/grp.*.so", @@ -285,10 +307,15 @@ "${libdir}/python${PYTHON_MAJMIN}/operator.py", "${libdir}/python${PYTHON_MAJMIN}/optparse.py", "${libdir}/python${PYTHON_MAJMIN}/os.py", + "${libdir}/python${PYTHON_MAJMIN}/pathlib.py", "${libdir}/python${PYTHON_MAJMIN}/pkgutil.py", "${libdir}/python${PYTHON_MAJMIN}/platform.py", "${libdir}/python${PYTHON_MAJMIN}/posixpath.py", - "${libdir}/python${PYTHON_MAJMIN}/re.py", + "${libdir}/python${PYTHON_MAJMIN}/re", + "${libdir}/python${PYTHON_MAJMIN}/re/_casefix.py", + "${libdir}/python${PYTHON_MAJMIN}/re/_compiler.py", + "${libdir}/python${PYTHON_MAJMIN}/re/_constants.py", + "${libdir}/python${PYTHON_MAJMIN}/re/_parser.py", "${libdir}/python${PYTHON_MAJMIN}/reprlib.py", "${libdir}/python${PYTHON_MAJMIN}/rlcompleter.py", "${libdir}/python${PYTHON_MAJMIN}/runpy.py", @@ -312,8 +339,12 @@ "${libdir}/python${PYTHON_MAJMIN}/tokenize.py", "${libdir}/python${PYTHON_MAJMIN}/traceback.py", "${libdir}/python${PYTHON_MAJMIN}/types.py", + "${libdir}/python${PYTHON_MAJMIN}/typing.py", + "${libdir}/python${PYTHON_MAJMIN}/urllib", + "${libdir}/python${PYTHON_MAJMIN}/urllib/parse.py", "${libdir}/python${PYTHON_MAJMIN}/warnings.py", "${libdir}/python${PYTHON_MAJMIN}/weakref.py", + "${libdir}/python${PYTHON_MAJMIN}/zipimport.py", "${prefix}/lib/python${PYTHON_MAJMIN}/config*/*[!.a]" ], "cached": [ @@ -323,7 +354,7 @@ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/_compression.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/_markupbase.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/_sitebuiltins.*.pyc", - "${libdir}/python${PYTHON_MAJMIN}/__pycache__/_sysconfigdata.*.pyc", + "${libdir}/python${PYTHON_MAJMIN}/__pycache__/_sysconfigdata*.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/_weakrefset.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/abc.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/argparse.*.pyc", @@ -338,6 +369,7 @@ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/copy.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/copyreg.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/csv.*.pyc", + "${libdir}/python${PYTHON_MAJMIN}/__pycache__/dataclasses.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/dis.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/enum.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/fnmatch.*.pyc", @@ -349,6 +381,7 @@ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/imp.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/inspect.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/io.*.pyc", + "${libdir}/python${PYTHON_MAJMIN}/__pycache__/ipaddress.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/keyword.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/linecache.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/locale.*.pyc", @@ -358,6 +391,7 @@ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/operator.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/optparse.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/os.*.pyc", + "${libdir}/python${PYTHON_MAJMIN}/__pycache__/pathlib.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/pkgutil.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/platform.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/posixpath.*.pyc", @@ -384,6 +418,7 @@ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/tokenize.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/traceback.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/types.*.pyc", + "${libdir}/python${PYTHON_MAJMIN}/__pycache__/typing.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/warnings.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/weakref.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/collections/__pycache__", @@ -393,9 +428,17 @@ "${libdir}/python${PYTHON_MAJMIN}/encodings/__pycache__/latin_1.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/encodings/__pycache__/utf_8.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/importlib/__pycache__", + "${libdir}/python${PYTHON_MAJMIN}/importlib/__pycache__/_abc.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/importlib/__pycache__/abc.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/importlib/__pycache__/machinery.*.pyc", - "${libdir}/python${PYTHON_MAJMIN}/importlib/__pycache__/util.*.pyc" + "${libdir}/python${PYTHON_MAJMIN}/importlib/__pycache__/util.*.pyc", + "${libdir}/python${PYTHON_MAJMIN}/re/__pycache__", + "${libdir}/python${PYTHON_MAJMIN}/re/__pycache__/_casefix.*.pyc", + "${libdir}/python${PYTHON_MAJMIN}/re/__pycache__/_compiler.*.pyc", + "${libdir}/python${PYTHON_MAJMIN}/re/__pycache__/_constants.*.pyc", + "${libdir}/python${PYTHON_MAJMIN}/re/__pycache__/_parser.*.pyc", + "${libdir}/python${PYTHON_MAJMIN}/urllib/__pycache__", + "${libdir}/python${PYTHON_MAJMIN}/urllib/__pycache__/parse.*.pyc" ] }, "crypt": { @@ -413,9 +456,8 @@ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_hashlib.*.so", "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_md5.*.so", "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_sha1.*.so", - "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_sha256.*.so", - "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_sha3.*.so", - "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_sha512.*.so" + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_sha2.*.so", + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_sha3.*.so" ], "cached": [ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/crypt.*.pyc", @@ -425,7 +467,10 @@ "ctypes": { "summary": "Python C types support", "rdepends": [ - "core" + "core", + "crypt", + "io", + "math" ], "files": [ "${libdir}/python${PYTHON_MAJMIN}/ctypes", @@ -507,8 +552,7 @@ "${libdir}/pkgconfig" ], "rdepends": [ - "core", - "distutils" + "core" ], "summary": "Python development package" }, @@ -524,40 +568,15 @@ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/difflib.*.pyc" ] }, - "distutils-windows": { - "summary": "Python distribution utilities (Windows installer stubs)", - "rdepends": [ - "core" - ], - "files": [], - "cached": [] - }, - "distutils": { - "summary": "Python Distribution Utilities", - "rdepends": [ - "core" - ], - "files": [ - "${libdir}/python${PYTHON_MAJMIN}/distutils" - ], - "cached": [] - }, "doctest": { "summary": "Python framework for running examples in docstrings", "rdepends": [ - "asyncio", - "compression", "core", "debugger", "difflib", - "io", - "logging", - "netclient", - "numbers", "pprint", "shell", "stringold", - "typing", "unittest" ], "files": [ @@ -575,7 +594,9 @@ "datetime", "io", "math", - "netclient" + "mime", + "netclient", + "stringold" ], "files": [ "${libdir}/python${PYTHON_MAJMIN}/email", @@ -585,6 +606,16 @@ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/imaplib.*.pyc" ] }, + "ensurepip": { + "summary": "Support for bootstrapping the pip installer", + "rdepends": [ + "core" + ], + "files": [ + "${libdir}/python${PYTHON_MAJMIN}/ensurepip/" + ], + "cached": [] + }, "fcntl": { "summary": "Python's fcntl interface", "rdepends": [ @@ -611,12 +642,9 @@ "core" ], "files": [ - "${libdir}/python${PYTHON_MAJMIN}/formatter.py", "${libdir}/python${PYTHON_MAJMIN}/html" ], - "cached": [ - "${libdir}/python${PYTHON_MAJMIN}/__pycache__/formatter.*.pyc" - ] + "cached": [] }, "idle": { "summary": "Python Integrated Development Environment", @@ -646,7 +674,6 @@ "io": { "summary": "Python low-level I/O", "rdepends": [ - "compression", "core", "crypt", "math", @@ -655,7 +682,6 @@ ], "files": [ "${libdir}/python${PYTHON_MAJMIN}/_pyio.py", - "${libdir}/python${PYTHON_MAJMIN}/ipaddress.py", "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_socket.*.so", "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_ssl.*.so", "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/termios.*.so", @@ -666,7 +692,6 @@ ], "cached": [ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/_pyio.*.pyc", - "${libdir}/python${PYTHON_MAJMIN}/__pycache__/ipaddress.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/pipes.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/socket.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/ssl.*.pyc", @@ -688,7 +713,11 @@ "summary": "Python logging support", "rdepends": [ "core", - "stringold" + "io", + "netserver", + "pickle", + "stringold", + "threading" ], "files": [ "${libdir}/python${PYTHON_MAJMIN}/logging" @@ -702,7 +731,6 @@ "crypt", "datetime", "email", - "fcntl", "io", "math", "mime", @@ -773,9 +801,9 @@ "db", "debugger", "difflib", - "distutils", "doctest", "email", + "ensurepip", "fcntl", "html", "idle", @@ -799,22 +827,20 @@ "pydoc", "resource", "shell", - "smtpd", "sqlite3", + "statistics", "stringold", "syslog", "terminal", "threading", "tkinter", - "typing", + "tomllib", "unittest", "unixadmin", "venv", "xml", - "xmlrpc" - ], - "rrecommends": [ - "distutils-windows" + "xmlrpc", + "zoneinfo" ], "summary": "All Python modules" }, @@ -822,11 +848,18 @@ "summary": "Python multiprocessing support", "rdepends": [ "core", + "crypt", + "ctypes", "io", - "pickle" + "math", + "mmap", + "netclient", + "pickle", + "threading" ], "files": [ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_multiprocessing.*.so", + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_posixshmem.*.so", "${libdir}/python${PYTHON_MAJMIN}/multiprocessing" ], "cached": [] @@ -853,10 +886,10 @@ "${libdir}/python${PYTHON_MAJMIN}/mimetypes.py", "${libdir}/python${PYTHON_MAJMIN}/nntplib.py", "${libdir}/python${PYTHON_MAJMIN}/poplib.py", + "${libdir}/python${PYTHON_MAJMIN}/secrets.py", "${libdir}/python${PYTHON_MAJMIN}/smtplib.py", "${libdir}/python${PYTHON_MAJMIN}/telnetlib.py", "${libdir}/python${PYTHON_MAJMIN}/urllib", - "${libdir}/python${PYTHON_MAJMIN}/urllib/__pycache__", "${libdir}/python${PYTHON_MAJMIN}/uuid.py" ], "cached": [ @@ -866,6 +899,7 @@ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/mimetypes.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/nntplib.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/poplib.*.pyc", + "${libdir}/python${PYTHON_MAJMIN}/__pycache__/secrets.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/smtplib.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/telnetlib.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/uuid.*.pyc" @@ -874,7 +908,6 @@ "netserver": { "summary": "Python Internet Protocol servers", "rdepends": [ - "compression", "core", "crypt", "datetime", @@ -990,8 +1023,7 @@ "pydoc": { "summary": "Python interactive help support", "rdepends": [ - "core", - "netclient" + "core" ], "files": [ "${bindir}/pydoc*", @@ -1015,7 +1047,6 @@ "shell": { "summary": "Python shell-like functionality", "rdepends": [ - "compression", "core", "stringold" ], @@ -1030,31 +1061,6 @@ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/shlex.*.pyc" ] }, - "smtpd": { - "summary": "Python Simple Mail Transport Daemon", - "rdepends": [ - "core", - "crypt", - "datetime", - "email", - "io", - "math", - "mime", - "netclient", - "stringold" - ], - "files": [ - "${bindir}/smtpd.py", - "${libdir}/python${PYTHON_MAJMIN}/asynchat.py", - "${libdir}/python${PYTHON_MAJMIN}/asyncore.py", - "${libdir}/python${PYTHON_MAJMIN}/smtpd.py" - ], - "cached": [ - "${libdir}/python${PYTHON_MAJMIN}/__pycache__/asynchat.*.pyc", - "${libdir}/python${PYTHON_MAJMIN}/__pycache__/asyncore.*.pyc", - "${libdir}/python${PYTHON_MAJMIN}/__pycache__/smtpd.*.pyc" - ] - }, "sqlite3": { "summary": "Python Sqlite3 database support", "rdepends": [ @@ -1067,6 +1073,22 @@ ], "cached": [] }, + "statistics": { + "summary": "Basic statistics module", + "rdepends": [ + "core", + "crypt", + "math", + "numbers" + ], + "files": [ + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_statistics.*.so", + "${libdir}/python${PYTHON_MAJMIN}/statistics.py" + ], + "cached": [ + "${libdir}/python${PYTHON_MAJMIN}/__pycache__/statistics.*.pyc" + ] + }, "stringold": { "summary": "Python string APIs [deprecated]", "rdepends": [ @@ -1110,13 +1132,11 @@ "core" ], "files": [ - "${libdir}/python${PYTHON_MAJMIN}/_dummy_thread.py", "${libdir}/python${PYTHON_MAJMIN}/_threading_local.py", "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_queue.*.so", "${libdir}/python${PYTHON_MAJMIN}/queue.py" ], "cached": [ - "${libdir}/python${PYTHON_MAJMIN}/__pycache__/_dummy_thread.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/_threading_local.*.pyc", "${libdir}/python${PYTHON_MAJMIN}/__pycache__/queue.*.pyc" ] @@ -1132,23 +1152,32 @@ ], "cached": [] }, - "typing": { - "summary": "Python typing support", + "tomllib": { + "summary": "Provides an interface for parsing TOML", "rdepends": [ "core" ], "files": [ - "${libdir}/python${PYTHON_MAJMIN}/typing.py" + "${libdir}/python${PYTHON_MAJMIN}/tomllib/" + ], + "cached": [] + }, + "turtle": { + "summary": "Turtle graphics is a popular way for introducing programming to kids.", + "rdepends": [ + "tkinter" + ], + "files": [ + "${libdir}/python${PYTHON_MAJMIN}/turtle.py" ], "cached": [ - "${libdir}/python${PYTHON_MAJMIN}/__pycache__/typing.*.pyc" + "${libdir}/python${PYTHON_MAJMIN}/__pycache__/turtle.*.pyc" ] - }, + }, "unittest": { "summary": "Python unit testing framework", "rdepends": [ "asyncio", - "compression", "core", "difflib", "io", @@ -1156,8 +1185,7 @@ "netclient", "numbers", "pprint", - "stringold", - "typing" + "stringold" ], "files": [ "${libdir}/python${PYTHON_MAJMIN}/unittest", @@ -1183,7 +1211,6 @@ "venv": { "summary": "Provides support for creating lightweight virtual environments with their own site directories, optionally isolated from system site directories.", "rdepends": [ - "compression", "core", "logging", "stringold" @@ -1209,7 +1236,20 @@ "xmlrpc": { "summary": "Python XML-RPC support", "rdepends": [ + "compression", "core", + "crypt", + "datetime", + "email", + "html", + "io", + "math", + "mime", + "netclient", + "netserver", + "numbers", + "pydoc", + "stringold", "xml" ], "files": [ @@ -1217,5 +1257,30 @@ "${libdir}/python${PYTHON_MAJMIN}/xmlrpc/__pycache__" ], "cached": [] + }, + "zipapp": { + "summary": "Tools to manage the creation of zip files containing Python code", + "rdepends": [ + "compression", + "core" + ], + "files": [ + "${libdir}/python${PYTHON_MAJMIN}/zipapp.py" + ], + "cached": [ + "${libdir}/python${PYTHON_MAJMIN}/__pycache__/zipapp.*.pyc" + ] + }, + "zoneinfo": { + "summary": "IANA time zone support", + "rdepends": [ + "core", + "datetime" + ], + "files": [ + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_zoneinfo.*.so", + "${libdir}/python${PYTHON_MAJMIN}/zoneinfo" + ], + "cached": [] } } diff --git a/meta/recipes-devtools/python/python3/reformat_sysconfig.py b/meta/recipes-devtools/python/python3/reformat_sysconfig.py index c4164313e8..5e2b12879d 100644 --- a/meta/recipes-devtools/python/python3/reformat_sysconfig.py +++ b/meta/recipes-devtools/python/python3/reformat_sysconfig.py @@ -16,6 +16,6 @@ with open(sys.argv[1], 'r') as f: with open(sys.argv[1], 'w') as f: for k in sorted(l.keys()): f.write('%s = ' % k) - pprint.pprint(l[k], stream=f, width=sys.maxsize) + pprint.pprint(l[k], stream=f, width=1) f.write('\n') diff --git a/meta/recipes-devtools/python/python3/run-ptest b/meta/recipes-devtools/python/python3/run-ptest index 405b07f495..d1c26c11e2 100644 --- a/meta/recipes-devtools/python/python3/run-ptest +++ b/meta/recipes-devtools/python/python3/run-ptest @@ -1,3 +1,3 @@ #!/bin/sh - -python3 -m test -v | sed -u -e '/\.\.\. ok/ s/^/PASS: /g' -r -e '/\.\.\. (ERROR|FAIL)/ s/^/FAIL: /g' -e '/\.\.\. skipped/ s/^/SKIP: /g' -e 's/ \.\.\. ok//g' -e 's/ \.\.\. ERROR//g' -e 's/ \.\.\. FAIL//g' -e 's/ \.\.\. skipped//g' +SKIPPED_TESTS= +{ SETUPTOOLS_USE_DISTUTILS=nonlocal python3 -m test $SKIPPED_TESTS -v -j 4 || echo "FAIL: python3" ; } | sed -u -e '/\.\.\. ok/ s/^/PASS: /g' -r -e '/\.\.\. (ERROR|FAIL)/ s/^/FAIL: /g' -e '/\.\.\. skipped/ s/^/SKIP: /g' -e 's/ \.\.\. ok//g' -e 's/ \.\.\. ERROR//g' -e 's/ \.\.\. FAIL//g' -e 's/ \.\.\. skipped//g' |