meta-openembedded/meta-python/recipes-devtools/python/python3-posix-ipc/0001-build_support-use-source-filename-instead-of-foo-for.patch
Martin Jansa 14fa41b559
python3-posix-ipc: improve build_support
* fixes:
  https://lists.openembedded.org/g/openembedded-devel/message/117255

DEBUG: Executing shell function do_compile
* Getting build dependencies for wheel...
/usr/lib/ld-linux-aarch64.so.1: No such file or directory
Traceback (most recent call last):
  File "TOPDIR/BUILD/work/raspberrypi4_64-webos-linux/python3-posix-ipc/1.2.0/recipe-sysroot-native/usr/lib/python3.13/site-packages/pyproject_hooks/_in_process/_in_process.py",
line 389, in <module>
    main()
    ~~~~^^
  File "TOPDIR/BUILD/work/raspberrypi4_64-webos-linux/python3-posix-ipc/1.2.0/recipe-sysroot-native/usr/lib/python3.13/site-packages/pyproject_hooks/_in_process/_in_process.py",
line 373, in main
    json_out["return_val"] = hook(**hook_input["kwargs"])
                             ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "TOPDIR/BUILD/work/raspberrypi4_64-webos-linux/python3-posix-ipc/1.2.0/recipe-sysroot-native/usr/lib/python3.13/site-packages/pyproject_hooks/_in_process/_in_process.py",
line 143, in get_requires_for_build_wheel
    return hook(config_settings)
  File "TOPDIR/BUILD/work/raspberrypi4_64-webos-linux/python3-posix-ipc/1.2.0/recipe-sysroot-native/usr/lib/python3.13/site-packages/setuptools/build_meta.py",
line 334, in get_requires_for_build_wheel
    return self._get_build_requires(config_settings, requirements=[])
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "TOPDIR/BUILD/work/raspberrypi4_64-webos-linux/python3-posix-ipc/1.2.0/recipe-sysroot-native/usr/lib/python3.13/site-packages/setuptools/build_meta.py",
line 304, in _get_build_requires
    self.run_setup()
    ~~~~~~~~~~~~~~^^
  File "TOPDIR/BUILD/work/raspberrypi4_64-webos-linux/python3-posix-ipc/1.2.0/recipe-sysroot-native/usr/lib/python3.13/site-packages/setuptools/build_meta.py",
line 320, in run_setup
    exec(code, locals())
    ~~~~^^^^^^^^^^^^^^^^
  File "<string>", line 23, in <module>
  File "TOPDIR/BUILD/work/raspberrypi4_64-webos-linux/python3-posix-ipc/1.2.0/posix_ipc-1.2.0/build_support/discover_system_info.py",
line 409, in discover
    d["QUEUE_PRIORITY_MAX"] = sniff_mq_prio_max()
                              ~~~~~~~~~~~~~~~~~^^
  File "TOPDIR/BUILD/work/raspberrypi4_64-webos-linux/python3-posix-ipc/1.2.0/posix_ipc-1.2.0/build_support/discover_system_info.py",
line 238, in sniff_mq_prio_max
    if max_priority < 0:
       ^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'str' and 'int'

ERROR Backend subprocess exited when trying to invoke
get_requires_for_build_wheel
WARNING: TOPDIR/BUILD/work/raspberrypi4_64-webos-linux/python3-posix-ipc/1.2.0/temp/run.do_compile.2736023:168
exit 1 from 'nativepython3 -m build --no-isolation --wheel --outdir
TOPDIR/BUILD/work/raspberrypi4_64-webos-linux/python3-posix-ipc/1.2.0/dist
TOPDIR/BUILD/work/raspberrypi4_64-webos-linux/python3-posix-ipc/1.2.0/posix_ipc-1.2.0'
WARNING: Backtrace (BB generated script):

On some hosts.

Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-05-05 10:16:54 -07:00

51 lines
2.4 KiB
Diff

From 09cfcf7de2aab873a13949d5a128ccfb9e54732d Mon Sep 17 00:00:00 2001
From: Martin Jansa <martin.jansa@gmail.com>
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 <martin.jansa@gmail.com>
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: