tareksander added the bug label to Issue #8057.
tareksander opened issue #8057:
I'm working on a new WASI proposal and I'm implementing an example implementation with
wasmtime
. I have a correct WIT definition AFAIK and I'm generating the bindings with the bindgen macro. For some reason, thekey-data
record andkey
variant didn't generate a corresponding struct/enum. There's an error inside the generated bindgen code "cannot find type "KeyData" in this scope".
alexcrichton commented on issue #8057:
Thanks for the report! I believe that issue should be fixed in https://github.com/bytecodealliance/wasmtime/pull/8065.
One other issue is that the
move
variant is defined twice: one here and one here. That's probably something which should be a WIT-level error, however, rather than late in bindgen.Also, for the future in case you find it useful,
WASMTIME_DEBUG_BINDGEN=1
can help provide some more comprehensible error messages as the source will be available. That wouldn't have helped you here as it was a bindgen bug, but if further issues arise it may help!
tareksander commented on issue #8057:
One other issue is that the
move
variant is defined twice: one here and one here. That's probably something which should be a WIT-level error, however, rather than late in bindgen.Yes, that I have also notices and fixed locally, but the type error persisted anyways.
If I understand #8065 correctly, right now bindgen thinks the types are unused, and therefore it doesn't generate them? I have restructured the WIT definitions anyways, I'll see if the bug also happens then.
alexcrichton commented on issue #8057:
Yes the
event
type andkey-data
aren't actually used by any imports or exports at this time (function-wise), so Wasmtime thinks they're dead types and doesn't generate bindings for one but does generate bindings for the other. If a function uses the types then bindings should get generated correctly. (note that regardless these are bugs in Wasmtime to fix!)
alexcrichton closed issue #8057:
I'm working on a new WASI proposal and I'm implementing an example implementation with
wasmtime
. I have a correct WIT definition AFAIK and I'm generating the bindings with the bindgen macro. For some reason, thekey-data
record andkey
variant didn't generate a corresponding struct/enum. There's an error inside the generated bindgen code "cannot find type "KeyData" in this scope".
Last updated: Nov 22 2024 at 16:03 UTC