meta-openembedded/meta-python/recipes-devtools/python/python3-posix-ipc/0002-build_support-handle-empty-max_priority-value-as-Non.patch
Martin Jansa c03b93fa6c 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>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
2025-05-21 09:17:24 -04:00

50 lines
1.9 KiB
Diff
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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