Stream: wit-bindgen

Topic: ✔ Error generating Python bindings


view this post on Zulip Christoph Brewing (Jun 30 2023 at 13:26):

After having upgraded to wit-bindgen = "0.7.0" for guest generation, the Python bindings are not generated anymore:

$python -m wasmtime.bindgen ./component.wasm --out-dir decoder/

RuntimeError: failed to extract interface information from component

Caused by:
    unknown component version: 0xd (at offset 0x0)

Python uses wasmtime-9.0.0.

The component is working as expected when bound to Rust.

Can anyone confirm that generating Python bindings produces an error? Is there a workaround?

view this post on Zulip Ramon Klass (Jun 30 2023 at 13:37):

I think the new wit-bindgen expects the wasmtime 10 wit format, wit has changed quite a bit unfortunately, a version of componentize-py that supports wasmtime 10 is next on the list as far as I understand

view this post on Zulip Ramon Klass (Jun 30 2023 at 13:38):

but in general, that error (unknown component version) means your toolchain has diverged and some expect an older format of components while some expect a newer one

view this post on Zulip Joel Dice (Jun 30 2023 at 14:02):

Ramon Klass said:

I think the new wit-bindgen expects the wasmtime 10 wit format, wit has changed quite a bit unfortunately, a version of componentize-py that supports wasmtime 10 is next on the list as far as I understand

I think you meant wasmtime-py based on the error Christoph shared. But yeah, componentize-py needs an update, too. The snapshot branch of the componentize-py repo is compatible with the latest component format, but it also relies on toolchain patches to support shared-everything linking, so it's not ready for general use yet.

view this post on Zulip Ramon Klass (Jun 30 2023 at 14:07):

thank you for elaborating, and yes I need to familiarize myself more with all the parts involved in the wasi toolchain, some are "something something wasmtime" to me still

view this post on Zulip Ralph (Jun 30 2023 at 14:27):

you aren't the only one! Because there's a lot of movement at the moment prepping for the changes coming a lot of people are "something version 3.1 something version 8.4 something version 23 wasmtime-klsk392" :-) moving targets are hard.....

view this post on Zulip Christoph Brewing (Jul 07 2023 at 10:11):

(probably last) update: meanwhile wasmtime-py has been updated to match wasmtime 10.0.0 . With this version, the bindings are generated flawlessly.

view this post on Zulip Notification Bot (Jul 07 2023 at 10:12):

Christoph Brewing has marked this topic as resolved.


Last updated: Nov 22 2024 at 16:03 UTC