Draft
Conversation
…WASIX Runtime impl
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
…to fix/wasix-subprocess-feature-detection
…feature-detection Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves WASIX subprocess execution by allowing child modules to be compiled with a different engine backend and/or an extended Wasm feature set than the parent process (addressing macOS failures where subprocess modules require features like exceptions).
Changes:
- Add runtime-side module feature detection and sys-backend selection/caching so subprocesses can compile with a compatible backend/features.
- Update
PluggableRuntimeconstruction to take anEngineup-front (removing post-construction engine mutation patterns) and adjust call sites. - Add a new WASIX test that runs a
--singlepassparent whichexecs an exception-using child module to validate engine/feature switching.
Reviewed changes
Copilot reviewed 26 out of 28 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/wasix/subprocess-engine-selection/run.sh | Builds parent/child WASIX modules with different feature requirements and runs the parent under Singlepass. |
| tests/wasix/subprocess-engine-selection/main.c | Parent module vfork/execs the child and validates its exit code. |
| tests/wasix/subprocess-engine-selection/child.cc | Child module uses C++ exceptions to require exception-handling support. |
| tests/wasix/subprocess-engine-selection/.no-build | Marks the test as manually built via run.sh. |
| tests/lib/wast/src/wasi_wast.rs | Updates PluggableRuntime construction to pass the current store engine. |
| lib/wasix/tests/wasm_tests/reflection_tests/wasix-reflection-and-closures/main.c | Attempts to make closure/reflection test more conditional, but changes affect compilation. |
| lib/wasix/tests/wasm_tests/.gitignore | Normalizes an ignore entry formatting (no functional change). |
| lib/wasix/tests/runners.rs | Updates runtime construction to pass an engine argument. |
| lib/wasix/src/syscalls/wasix/proc_exec3.rs | Removes an unused new_store local related to exec/spawn flow. |
| lib/wasix/src/state/builder.rs | Constructs PluggableRuntime with an engine derived from the builder config. |
| lib/wasix/src/runtime/mod.rs | Core change: add sys-backend selection, engine caching, and per-module feature detection in resolve_module; update PluggableRuntime::new signature. |
| lib/wasix/src/runners/wasi.rs | Updates tests to the new PluggableRuntime::new(..., engine) signature. |
| lib/wasix/src/os/console/mod.rs | Updates tests to the new PluggableRuntime::new(..., engine) signature. |
| lib/wasix/src/bin_factory/binary_package.rs | Updates tests to the new PluggableRuntime::new(..., engine) signature. |
| lib/wasix/Cargo.toml | Adds sys/compiler backend feature wiring (sys-default, singlepass, cranelift, llvm) and an optional compiler dependency. |
| lib/swift/src/lib.rs | Updates runtime construction to pass an engine. |
| lib/compiler/src/engine/inner.rs | Adds Engine::new_with_extended_features(...) helper for sys engine rebuilding. |
| lib/compiler/src/compiler.rs | Extends the Compiler trait with a configuration() accessor. |
| lib/compiler-singlepass/src/compiler.rs | Implements new Compiler::configuration() API. |
| lib/compiler-llvm/src/compiler.rs | Implements new Compiler::configuration() API. |
| lib/compiler-cranelift/src/compiler.rs | Implements new Compiler::configuration() API. |
| lib/cli/src/commands/run/wasi.rs | Passes the selected engine into PluggableRuntime::new and removes set_engine chaining. |
| lib/cli/Cargo.toml | Ensures CLI backend feature flags also enable corresponding wasmer-wasix/* backend features. |
| lib/c-api/src/wasm_c_api/wasi/mod.rs | Passes the store engine into PluggableRuntime::new. |
| lib/c-api/Cargo.toml | Ensures C-API backend feature flags also enable corresponding wasmer-wasix/* backend features. |
| examples/wasi.rs | Updates example to construct PluggableRuntime with Engine::default(). |
| Cargo.toml | Ensures workspace backend features also enable corresponding wasmer-wasix/* backend features. |
| Cargo.lock | Records the added wasmer-compiler dependency. |
marxin
reviewed
May 5, 2026
| /// Build a new Engine with the same compiler and configuration, but with this Engine's | ||
| /// features extended by the given features. | ||
| #[cfg(feature = "compiler")] | ||
| pub fn new_with_extended_features(&self, features: &Features) -> Result<Self, CompileError> { |
Contributor
There was a problem hiding this comment.
I thought it's already something we've been doing, see #6222.
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.
This PR allows WASIX subprocesses to select a different engine or different feature set relative to the parent process.
Fixes #6515.