Skip to content

Conversation

@ricochet
Copy link
Contributor

@ricochet ricochet commented Feb 9, 2026

No description provided.

impl stdin::Host for WasiCliCtxView<'_> {}

impl stdout::HostWithStore for WasiCli {
async fn write_via_stream<U>(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The primary changes in this rc were driven by: WebAssembly/WASI#870

@github-actions github-actions bot added the wasi Issues pertaining to WASI label Feb 10, 2026
@ricochet ricochet force-pushed the rev-0.3.0-rc-2026-02-09 branch from 9f0a2f4 to 5bf9c47 Compare February 12, 2026 22:57
Comment on lines 534 to 539
let file = get_file(store.get().table, &fd)?;
if !file.perms.contains(FilePerms::WRITE) {
return Ok(FutureReader::new(&mut store, async {
wasmtime::error::Ok(Err(ErrorCode::NotPermitted))
}));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this, append_via_stream below, and send with TCP, the ? here and the permission check all need to go into a created FutureReader. Here the call to get_file failing in ? will trigger a trap as opposed to an error code, but the file-not-writable case is handled just fine here. In TCP down below the two ? present there need to be funneled into a returned FutureReader, however.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is applicable to read_directory below too a bit. One thing I might recommend is using and_then or similar combinators to avoid using ? in the function bodies and that should make it a bit easier to see the flow of things.

Another option would be to remove the trappable option for these imports in the bindgen! configuration. That'll remove the wasmtime::Result layer of the return value and force us to implement this in a non-trapping fashion.

@ricochet ricochet force-pushed the rev-0.3.0-rc-2026-02-09 branch from 5bf9c47 to 458b3ba Compare February 13, 2026 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasi Issues pertaining to WASI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants