From f2dc694c52618c04880b28aceec48ff3a853558f Mon Sep 17 00:00:00 2001 From: Haixiao Yan Date: Wed, 13 Aug 2025 15:08:49 +0800 Subject: python3-posix-ipc: upgrade 1.2.0 -> 1.3.0 Remove following patches, they have been fixed since 1.3.0. 0001-build_support-use-source-filename-instead-of-foo-for.patch 0002-build_support-handle-empty-max_priority-value-as-Non.patch 0003-build_support-use-does_build_succeed-in-compile_and_.patch Backport a patch to fix dicsovery fails when CC contains flags License-Update: update copyright statements to include contributors Signed-off-by: Haixiao Yan Signed-off-by: Khem Raj --- ...rt-fix-cross-compilation-error-when-CC-is.patch | 53 ++++++++++++++++++ ...rt-use-source-filename-instead-of-foo-for.patch | 50 ----------------- ...rt-handle-empty-max_priority-value-as-Non.patch | 49 ----------------- ...rt-use-does_build_succeed-in-compile_and_.patch | 62 ---------------------- 4 files changed, 53 insertions(+), 161 deletions(-) create mode 100644 meta-python/recipes-devtools/python/python3-posix-ipc/0001-build_support-fix-cross-compilation-error-when-CC-is.patch delete mode 100644 meta-python/recipes-devtools/python/python3-posix-ipc/0001-build_support-use-source-filename-instead-of-foo-for.patch delete mode 100644 meta-python/recipes-devtools/python/python3-posix-ipc/0002-build_support-handle-empty-max_priority-value-as-Non.patch delete mode 100644 meta-python/recipes-devtools/python/python3-posix-ipc/0003-build_support-use-does_build_succeed-in-compile_and_.patch (limited to 'meta-python/recipes-devtools/python/python3-posix-ipc') diff --git a/meta-python/recipes-devtools/python/python3-posix-ipc/0001-build_support-fix-cross-compilation-error-when-CC-is.patch b/meta-python/recipes-devtools/python/python3-posix-ipc/0001-build_support-fix-cross-compilation-error-when-CC-is.patch new file mode 100644 index 0000000000..c78d4ad726 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-posix-ipc/0001-build_support-fix-cross-compilation-error-when-CC-is.patch @@ -0,0 +1,53 @@ +From 01134093c9150248f9ea8890a41e922159593a7f Mon Sep 17 00:00:00 2001 +From: Haixiao Yan +Date: Fri, 8 Aug 2025 19:30:16 +0800 +Subject: [PATCH] build_support: fix cross-compilation error when CC is a + multi-part command + +Fix the following error when cross-compiling with an environment-defined CC +that includes flags: + +FileNotFoundError: [Errno 2] No such file or directory: 'x86_64-wrs-linux-gcc +-m64 -march=nehalem -mtune=generic -mfpmath=sse -msse4.2 +-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security +-Werror=format-security +--sysroot=/build-1.3.0/tmp/work/corei7-64-wrs-linux/python3-posix-ipc/1.3.0/recipe-sysroot' + +This happened because the CC environment variable was treated as a single +string instead of being split into arguments. The fix uses shlex.split() to +correctly parse CC into a list of compiler and flags, and then unpacks it when +forming the subprocess command. + +Upstream-Status: Backport [https://github.com/osvenskan/posix_ipc/commit/0113409] + +Signed-off-by: Haixiao Yan +--- + build_support/discover_system_info.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/build_support/discover_system_info.py b/build_support/discover_system_info.py +index d1b171e4f602..1c3741f5577c 100644 +--- a/build_support/discover_system_info.py ++++ b/build_support/discover_system_info.py +@@ -1,6 +1,7 @@ + import subprocess + import platform + import os ++import shlex + + # Set these to None for compile/link debugging or subprocess.PIPE to silence + # compiler warnings and errors. +@@ -49,7 +50,9 @@ def does_build_succeed(filename, linker_options=""): + # - Some versions of Linux place the sem_xxx() functions in libpthread. + # Rather than testing whether or not it's needed, I just specify it + # everywhere since it's harmless to specify it when it's not needed. +- cmd = [os.getenv("CC", "cc"), ++ cc = os.getenv("CC", "cc") ++ cmd = [ ++ *shlex.split(cc), + '-Wall', + '-o', + f'./build_support/src/{filename[:-2]}', +-- +2.34.1 + diff --git a/meta-python/recipes-devtools/python/python3-posix-ipc/0001-build_support-use-source-filename-instead-of-foo-for.patch b/meta-python/recipes-devtools/python/python3-posix-ipc/0001-build_support-use-source-filename-instead-of-foo-for.patch deleted file mode 100644 index 8bb7267086..0000000000 --- a/meta-python/recipes-devtools/python/python3-posix-ipc/0001-build_support-use-source-filename-instead-of-foo-for.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 09cfcf7de2aab873a13949d5a128ccfb9e54732d Mon Sep 17 00:00:00 2001 -From: Martin Jansa -Date: Mon, 5 May 2025 08:15:37 +0200 -Subject: [PATCH] build_support: use source filename instead of 'foo' for - discover tests - -* helps when debugging the issues -* use the same order of CC arguments in compile_and_run and - does_build_succeed just for consistency -* use pthread in both compile_and_run and does_build_succeed functions - it was added only to does_build_succeed in 5ec39f7af8cfd8525d225b1302fa93f7133b3849 - not sure if it was intentional - -Signed-off-by: Martin Jansa -Upstream-Status: Submitted [https://github.com/osvenskan/posix_ipc/pull/77] ---- - build_support/discover_system_info.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/build_support/discover_system_info.py b/build_support/discover_system_info.py -index bc4d174..6d059d9 100644 ---- a/build_support/discover_system_info.py -+++ b/build_support/discover_system_info.py -@@ -60,7 +60,7 @@ def does_build_succeed(filename, linker_options=""): - # Rather than testing whether or not it's needed, I just specify it - # everywhere since it's harmless to specify it when it's not needed. - cc = os.getenv("CC", "cc") -- cmd = "%s -Wall -o ./build_support/src/foo ./build_support/src/%s %s -lpthread" % (cc, filename, linker_options) -+ cmd = "%s -Wall -o ./build_support/src/%s ./build_support/src/%s %s -lpthread" % (cc, filename[:-2], filename, linker_options) - - p = subprocess.Popen(cmd, shell=True, stdout=STDOUT, stderr=STDERR) - -@@ -73,7 +73,7 @@ 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. - cc = os.getenv("CC", "cc") -- cmd = "%s -Wall -o ./build_support/src/foo %s ./build_support/src/%s" % (cc, linker_options, filename) -+ cmd = "%s -Wall -o ./build_support/src/%s ./build_support/src/%s %s -lpthread" % (cc, filename[:-2], filename, linker_options) - - p = subprocess.Popen(cmd, shell=True, stdout=STDOUT, stderr=STDERR) - -@@ -82,7 +82,7 @@ def compile_and_run(filename, linker_options=""): - return None - - try: -- s = subprocess.Popen(["./build_support/src/foo"], -+ s = subprocess.Popen(["./build_support/src/%s" % filename[:-2]], - stdout=subprocess.PIPE).communicate()[0] - return s.strip().decode() - except Exception: diff --git a/meta-python/recipes-devtools/python/python3-posix-ipc/0002-build_support-handle-empty-max_priority-value-as-Non.patch b/meta-python/recipes-devtools/python/python3-posix-ipc/0002-build_support-handle-empty-max_priority-value-as-Non.patch deleted file mode 100644 index 54c8ddaba7..0000000000 --- a/meta-python/recipes-devtools/python/python3-posix-ipc/0002-build_support-handle-empty-max_priority-value-as-Non.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 8fc46d871639dbe799f6ff0a61b046412ef5dcc6 Mon Sep 17 00:00:00 2001 -From: Martin Jansa -Date: Mon, 5 May 2025 08:16:30 +0200 -Subject: [PATCH] build_support: handle empty max_priority value as None -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When cross-compiling these tests they fail when the host cannot execute -the binaries built for target. - -On my local ubuntu-22.04 docker container running -build_support/src/sniff_mq_prio_max results in: -posix_ipc-1.2.0 $ ./build_support/src/foo -bash: ./build_support/src/foo: cannot execute binary file: Exec format error -which triggers the Exception in compile_and_run and returns None - -While on some other ubuntu-22.04 containers I see: -posix_ipc-1.2.0$ ./build_support/src/sniff_mq_prio_max -/usr/lib/ld-linux-aarch64.so.1: No such file or directory - -and the compile_and_run returns -b'' -which then causes -posix_ipc-1.2.0/build_support/discover_system_info.py", line 244, in sniff_mq_prio_max -    if max_priority < 0: -       ^^^^^^^^^^^^^^^^ - -Handle the empty value the same as None to avoid this. - -Signed-off-by: Martin Jansa -Upstream-Status: Submitted [https://github.com/osvenskan/posix_ipc/pull/77] ---- - build_support/discover_system_info.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/build_support/discover_system_info.py b/build_support/discover_system_info.py -index 6d059d9..f8a3c83 100644 ---- a/build_support/discover_system_info.py -+++ b/build_support/discover_system_info.py -@@ -223,7 +223,7 @@ def sniff_mq_prio_max(): - except ValueError: - max_priority = None - -- if max_priority is None: -+ if not max_priority: - # Looking for a #define didn't work; ask sysconf() instead. - # Note that sys.sysconf_names doesn't exist under Cygwin. - if hasattr(os, "sysconf_names") and \ diff --git a/meta-python/recipes-devtools/python/python3-posix-ipc/0003-build_support-use-does_build_succeed-in-compile_and_.patch b/meta-python/recipes-devtools/python/python3-posix-ipc/0003-build_support-use-does_build_succeed-in-compile_and_.patch deleted file mode 100644 index b36d1cdb3a..0000000000 --- a/meta-python/recipes-devtools/python/python3-posix-ipc/0003-build_support-use-does_build_succeed-in-compile_and_.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 760374e778fc28193cfea1416a739e206f9201c6 Mon Sep 17 00:00:00 2001 -From: Martin Jansa -Date: Mon, 5 May 2025 08:28:56 +0200 -Subject: [PATCH] build_support: use does_build_succeed in compile_and_run - -* avoid the duplication and building the sniff_mq_prio_max.c twice - -Signed-off-by: Martin Jansa -Upstream-Status: Submitted [https://github.com/osvenskan/posix_ipc/pull/77] ---- - build_support/discover_system_info.py | 27 ++++++++++----------------- - 1 file changed, 10 insertions(+), 17 deletions(-) - -diff --git a/build_support/discover_system_info.py b/build_support/discover_system_info.py -index f8a3c83..f6e6c8c 100644 ---- a/build_support/discover_system_info.py -+++ b/build_support/discover_system_info.py -@@ -72,22 +72,17 @@ def does_build_succeed(filename, linker_options=""): - 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. -- cc = os.getenv("CC", "cc") -- cmd = "%s -Wall -o ./build_support/src/%s ./build_support/src/%s %s -lpthread" % (cc, filename[:-2], filename, linker_options) -- -- p = subprocess.Popen(cmd, shell=True, stdout=STDOUT, stderr=STDERR) -- -- if p.wait(): -+ if does_build_succeed(filename, linker_options=""): -+ try: -+ s = subprocess.Popen(["./build_support/src/%s" % filename[:-2]], -+ stdout=subprocess.PIPE).communicate()[0] -+ return s.strip().decode() -+ except Exception: -+ # execution resulted in an error -+ return None -+ else: - # uh-oh, compile failed - return None -- -- try: -- s = subprocess.Popen(["./build_support/src/%s" % filename[:-2]], -- stdout=subprocess.PIPE).communicate()[0] -- return s.strip().decode() -- except Exception: -- # execution resulted in an error -- return None - - - def get_sysctl_value(name): -@@ -211,11 +206,9 @@ def sniff_mq_prio_max(): - # ref: http://www.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html - DEFAULT_PRIORITY_MAX = 32 - -- max_priority = None - # OS X up to and including 10.8 doesn't support POSIX messages queues and - # doesn't define MQ_PRIO_MAX. Maybe this aggravation will cease in 10.9? -- if does_build_succeed("sniff_mq_prio_max.c"): -- max_priority = compile_and_run("sniff_mq_prio_max.c") -+ max_priority = compile_and_run("sniff_mq_prio_max.c") - - if max_priority: - try: -- cgit v1.2.3-54-g00ecf