Files
meta-openembedded/meta-python/recipes-devtools/python/python3-autobahn/0001-Skip-march-guessing-for-external-cross-toolchains.patch
T
Leon Anavi c7c5a067e3 python3-autobahn: Upgrade 26.7.1 -> 26.10.1
Upgrade to release 26.10.1:

General

- Load the vendored FlatBuffers runtime only when a FlatBuffers
  message is first built or parsed, instead of on every import
  autobahn. The runtime imports numpy whenever numpy is installed,
  so up to 26.7.1 every process importing autobahn also loaded numpy,
  including WebSocket-only users such as Django Channels applications
  served by Daphne. Every autobahn import now needs about 13-17 MB
  less memory on CPython and 18-24 MB less on PyPy, and none loads
  numpy. A new documentation page (docs/memory-footprint.rst, just
  memory-footprint) shows the import memory footprint per release on
  CPython and PyPy.

Wheels

- Publish native Windows ARM64 (win_arm64) wheels with NVX for
  CPython 3.11-3.14, built on GitHub’s windows-11-arm runners (PyPy
  publishes no Windows ARM64 interpreter); thanks to @ndabas.
  cryptography currently publishes no win_arm64 wheel, so the build
  compiles it against an OpenSSL from vcpkg.

- Build cryptography against an OpenSSL from vcpkg on Windows x86_64
  too: cryptography 50.0.2 publishes its Windows PyPy wheels for PyPy
  8 (pp80) only, and the pypy311 wheel build uses PyPy 7.3 (pp73), so
  pip builds it from source there.

WebSocket

- Make all four per-message compression extensions
  (permessage-deflate, -bzip2, -brotli, -snappy) enforce the
  decompression budget the same way: decompression stops near the
  remaining maxMessagePayloadSize budget instead of decompressing a
  whole frame first, and “over budget” as well as “budget already
  used up” raise PayloadExceededError. brotli now bounds its output
  with Decompressor.process(output_buffer_limit=...), snappy is
  decompressed one framing chunk at a time, and deflate no longer
  lets one octet through once the budget is used up.

- Add autobahn.exception.PayloadCorruptError: every compression
  extension now raises it for input it cannot decompress (corrupt,
  truncated, or not the extension’s format), instead of the library’s
  own exception (zlib.error, OSError, brotli.error, …), and snappy no
  longer accepts such input silently. The protocol fails the
  connection with close code 1007 (invalid frame payload data), the
  same for every extension and on both Twisted and asyncio.

- Fix permessage-brotli failing on the second message of a connection
  when context takeover was negotiated (the default): the compressor
  and decompressor were reused after their brotli stream had
  finished. Each message is now a new brotli stream, which is the
  wire format brotli used for the first message already, and for no
  context takeover.

- Fix an asyncio WebSocket connection being left open, but no longer
  serviced, when an exception escaped the processing of received
  data: the connection is now dropped, as on Twisted.

- Add a documentation page on WebSocket compression
  (docs/websocket/compression.rst): for each of the four extensions,
  which Python package and which compression library (and bundled
  version) it uses on CPython and on PyPy, plus context takeover,
  decompression limits and the handling of invalid data. The old,
  unpublished page under docs/work/ did not cover permessage-brotli

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
2026-10-19 15:08:22 -07:00

86 lines
3.0 KiB
Diff

From 2afdc29c60812d16708041c3c48ebf8674a5d16f Mon Sep 17 00:00:00 2001
From: Leon Anavi <leon.anavi@konsulko.com>
Date: Mon, 20 Jul 2026 15:52:32 +0300
Subject: [PATCH] Skip -march guessing for external cross toolchains
Don't add -march flag when CC/CROSS_COMPILE names an external cross
toolchain (Yocto/OpenEmbedded, Buildroot, ...). These already
inject the correct target. Avoid issues such as an unknown value
'x86-64-v2' for '-march' when cross compiling for ARM machine.
Upstream-Status: Pending [https://github.com/crossbario/autobahn-python/pull/1934]
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
---
src/autobahn/nvx/_compile_args.py | 36 ++++++++++++++++++++++++++++---
1 file changed, 33 insertions(+), 3 deletions(-)
diff --git a/src/autobahn/nvx/_compile_args.py b/src/autobahn/nvx/_compile_args.py
index 2a35ab3..173e5fd 100644
--- a/src/autobahn/nvx/_compile_args.py
+++ b/src/autobahn/nvx/_compile_args.py
@@ -81,6 +81,10 @@ CIBUILDWHEEL : str, optional
AUDITWHEEL_PLAT : str, optional
Set by auditwheel/manylinux builds. Indicates wheel build.
+CC, CROSS_COMPILE : str, optional
+ If either names a triplet-prefixed compiler (e.g. "aarch64-poky-linux-gcc"),
+ an external cross toolchain is assumed and no -march flag is added.
+
Examples
--------
@@ -212,9 +216,6 @@ def get_compile_args():
# But default codegen is already optimized for current arch
return ["/O2", "/W3"]
- # GCC/Clang on POSIX (Linux, macOS, *BSD)
- machine = _get_target_machine()
-
# Base flags for all POSIX platforms
base_args = [
"-std=c99",
@@ -233,6 +234,14 @@ def get_compile_args():
# deployments). It is NOT safe for distributed wheels or cross-compilation.
return base_args + ["-march=native"]
+ if _is_external_toolchain():
+ # Cross toolchain (Yocto/OpenEmbedded, Buildroot, ...) already sets its
+ # own -march/-mtune; don't second-guess it (#1930).
+ return base_args
+
+ # GCC/Clang on POSIX (Linux, macOS, *BSD)
+ machine = _get_target_machine()
+
# Default for everyone (AUTOBAHN_ARCH_TARGET unset or "safe"): a portable
# baseline architecture. Defaulting to "safe" rather than -march=native is
# what makes cross-compilation work out of the box - a cross toolchain
@@ -248,6 +257,27 @@ def get_compile_args():
return base_args
+def _is_external_toolchain():
+ """
+ True if ``CC`` or ``CROSS_COMPILE`` names a triplet-prefixed compiler (e.g.
+ ``aarch64-poky-linux-gcc``), the convention used by externally managed
+ toolchains such as Yocto/OpenEmbedded and Buildroot.
+
+ Returns
+ -------
+ bool
+ True if an externally managed cross toolchain is detected.
+ """
+ for var in ("CC", "CROSS_COMPILE"):
+ value = os.environ.get(var, "")
+ if not value:
+ continue
+ exe = os.path.basename(value.split()[0])
+ if "-" in exe:
+ return True
+ return False
+
+
def _get_target_machine():
"""
Return the *target* machine architecture for the build.