Stream: general

Topic: Async component model - string encoding support?


view this post on Zulip BigOrangeQWQ (Sep 07 2025 at 12:54):

What is the support scope of Wasmtime's async component for different string encodings?

I have a WIT file as follows:

package my:test;

interface i {
  ping: async func(x: future<string>, y: string) -> future<string>;
}

world test {
  export i;
}

world runner {
  import i;
}

When using wasm-tools component embed, if the string-encoding parameters are different, it seems to trigger an invalid error during task.return. Specifically, because the parameter y is of type string, the embed operation encodes the async lift. However, if the string-encoding of test and runner differs, it causes an issue at this point (as seen in this code line).

Fork of wasmtime for protoyping WASIp3 work and coordination, not intended for any production use case, purely for development - bytecodealliance/wasip3-prototyping

view this post on Zulip Alex Crichton (Sep 08 2025 at 04:07):

non-utf8 encodings aren't super well tested right now, so while wasmtime should have support for everything this is likely a guest toolchain issue unable to produce the correct component. Could you file an issue with a reproduction? That'll help narrow down where the bug lies and we can transfer it to the right repo once the source is found

view this post on Zulip BigOrangeQWQ (Sep 08 2025 at 16:10):

Yes, I agree. This issue cannot be reproduced with the wat files generated by wasm-tools embed --dummy-names legacy --async-callback (I've tried many methods but all failed). However, the wat code generated by wit-bindgen is too lengthy. I'm currently thinking about how to minimize the error case before submitting an issue.

view this post on Zulip Alex Crichton (Sep 08 2025 at 18:30):

it's ok if it's not the most minimal thing in the world, we can help minimize too once we can repro


Last updated: Dec 06 2025 at 05:03 UTC