Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .audit/oberstet_fix_1856.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- [ ] I did **not** use any AI-assistance tools to help create this pull request.
- [x] I **did** use AI-assistance tools to *help* create this pull request.
- [x] I have read, understood and followed the projects' [AI Policy](https://github.com/crossbario/autobahn-python/blob/main/AI_POLICY.md) when creating code, documentation etc. for this pull request.

Submitted by: @oberstet
Date: 2026-06-16
Related issue(s): #1856
Branch: oberstet:1856
2 changes: 1 addition & 1 deletion .cicd
2 changes: 2 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Changelog

* Bump shared ``.ai`` (wamp-ai) and ``.cicd`` (wamp-cicd) submodules to match zlmdb exactly (#1853)
* Fix ``scripts/update_flatbuffers.sh`` git-version capture for submodule checkouts (``.git`` is a file, not a directory) (#1853)
* Bump the ``.cicd`` (wamp-cicd) submodule to pick up the script/shell-injection fix in the shared ``identifiers.yml`` reusable workflow (untrusted GitHub event fields are now passed via ``env:`` as quoted data with a fail-closed branch-name allowlist) (#1856)
* Fail wheel builds hard when NVX was requested (``AUTOBAHN_USE_NVX``) but the CFFI extension did not compile, instead of silently degrading to a pure-Python (``py3-none-any``) wheel. A transient native-compile crash (e.g. a ``gcc`` SIGSEGV under QEMU ARM64 emulation) now aborts the build with a non-zero exit so CI can retry it, rather than uploading a structurally valid but unintended artifact. Building with ``AUTOBAHN_USE_NVX=0`` still produces a pure-Python wheel as before (#1856)

25.12.2
-------
Expand Down
31 changes: 27 additions & 4 deletions hatch_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,44 @@ def initialize(self, version, build_data):
built_nvx = False
built_flatc = False

# Check if NVX build is disabled
if os.environ.get("AUTOBAHN_USE_NVX", "1") not in ("0", "false"):
# NVX (Native Vector Extensions) is an OPTIONAL accelerator: autobahn
# ships pure-Python fallbacks for both the XOR masker and the UTF-8
# validator (see autobahn.websocket.xormasker), and AUTOBAHN_USE_NVX=0
# is an explicitly supported configuration that yields a legitimate
# pure-Python (py3-none-any) wheel.
nvx_requested = os.environ.get("AUTOBAHN_USE_NVX", "1") not in ("0", "false")

if nvx_requested:
# Build CFFI modules (NVX)
built_nvx = self._build_cffi_modules(build_data)
else:
print("AUTOBAHN_USE_NVX is disabled, skipping CFFI build")

# When NVX was requested but no extension was produced, the CFFI compile
# failed silently (_build_cffi_modules swallows compile errors and just
# returns False). Refuse to degrade a platform wheel into a structurally
# valid but unintended pure-Python (py3-none-any) wheel: fail the build
# hard so that a transient native-compile crash (e.g. a gcc SIGSEGV
# under QEMU ARM64 emulation) aborts with a non-zero exit and is retried
# by CI, instead of being uploaded as a degraded artifact. See #1856.
if nvx_requested and not built_nvx:
raise RuntimeError(
"NVX CFFI extension was requested (AUTOBAHN_USE_NVX) but was not "
"built - refusing to emit a pure-Python (py3-none-any) autobahn "
"wheel. See the build log above for the underlying compile "
"failure. Set AUTOBAHN_USE_NVX=0 to intentionally build a "
"pure-Python wheel."
)

# Build and bundle the flatc compiler (developer convenience). The
# binary FlatBuffers schemas (reflection.bfbs, wamp.bfbs) are NOT
# generated here: they are committed to the source tree and shipped
# as-is, so a package build never needs to *run* flatc (required for
# cross-compilation - see module docstring).
# cross-compilation - see module docstring). flatc is best-effort and
# does NOT gate the wheel tag.
built_flatc = self._build_flatc(build_data)

# If we built any extensions, mark this as a platform-specific wheel
# If we built any extensions, mark this as a platform-specific wheel.
if built_nvx or built_flatc:
build_data["infer_tag"] = True
build_data["pure_python"] = False
Expand Down
Loading