Stream: git-wasmtime

Topic: wasmtime / issue #8057 Component model: `bindgen!` doesn'...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 07 2024 at 07:52):

tareksander added the bug label to Issue #8057.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 07 2024 at 07:52):

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, the key-data record and key variant didn't generate a corresponding struct/enum. There's an error inside the generated bindgen code "cannot find type "KeyData" in this scope".

view this post on Zulip Wasmtime GitHub notifications bot (Mar 08 2024 at 00:30):

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!

view this post on Zulip Wasmtime GitHub notifications bot (Mar 08 2024 at 07:31):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 08 2024 at 15:29):

alexcrichton commented on issue #8057:

Yes the event type and key-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!)

view this post on Zulip Wasmtime GitHub notifications bot (Mar 14 2024 at 20:15):

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, the key-data record and key 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: Oct 23 2024 at 20:03 UTC