Stream: git-wasmtime

Topic: wasmtime / issue #11698 can bindgen!() generate async bin...


view this post on Zulip Wasmtime GitHub notifications bot (Sep 13 2025 at 11:10):

AverageLinuxEnjoyer opened issue #11698:

I switched from sync to async and change all of the functions but I'm still getting:

thread 'main' (19013) panicked at /home/averagelinuxenjoyer/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wasmtime-36.0.2/src/runtime/component/func/typed.rs:158:9:
must use `call_async` when async support is enabled on the config
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
````
when calling the bindings generated by `bindgen!()`, is there a way for it to generate async bindings for calling wasm functions?
~~~

view this post on Zulip Wasmtime GitHub notifications bot (Sep 13 2025 at 11:10):

AverageLinuxEnjoyer edited issue #11698:

I switched from sync to async and changed all of the functions but I'm still getting:

thread 'main' (19013) panicked at /home/averagelinuxenjoyer/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wasmtime-36.0.2/src/runtime/component/func/typed.rs:158:9:
must use `call_async` when async support is enabled on the config
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
````
when calling the bindings generated by `bindgen!()`, is there a way for it to generate async bindings for calling wasm functions?
~~~

view this post on Zulip Wasmtime GitHub notifications bot (Sep 13 2025 at 11:11):

AverageLinuxEnjoyer edited issue #11698:

I switched from sync to async and changed all of the functions (eg. add_to_linker_sync -> add_to_linker_async, func_wrap -> func_wrap_async) but I'm still getting:

thread 'main' (19013) panicked at /home/averagelinuxenjoyer/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wasmtime-36.0.2/src/runtime/component/func/typed.rs:158:9:
must use `call_async` when async support is enabled on the config
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
````
when calling the bindings generated by `bindgen!()`, is there a way for it to generate async bindings for calling wasm functions?
~~~

view this post on Zulip Wasmtime GitHub notifications bot (Sep 13 2025 at 19:38):

MarcGuiselin commented on issue #11698:

It can. I suspect you want:

bindgen!({
    path: "interface",
    imports: { default: async },
    exports: { default: async },
});

Or here's another example taken from crates/wasmtime/src/runtime/component/bindgen_examples/_8_store_in_imports.rs.

bindgen!({
    inline: r#"
        package example:store-in-imports;

        world my-world {
            import sync-with-store: func();
            import async-with-store: async func();

            import sync-without-store: func();
            import async-without-store: func();

            export run: async func();
        }
    "#,

    imports: {
        "sync-with-store": store,
        // note that this isn't required because WIT-level `async` functions
        // always have access to the store.
        // "async-with-store": store,
        "async-without-store": async,
    },
});

view this post on Zulip Wasmtime GitHub notifications bot (Sep 14 2025 at 21:14):

AverageLinuxEnjoyer closed issue #11698:

I switched from sync to async and changed all of the functions (eg. add_to_linker_sync -> add_to_linker_async, func_wrap -> func_wrap_async) but I'm still getting:

thread 'main' (19013) panicked at /home/averagelinuxenjoyer/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wasmtime-36.0.2/src/runtime/component/func/typed.rs:158:9:
must use `call_async` when async support is enabled on the config
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
````
when calling the bindings generated by `bindgen!()`, is there a way for it to generate async bindings for calling wasm functions?
~~~

view this post on Zulip Wasmtime GitHub notifications bot (Sep 14 2025 at 21:14):

AverageLinuxEnjoyer commented on issue #11698:

ah, I see, I read the docs again after you showing me this and it is indeed mentioned, thanks a lot!


Last updated: Dec 06 2025 at 06:05 UTC