-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Land WASI Preview 2 support into Wasmtime #6370
Comments
This was referenced May 12, 2023
This was referenced May 24, 2023
42 tasks
I think this issue has lived its useful life and we can now call it closed - the preview 2 support is still not totally complete in wasmtime-wasi but it, and the specs themselves, are maturing rapidly. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We have been working on a prototype of what WASI Preview 2 support will look like in Wasmtime for 7 months now! https://github.com/bytecodealliance/preview2-prototyping/
The work is not yet totally complete, but I believe that it is mature enough that we should start landing it into this repository, and keep iterating on it here. It was included in the March 28 tooling compatibility matrix, but it turns out we skipped compatibility with the wasmtime 8.0 release due to some bindgen changes we needed. I'd like to get everything landed and part of the regular Wasmtime release cycle for 10.0, which will cut at the beginning of June.
Here is my rough plan for how we will land changes. These plans are open to changes so please leave your feedback!
crates/wasi-preview1-component-adapter
. We will bring its child proc-macro cratebyte-array
, and the test harnessvalidate
, in as well underneath that directory. Add building, validating, and publishing the adapter binary (for both commands and reactors) to the wasmtime repository's CI. Runtime (integration) tests will be added in the subsequent steps.test-programs
crate to support building both modules and components (using the adapter from step 1). Keep all the existing tests of wasi-common (which covers both the cap-std-sync and tokio backends) intact, but refactor like we did in p2p to make the structure of how tests are run driven by hand-written code, rather than packing a ton of magic into the macros. The components will be built, but not actually executed yet.wasi-common
crate underwasmtime-wasi
in thepub mod preview2
space, and behind the (enabled by default)preview2
cargo feature. Leave this repository'swasi-common
,wasi-cap-std-sync
, andwasi-tokio
crates untouched. They will continue to provide all preview 1 functionality for the moment. The preview 2 functionality will be passing all tests that it does in p2p through thetest-programs
(at the moment this means poll-oneoff and some trailing slashes behavior is broken), and this PR will port in the other tests from the p2p repo as well.At this point we can say the wasmtime project has preview 2 support! It is, however, behind a different WasiCtx api (with some changes to the builder, and the way to add it to a linker), and is totally separate from the preview 1 support.
The next steps are:
wasi-preview1-component-adapter
or any component-model features in wasmtime.wasmtime-wasi-sockets
crate into this repository. This crate is separate from, but depends upon, what will land inwasmtime-wasi::preview2
. It need to be integrated with the poll oneoff design fixes, and it needs a test suite, in order to land.wasmtime-wasi-http
crate to use the poll-oneoff fixes above, making it compatible with components instead of just modules]wasmtime-wasi::preview2
's docs up to Wasmtime project standards.Once the poll design changes and host-side adapter are landed, we can start working on transitioning the legacy implementation out of wasmtime:
wasmtime-wasi
's existing preview 1 support behindpub mod preview1_legacy
and the off-by-defaultpreview1_legacy
cargo feature. Move thepreview2
module out to the root. The new host-side adapter interface to provides preview 1 support to all users, except those who have regressions and need to use the legacy support for a limited time.sock_*
functions. Presently, the sock functions have no tests in the tree, or anywhere else I can find, so I don't have a way to port those to preview 2 without taking a wild guess at what semantics they need. The only known user of these functions was Enarx, who are no longer in business. If any other users need these sock functions to keep working in either the host or wasm adapter for preview 1, we'll need them to contribute to that support- all of the Bytecode Alliance contributors I have spoke to so far don't have a business case for supporting preview 1's sockets, and instead are all in on preview 2 sockets.wasi-common
,wasi-cap-std-sync
, andwasi-tokio
crates. We could publish a final empty version indicating they wont get any more updates and have been replaced with wasmtime-wasi.The text was updated successfully, but these errors were encountered: