Hey! trying to get into WASM / WASI and using wasmtime. I've been looking through the docs / examples, and some of them seem to reference modules that seemingly no longer exist (e.g. wasi_common::sync). Am I missing something or are there new docs somewhere that I should be referring to?
if you just cloned main
today, functionality that used to be exposed at wasmtime_wasi::sync::{WasiCtxBuilder, add_to_linker}
is now provided underneath wasi_common::sync
as part of separating our legacy wasi 0.1 only implementation (wasi-common) and our new wasi 0.2 & 0.1 implementation, presently at wasmtime_wasi::preview2
so, if you are seeing docs that point to wasi_common::sync, those are based off main
as of the last two days, but the latest published version (wasmtime 17) still has that code at its previous home in wasmtime_wasi::sync.
when wasmtime 18 is released in a week, it will have that legacy wasi 0.1-only functionality exposed at both paths, with a deprecation warning on wasmtime-wasi's. in wasmtime 19 the legacy code will no longer be available through wasmtime-wasi, but the new implementation (wasmtime_wasi::preview2) will be exposed at the root of the wasmtime_wasi crate (dropping the ::preview2)
I see. Would you say the recommendation is to use the new wasi 0.2 stuff? and are there any examples or breaking changes I should be aware of when working with wasi 0.2 and wasmtime?
yes, the recommendation is to use the implementation that ships in wasmtime 17 and 18 as wasmtime_wasi::preview2, and will be promoted to wasmtime_wasi in 19. it supports wasi 0.2 as well as 0.1. the api is a little different than wasi-common, specifically it doesnt provide the WasiFile and WasiDir traits if you were using those to implement something, if you dont even know what those are then please dont worry about it
awesome, thanks for the pointers!
but we believe the new implementation is production ready, its been the default in wasmtime cli for a month or two now, we have gotten some relatively minor bug reports (thanks @Brett Cannon !) that we have fixed, and we haven't heard of any major regressions.
after we land the migration of wasmtime_wasi::preview2 to the root of that crate, i'm going to go through all of the remaining integration points (bench tests, c api, and one or two other spots) and various example code, and switch them to use that instead of wasi-common. so, you may see gaps in the documentation and stuff, please flag those to me and i'll get them fixed!
Pat Hickey said:
but we believe the new implementation is production ready, its been the default in wasmtime cli for a month or two now, we have gotten some relatively minor bug reports (thanks Brett Cannon !) that we have fixed, and we haven't heard of any major regressions.
First, you're quite welcome on the bug reports! Thanks to the team for fixing them so quickly!
Second, to be explicit as to the bugs/incompatibilities that I've found via CPython's test suite, https://github.com/bytecodealliance/wasmtime/issues/7829 is fixed but not in a released version yet (I assume the issue will be closed at release time). The known compatibility difference I've found is https://github.com/bytecodealliance/wasmtime/issues/7830 and it's a bit esoteric. Everything else has been fixed since wasmtime 17.
yes 7829 is going out in release 18, the fix landed in main and the release-18 branch. we chose not to do a 17 patch release for it because it didnt seem pressing, but we still could if someone really needed it.
Perfect. We will set up some work on 18.
Last updated: Nov 22 2024 at 17:03 UTC