Message ID | 20250807102104.263783-1-haixiao.yan.cn@windriver.com |
---|---|
State | New |
Headers | show |
Series | [meta-openembedded,1/1] python3-posix-ipc: fix runtime error | expand |
Please test it with newer version where some of the .patch files submitted in: https://github.com/osvenskan/posix_ipc/pull/77 were replaced by: https://github.com/osvenskan/posix_ipc/pull/85 If it still doesn't work then report and submit it upstream. On Thu, Aug 7, 2025 at 12:21 PM Yan, Haixiao (CN) via lists.openembedded.org <Haixiao.Yan.CN=windriver.com@lists.openembedded.org> wrote: > > From: Haixiao Yan <haixiao.yan.cn@windriver.com> > > Fix follow runtime error: ./build_support/src/sniff_mq_prio_max: > /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by > ./build_support/src/sniff_mq_prio_max) > > Signed-off-by: Haixiao Yan <haixiao.yan.cn@windriver.com> > --- > ...ndle-runtime-errors-and-return-None-.patch | 57 +++++++++++++++++++ > .../python/python3-posix-ipc_1.2.0.bb | 1 + > 2 files changed, 58 insertions(+) > create mode 100644 meta-python/recipes-devtools/python/python3-posix-ipc/0004-build_support-handle-runtime-errors-and-return-None-.patch > > 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 000000000000..f4608e6443b5 > --- /dev/null > +++ b/meta-python/recipes-devtools/python/python3-posix-ipc/0004-build_support-handle-runtime-errors-and-return-None-.patch > @@ -0,0 +1,57 @@ > +From aea0522262cc7e2374131f25116a59303fdca8e5 Mon Sep 17 00:00:00 2001 > +From: Haixiao Yan <haixiao.yan.cn@windriver.com> > +Date: Thu, 7 Aug 2025 08:13:06 +0000 > +Subject: [PATCH] build_support: handle runtime errors and return None for > + invalid max_priority > + > +When cross-compiling, test binaries may fail to execute on the host system if > +the target toolchain was built against a newer glibc version than what is > +available on the host. > + > +For example, on Ubuntu 20.04 the following error occurs: > + > +./build_support/src/sniff_mq_prio_max: /lib/x86_64-linux-gnu/libc.so.6: version > +`GLIBC_2.34' not found (required by ./build_support/src/sniff_mq_prio_max) > + > +This change ensures that such runtime errors are gracefully handled, and > +max_priority is set to None when the test binary cannot be executed. > + > +Upstream-Status: Pending > + > +Signed-off-by: Haixiao Yan <haixiao.yan.cn@windriver.com> > +--- > + build_support/discover_system_info.py | 15 ++++++++++++--- > + 1 file changed, 12 insertions(+), 3 deletions(-) > + > +diff --git a/build_support/discover_system_info.py b/build_support/discover_system_info.py > +index f6e6c8cbe6ba..a0be60e51e24 100644 > +--- a/build_support/discover_system_info.py > ++++ b/build_support/discover_system_info.py > +@@ -73,12 +73,21 @@ def compile_and_run(filename, linker_options=""): > + # Utility function that returns the stdout output from running the > + # compiled source file; None if the compile fails. > + if does_build_succeed(filename, linker_options=""): > ++ debug = False > + try: > + s = subprocess.Popen(["./build_support/src/%s" % filename[:-2]], > +- stdout=subprocess.PIPE).communicate()[0] > +- return s.strip().decode() > +- except Exception: > ++ stdout=subprocess.PIPE, stderr=subprocess.PIPE) > ++ stdout, stderr = s.communicate() > ++ if s.returncode != 0: > ++ # runtime error > ++ if debug: > ++ print("Execution error:", stderr.decode().strip()) > ++ return None > ++ return stdout.strip().decode() > ++ except Exception as e: > + # execution resulted in an error > ++ if debug: > ++ print("Exception during execution:", str(e)) > + return None > + else: > + # uh-oh, compile failed > +-- > +2.44.3 > + > 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 8147e4108b72..cad140381344 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 += " \ > file://0001-build_support-use-source-filename-instead-of-foo-for.patch \ > file://0002-build_support-handle-empty-max_priority-value-as-Non.patch \ > file://0003-build_support-use-does_build_succeed-in-compile_and_.patch \ > + file://0004-build_support-handle-runtime-errors-and-return-None-.patch \ > " > inherit pypi python_setuptools_build_meta > -- > 2.25.1 > > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > View/Reply Online (#118898): https://lists.openembedded.org/g/openembedded-devel/message/118898 > Mute This Topic: https://lists.openembedded.org/mt/114580342/3617156 > Group Owner: openembedded-devel+owner@lists.openembedded.org > Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [martin.jansa@gmail.com] > -=-=-=-=-=-=-=-=-=-=-=- >
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 000000000000..f4608e6443b5 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-posix-ipc/0004-build_support-handle-runtime-errors-and-return-None-.patch @@ -0,0 +1,57 @@ +From aea0522262cc7e2374131f25116a59303fdca8e5 Mon Sep 17 00:00:00 2001 +From: Haixiao Yan <haixiao.yan.cn@windriver.com> +Date: Thu, 7 Aug 2025 08:13:06 +0000 +Subject: [PATCH] build_support: handle runtime errors and return None for + invalid max_priority + +When cross-compiling, test binaries may fail to execute on the host system if +the target toolchain was built against a newer glibc version than what is +available on the host. + +For example, on Ubuntu 20.04 the following error occurs: + +./build_support/src/sniff_mq_prio_max: /lib/x86_64-linux-gnu/libc.so.6: version +`GLIBC_2.34' not found (required by ./build_support/src/sniff_mq_prio_max) + +This change ensures that such runtime errors are gracefully handled, and +max_priority is set to None when the test binary cannot be executed. + +Upstream-Status: Pending + +Signed-off-by: Haixiao Yan <haixiao.yan.cn@windriver.com> +--- + build_support/discover_system_info.py | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/build_support/discover_system_info.py b/build_support/discover_system_info.py +index f6e6c8cbe6ba..a0be60e51e24 100644 +--- a/build_support/discover_system_info.py ++++ b/build_support/discover_system_info.py +@@ -73,12 +73,21 @@ def compile_and_run(filename, linker_options=""): + # Utility function that returns the stdout output from running the + # compiled source file; None if the compile fails. + if does_build_succeed(filename, linker_options=""): ++ debug = False + try: + s = subprocess.Popen(["./build_support/src/%s" % filename[:-2]], +- stdout=subprocess.PIPE).communicate()[0] +- return s.strip().decode() +- except Exception: ++ stdout=subprocess.PIPE, stderr=subprocess.PIPE) ++ stdout, stderr = s.communicate() ++ if s.returncode != 0: ++ # runtime error ++ if debug: ++ print("Execution error:", stderr.decode().strip()) ++ return None ++ return stdout.strip().decode() ++ except Exception as e: + # execution resulted in an error ++ if debug: ++ print("Exception during execution:", str(e)) + return None + else: + # uh-oh, compile failed +-- +2.44.3 + 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 8147e4108b72..cad140381344 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 += " \ file://0001-build_support-use-source-filename-instead-of-foo-for.patch \ file://0002-build_support-handle-empty-max_priority-value-as-Non.patch \ file://0003-build_support-use-does_build_succeed-in-compile_and_.patch \ + file://0004-build_support-handle-runtime-errors-and-return-None-.patch \ " inherit pypi python_setuptools_build_meta