Commit c67ed62
authored
Fix 1767 (#1769)
* add branch audit file
* Fix NVX runtime detection to check actual CFFI modules
Problem:
When installing from source with AUTOBAHN_USE_NVX=0 (no NVX build), the
runtime detection incorrectly reported HAS_NVX=True, causing crashes when
attempting to use NVX functionality.
Root Cause:
The detection was importing Python wrapper modules (autobahn.nvx._xormasker
and autobahn.nvx._utf8validator) which are always importable as they're
Python files. The actual CFFI extension modules (_nvx_xormasker and
_nvx_utf8validator) are only imported lazily inside the wrapper classes'
__init__ methods, so their availability wasn't being checked.
Solution:
Changed detection to directly import the CFFI extension modules:
- import _nvx_utf8validator
- import _nvx_xormasker
This correctly detects whether NVX was actually built at install time:
- If NVX was built: CFFI modules exist → HAS_NVX=True
- If NVX wasn't built: CFFI modules don't exist → ImportError → HAS_NVX=False
Testing:
- With CFFI modules available: HAS_NVX=True, USES_NVX=True ✓
- With CFFI modules blocked: HAS_NVX=False, USES_NVX=False ✓
This ensures the pure Python fallback is correctly used when NVX isn't built.
Fixes #1767
Note: This work was completed with AI assistance (Claude Code).1 parent 0b8d651 commit c67ed62
2 files changed
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| |||
0 commit comments