This commit moves the WebAssembly feature detection functionality from
the CLI to the types crate, making it more widely accessible for use
by other parts of the codebase.
Changes:
- Add `detect_from_wasm` method to `Features` struct in
`lib/types/features.rs`
- Update CLI's `detect_features_from_wasm` to use the new centralized
method
- Add new WebAssembly feature flags to CLI's `WasmFeatures` struct:
- tail_call
- module_linking
- multi_memory
- memory64
- exceptions
- Remove unsupported feature checks (relaxed_simd, extended_const)
- Improve feature detection logic with better validation and error
handling
This change improves code organization by:
- Centralizing feature detection logic in one place
- Making the feature detection functionality reusable
- Maintaining consistent feature detection across the codebase
- Improving maintainability by reducing code duplication
Signed-off-by: Charalampos Mitrodimas <charalampos@wasmer.io>
1. Feature Detection:
- Added ability to detect required Wasm features from module
binaries
- Implemented feature checking in RuntimeOptions with wasmparser
integration
- Added support for detecting exceptions and other advanced features
2. Backend Selection:
- Implemented intelligent backend selection based on required
features
- Added support for querying supported/default features per backend
- Enhanced RuntimeOptions to filter and select compatible backends
3. Engine Enhancements:
- Added default_features_for_target and
supported_features_for_target methods
- Implemented backend-specific feature support matrices
- Improved engine initialization with feature awareness
4. CLI Improvements:
- Enhanced run command to use feature-based backend selection
Signed-off-by: Charalampos Mitrodimas <charalampos@wasmer.io>