diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2025-08-26 13:53:11 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2025-08-28 15:07:15 -0700 |
| commit | 5d81f033a5ab2fce07898a22ad8c607380812cf7 (patch) | |
| tree | 322dfd2dac61c80c3445a7bd6ff241269416286d /triagebot.toml | |
| parent | aa27cca79e7888deff3bafed84ea16a5a89cb7c7 (diff) | |
| download | rust-5d81f033a5ab2fce07898a22ad8c607380812cf7.tar.gz rust-5d81f033a5ab2fce07898a22ad8c607380812cf7.zip | |
std: Start supporting WASIp2 natively
This commit is the start of an effort to support WASIp2 natively in the standard library. Before this commit the `wasm32-wasip2` target behaved exactly like `wasm32-wasip1` target by importing APIs from the core wasm module `wasi_snapshot_preview1`. These APIs are satisfied by the `wasm-component-ld` target by using an [adapter] which implements WASIp1 in terms of WASIp2. This adapter comes at a cost, however, in terms of runtime indirection and instantiation cost, so ideally the adapter would be removed entirely. The purpose of this adapter was to provide a smoother on-ramp from WASIp1 to WASIp2 when it was originally created. The `wasm32-wasip2` target has been around for long enough now that it's much more established. Additionally the only thing historically blocking using WASIp2 directly was implementation effort. Work is now underway to migrate wasi-libc itself to using WASIp2 directly and now seems as good a time as any to migrate the Rust standard library too. Implementation-wise the milestones here are: * The `wasm32-wasip2` target now also depends on the `wasi` crate at version 0.14.* in addition to the preexisting dependency of 0.11.*. The 0.14.* release series binds WASIp2 APIs instead of WASIp1 APIs. * Some preexisting naming around `mod wasi` or `wasi.rs` was renamed to `wasip1` where appropriate. For example `std::sys::pal::wasi` is now called `std::sys::pal::wasip1`. * More platform-specific WASI modules are now split between WASIp1 and WASIp2. For example getting the current time, randomness, and process arguments now use WASIp2 APIs directly instead of using WASIp1 APIs that require an adapter. It's worth pointing out that this PR does not migrate the entire standard library away from using WASIp1 APIs on the `wasm32-wasip2` target. Everything related to file descriptors and filesystem APIs is still using WASIp1. Migrating that is left for a future PR. In the meantime the goal of this change is to lay the groundwork necessary for migrating in the future. Eventually the goal is to drop the `wasi` 0.11.* dependency on the `wasm32-wasip2` target (the `wasm32-wasip1` target will continue to retain this dependency). [adapter]: https://github.com/bytecodealliance/wasmtime/blob/main/crates/wasi-preview1-component-adapter/README.md
Diffstat (limited to 'triagebot.toml')
| -rw-r--r-- | triagebot.toml | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/triagebot.toml b/triagebot.toml index 3b7b216c0d2..cf2e95203fa 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -450,7 +450,8 @@ trigger_files = [ [autolabel."O-wasi"] trigger_files = [ - "library/std/src/sys/pal/wasi", + "library/std/src/sys/pal/wasip1", + "library/std/src/sys/pal/wasip2", "library/std/src/os/wasi" ] |
