diff options
Diffstat (limited to 'meta-python/recipes-devtools')
2 files changed, 48 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-posix-ipc/0004-build_support-handle-runtime-errors-and-return-None-.patch b/meta-python/recipes-devtools/python/python3-posix-ipc/0004-build_support-handle-runtime-errors-and-return-None-.patch new file mode 100644 index 0000000000..e84345a397 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-posix-ipc/0004-build_support-handle-runtime-errors-and-return-None-.patch | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | From b079074048bc33b206b21f73fecb8173cf8adaf0 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Haixiao Yan <haixiao.yan.cn@windriver.com> | ||
| 3 | Date: Mon, 15 Sep 2025 21:15:45 +0800 | ||
| 4 | Subject: [PATCH] build_support: handle runtime errors and return None for | ||
| 5 | invalid max_priority | ||
| 6 | |||
| 7 | When cross-compiling, test binaries may fail to execute on the host system if | ||
| 8 | the target toolchain was built against a newer glibc version than what is | ||
| 9 | available on the host. | ||
| 10 | |||
| 11 | For example, on Ubuntu 20.04 the following error occurs: | ||
| 12 | |||
| 13 | ./build_support/src/sniff_mq_prio_max: /lib/x86_64-linux-gnu/libc.so.6: version | ||
| 14 | `GLIBC_2.34' not found (required by ./build_support/src/sniff_mq_prio_max) | ||
| 15 | |||
| 16 | This change ensures that such runtime errors are gracefully handled, and | ||
| 17 | max_priority is set to None when the test binary cannot be executed. | ||
| 18 | |||
| 19 | Upstream-Status: Pending | ||
| 20 | |||
| 21 | Signed-off-by: Haixiao Yan <haixiao.yan.cn@windriver.com> | ||
| 22 | --- | ||
| 23 | build_support/discover_system_info.py | 8 ++++++-- | ||
| 24 | 1 file changed, 6 insertions(+), 2 deletions(-) | ||
| 25 | |||
| 26 | diff --git a/build_support/discover_system_info.py b/build_support/discover_system_info.py | ||
| 27 | index f6e6c8cbe6ba..4fec48b5529d 100644 | ||
| 28 | --- a/build_support/discover_system_info.py | ||
| 29 | +++ b/build_support/discover_system_info.py | ||
| 30 | @@ -75,8 +75,12 @@ def compile_and_run(filename, linker_options=""): | ||
| 31 | if does_build_succeed(filename, linker_options=""): | ||
| 32 | try: | ||
| 33 | s = subprocess.Popen(["./build_support/src/%s" % filename[:-2]], | ||
| 34 | - stdout=subprocess.PIPE).communicate()[0] | ||
| 35 | - return s.strip().decode() | ||
| 36 | + stdout=subprocess.PIPE, stderr=subprocess.PIPE) | ||
| 37 | + stdout, stderr = s.communicate() | ||
| 38 | + if s.returncode != 0: | ||
| 39 | + # runtime error | ||
| 40 | + return None | ||
| 41 | + return stdout.strip().decode() | ||
| 42 | except Exception: | ||
| 43 | # execution resulted in an error | ||
| 44 | return None | ||
| 45 | -- | ||
| 46 | 2.25.1 | ||
| 47 | |||
diff --git a/meta-python/recipes-devtools/python/python3-posix-ipc_1.2.0.bb b/meta-python/recipes-devtools/python/python3-posix-ipc_1.2.0.bb index 8147e4108b..cad1403813 100644 --- a/meta-python/recipes-devtools/python/python3-posix-ipc_1.2.0.bb +++ b/meta-python/recipes-devtools/python/python3-posix-ipc_1.2.0.bb | |||
| @@ -12,5 +12,6 @@ SRC_URI += " \ | |||
| 12 | file://0001-build_support-use-source-filename-instead-of-foo-for.patch \ | 12 | file://0001-build_support-use-source-filename-instead-of-foo-for.patch \ |
| 13 | file://0002-build_support-handle-empty-max_priority-value-as-Non.patch \ | 13 | file://0002-build_support-handle-empty-max_priority-value-as-Non.patch \ |
| 14 | file://0003-build_support-use-does_build_succeed-in-compile_and_.patch \ | 14 | file://0003-build_support-use-does_build_succeed-in-compile_and_.patch \ |
| 15 | file://0004-build_support-handle-runtime-errors-and-return-None-.patch \ | ||
| 15 | " | 16 | " |
| 16 | inherit pypi python_setuptools_build_meta | 17 | inherit pypi python_setuptools_build_meta |
