Hey all, quick question -- it seems like wasmtime_environ::Trampoline::StreamWrite and friends have async_ set in theircanon opts (via the options: OptionsIndex member).
I'm pulling the opts like this:
let options = self
.component // &wasmtime_environ::Component
.options
.get(*options)
.expect("failed to find options");
When I get the CanonicalOptions object out, it's got async_ set and no callback (which is invalid)
Intuitively, the canon functions are clearly not async, so I'm thinking the issue here is that async_ is set on the CanonicalOptions that got created?
Alternatively, if I read this line in the canonopt validation section a bit differently:
- :shuffle:
callback- the function has type(func (param i32 i32 i32) (result i32))and cannot be present withoutasyncand is only allowed withcanon lift
Maybe the intent was that it's fine for async_ to be set, but callback can be missing (and I should basically only check that non-async things don't have a callback, not that all async things must have a callback).
Obviously during canon_lift the callback is quite required, but the canon function is a little blurrier...
I'm leaning towards the idea that the CanonicalOptions being set/saved for the relevant Trampoline:: members should not have async_ set in the first place.
ah yeah this is where each option is a bit overloaded in the context of each intrinsic
but async_ means whether these intrinsics are blocking or not basically for stream/future read/write
and the validation is different from canon lift'd functions for now (in the future though we might allow just-async_ on functions)
Ah OK, I thought that might be the case -- that somehow async_ meant something different in this context
OK, great, I've got that implemented -- I just disabled that last check for stream.write/etc and kept all the other ones on
FWIW you can skip all the validation bits in jco b/c wasmparser/wasmtime-environ do all that for you
Even better, I'll do that!
Thanks for the help! I think this makes sense now
Victor Adossi has marked this topic as resolved.
Last updated: Dec 06 2025 at 06:05 UTC