Skip to content

Commit c7e7f26

Browse files
authored
Fix 1856 (#1857)
* started new dev branch; added audit file * Sync .cicd security fix and harden hatch_build against silent CFFI degradation (#1856) Carry over two release-readiness items from the zlmdb 26.6.1 release: - Bump .cicd (wamp-cicd) 8f520a9 -> f77ca2b to pick up the script/shell injection fix in the shared identifiers.yml reusable workflow (GHSA-6658-6vq6-hjpr): untrusted GitHub event fields are passed via env: as quoted data with a fail-closed branch-name allowlist. - hatch_build.py: fail the wheel build hard when NVX was requested (AUTOBAHN_USE_NVX) but the CFFI extension did not compile, instead of silently emitting a structurally-valid-but-unintended py3-none-any wheel. A transient native-compile crash (e.g. gcc SIGSEGV under QEMU ARM64 emulation) now aborts with a non-zero exit so CI can retry it. Unlike zlmdb's mandatory LMDB extension, autobahn's NVX is optional (pure-Python fallback), so AUTOBAHN_USE_NVX=0 still yields a legitimate pure-Python wheel. Note: This work was completed with AI assistance (Claude Code).
1 parent 4514e3e commit c7e7f26

4 files changed

Lines changed: 38 additions & 5 deletions

File tree

.audit/oberstet_fix_1856.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- [ ] I did **not** use any AI-assistance tools to help create this pull request.
2+
- [x] I **did** use AI-assistance tools to *help* create this pull request.
3+
- [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.
4+
5+
Submitted by: @oberstet
6+
Date: 2026-06-16
7+
Related issue(s): #1856
8+
Branch: oberstet:1856

.cicd

docs/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Changelog
2626

2727
* Bump shared ``.ai`` (wamp-ai) and ``.cicd`` (wamp-cicd) submodules to match zlmdb exactly (#1853)
2828
* Fix ``scripts/update_flatbuffers.sh`` git-version capture for submodule checkouts (``.git`` is a file, not a directory) (#1853)
29+
* 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)
30+
* 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)
2931

3032
25.12.2
3133
-------

hatch_build.py

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,44 @@ def initialize(self, version, build_data):
4949
built_nvx = False
5050
built_flatc = False
5151

52-
# Check if NVX build is disabled
53-
if os.environ.get("AUTOBAHN_USE_NVX", "1") not in ("0", "false"):
52+
# NVX (Native Vector Extensions) is an OPTIONAL accelerator: autobahn
53+
# ships pure-Python fallbacks for both the XOR masker and the UTF-8
54+
# validator (see autobahn.websocket.xormasker), and AUTOBAHN_USE_NVX=0
55+
# is an explicitly supported configuration that yields a legitimate
56+
# pure-Python (py3-none-any) wheel.
57+
nvx_requested = os.environ.get("AUTOBAHN_USE_NVX", "1") not in ("0", "false")
58+
59+
if nvx_requested:
5460
# Build CFFI modules (NVX)
5561
built_nvx = self._build_cffi_modules(build_data)
5662
else:
5763
print("AUTOBAHN_USE_NVX is disabled, skipping CFFI build")
5864

65+
# When NVX was requested but no extension was produced, the CFFI compile
66+
# failed silently (_build_cffi_modules swallows compile errors and just
67+
# returns False). Refuse to degrade a platform wheel into a structurally
68+
# valid but unintended pure-Python (py3-none-any) wheel: fail the build
69+
# hard so that a transient native-compile crash (e.g. a gcc SIGSEGV
70+
# under QEMU ARM64 emulation) aborts with a non-zero exit and is retried
71+
# by CI, instead of being uploaded as a degraded artifact. See #1856.
72+
if nvx_requested and not built_nvx:
73+
raise RuntimeError(
74+
"NVX CFFI extension was requested (AUTOBAHN_USE_NVX) but was not "
75+
"built - refusing to emit a pure-Python (py3-none-any) autobahn "
76+
"wheel. See the build log above for the underlying compile "
77+
"failure. Set AUTOBAHN_USE_NVX=0 to intentionally build a "
78+
"pure-Python wheel."
79+
)
80+
5981
# Build and bundle the flatc compiler (developer convenience). The
6082
# binary FlatBuffers schemas (reflection.bfbs, wamp.bfbs) are NOT
6183
# generated here: they are committed to the source tree and shipped
6284
# as-is, so a package build never needs to *run* flatc (required for
63-
# cross-compilation - see module docstring).
85+
# cross-compilation - see module docstring). flatc is best-effort and
86+
# does NOT gate the wheel tag.
6487
built_flatc = self._build_flatc(build_data)
6588

66-
# If we built any extensions, mark this as a platform-specific wheel
89+
# If we built any extensions, mark this as a platform-specific wheel.
6790
if built_nvx or built_flatc:
6891
build_data["infer_tag"] = True
6992
build_data["pure_python"] = False

0 commit comments

Comments
 (0)