Stream: wit-bindgen

Topic: ✔ making all runtime test exports async


view this post on Zulip Scott Waye (Oct 12 2023 at 23:58):

HI, to accomodate the dotnet runtime in the runtime tests I need to use instantiate_async because the dotnet runtime requires crate::testwasi::add_to_linker . I can proceed with a PR for this making all the export test functions async, and adding appropriate awaits etc. Is this going to be accepted, i.e. all future export tests will have to be async?

view this post on Zulip Alex Crichton (Oct 13 2023 at 05:34):

Switching to async shouldn't be an issue, but I'd also be curious to dig into why you need async here. For testwasi stuff in the wit bindgen repo I wouldn't expect a sync to be necessary or required unless explicitly opted into

view this post on Zulip Scott Waye (Oct 13 2023 at 16:57):

Ok, let me investigate some more, maybe I can revert it which would be ideal

view this post on Zulip Scott Waye (Oct 14 2023 at 00:27):

The async requirement starts from https://github.com/bytecodealliance/wasmtime/blob/f952ff274446035695fdf2fd53e75f8be0dcfbd4/crates/wasi/src/preview2/command.rs#L34 which goes to https://github.com/bytecodealliance/wasmtime/blob/f952ff274446035695fdf2fd53e75f8be0dcfbd4/crates/wasi/src/preview2/mod.rs#L94 and a lot here are async

view this post on Zulip Alex Crichton (Oct 14 2023 at 03:43):

could you use wasmtime_wasi::preview2::command::sync::add_to_linker instead?

view this post on Zulip Scott Waye (Oct 14 2023 at 13:23):

Ah, I missed that. Thanks, that solves my problem!

view this post on Zulip Notification Bot (Oct 14 2023 at 13:23):

Scott Waye has marked this topic as resolved.


Last updated: Nov 22 2024 at 17:03 UTC