Fix 1767#1769
Merged
Merged
Conversation
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 crossbario#1767 Note: This work was completed with AI assistance (Claude Code).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix NVX runtime detection to check actual CFFI modules
Related Issue(s)
Closes or relates to #1767
Checklist
the style guidelines of this project
is effective or that my feature works
updated the changelog
in this PR