Plan
The ultimate goal is to have wstd use WASIp2 when compiled to wasm32-wasip2 and WASIp3 when compiling to wasm32-wasip3, with essentially the same APIs.
Until rust-lang/rust#161940 has landed we'll create mutually exclusive p2 and p3 features on wstd, where p2 will be enabled by default and p3 will only be run in CI during development, not meant for actual use. Then we can switch the feature directives to target_env directives when the work is complete and wasm32-wasip3 is tier 2.
Breaking Changes
- The stream APIs in
io and TCP APIs in net work with & references and will switch to requiring &mut. This is because p2 is a single threaded environment, whereas p3 is not. This change will be made to both targets to keep them in sync.
- Some APIs expose the underlying WASIp2 types (e.g.
AsyncInputStream::new takes a wasip2::InputStream) these will naturally change to use the equivalent WASIp3 types. This will only be breaking when upgrading to the WASIp3 target.
- (Up for discussion) The
wasip3 crate has its own Task type which wstd could use directly instead of async_task::Task. If done this would be another breaking change between the two targets.
Checklist
Plan
The ultimate goal is to have
wstduse WASIp2 when compiled towasm32-wasip2and WASIp3 when compiling towasm32-wasip3, with essentially the same APIs.Until rust-lang/rust#161940 has landed we'll create mutually exclusive
p2andp3features onwstd, wherep2will be enabled by default andp3will only be run in CI during development, not meant for actual use. Then we can switch thefeaturedirectives totarget_envdirectives when the work is complete andwasm32-wasip3is tier 2.Breaking Changes
ioand TCP APIs innetwork with&references and will switch to requiring&mut. This is becausep2is a single threaded environment, whereasp3is not. This change will be made to both targets to keep them in sync.AsyncInputStream::newtakes awasip2::InputStream) these will naturally change to use the equivalent WASIp3 types. This will only be breaking when upgrading to the WASIp3 target.wasip3crate has its ownTasktype whichwstdcould use directly instead ofasync_task::Task. If done this would be another breaking change between the two targets.Checklist
p2andp3features #144&->&mutbreaking API changes required for WASIp3 #145mainmacro for WASIp3 #148runtimeon WASIp3randon WASIp3timeon WASIp3ioon WASIp3neton WASIp3httpon WASIp3wstd-axumon WASIp3p2/p3features and usetarget_envinstead #147async_task::Tasktowasip3::Task