alexcrichton requested pchickey for a review on PR #7365.
alexcrichton opened PR #7365 from alexcrichton:preview2-by-default
to bytecodealliance:main
:
Currently Wasmtime has two implementations of the
wasi_snapshot_preview1
set of APIs. The now-historical implementation lives in thewasi-common
crate and the more recent implementation lives in thewasmtime-wasi
crate. The main difference is that thewasmtime-wasi
implementation is based on the implementation of preview2, meaning that the preview1 implementation is a shim in that direction. Additionally currently the preview2 implementation of preview1 is accessible via the-Spreview2
flag on the CLI.This commit updates the interpretation of the
-Spreview2
flag and the defaults around which implementation to choose. By default the preview1-built-on-preview2 implementation (the newwasmtime-wasi
implementation) is selected now. This means that thewasi-common
implementation is disabled by default. There are still two use cases to keep running thewasi-common
implementation, however:
When running modules that import from
wasi_unstable
, the "snapshot" beforewasi_snapshot_preview1
, currentlywasi-common
is required. The shims to implementwasi_unstable
have not yet been implemented in thewasmtime-wasi
crate.When running with WASI threads (
-Sthreads
) the preview2 implementation does not work. This is because the preview2 implementation expects mutable access to the table which is not granted when threads are enabled.Tests using
wasi_unstable
now pass-Spreview2=n
to explicitly request the oldwasi-common
implementation. Additionally thewasi-common
implementation is still selected by default when-Sthreads
is passed (enabling the WASI threads proposal).<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton has marked PR #7365 as ready for review.
alexcrichton requested wasmtime-core-reviewers for a review on PR #7365.
pchickey submitted PR review:
Thanks. This is an exciting move! If we survive a release of this, I'll start moving the old implementation to be exported by an off-by-default wasmtime_wasi::legacy mod, and move ::preview2 to the root.
pchickey merged PR #7365.
Last updated: Nov 22 2024 at 16:03 UTC