Stream: general

Topic: ✔ Running component model example calculator


view this post on Zulip Aatash P (Apr 29 2024 at 23:22):

Hi, I was trying to run the Component Model Calculator example code (located at https://github.com/bytecodealliance/component-docs/tree/main/component-model/examples/tutorial) but was having some issues. I downloaded the tutorial folder directly and moved it into my workspace, and now when I try to do "cd calculator && cargo component build --release", I get the following error (upon the latter "cargo component build --release" command:

error[E0425]: cannot find function run_ctors_once in crate wit_bindgen_rt
--> src/bindings.rs:184:25
|
184 | wit_bindgen_rt::run_ctors_once();
| ^^^^^^^^^^^^^^ not found in wit_bindgen_rt

For more information about this error, try rustc --explain E0425.
error: could not compile calculator (lib) due to 1 previous error

Is there perhaps some dependency or other I am missing due to having directly downloaded the folder, and I was also wondering how I might be able to proceed to be able to get the example calculator running, so I can then modify and start working with it? I did also just update cargo component before this, due to getting a different version error when running the command. Would appreciate any advice. Thanks!

Documentation around creating and using WebAssembly Components - bytecodealliance/component-docs

view this post on Zulip Nuke 🌄 (Apr 29 2024 at 23:54):

What version of #cargo-component are you using, may I ask? Perhaps the tutorial needs to specify a version or update the bindings? AFAIK there should be a way via a lock file https://github.com/bytecodealliance/cargo-component/blob/main/example/Cargo-component.lock

A Cargo subcommand for creating WebAssembly components based on the component model proposal. - bytecodealliance/cargo-component

view this post on Zulip Nuke 🌄 (Apr 29 2024 at 23:55):

you can try to delete all the bindings and run cargo component that you have installed to regenerate them I think as well, to see if that works :fingers_crossed:
It could be that this dep and others need to be bumped as well FYI

Documentation around creating and using WebAssembly Components - bytecodealliance/component-docs

view this post on Zulip Nuke 🌄 (Apr 30 2024 at 00:40):

@Aatash P looks like a bump and rebind is all that you should need https://github.com/bytecodealliance/component-docs/pull/134/

Update and rebuild bindings using wit-bindgen-rt 0.23.0 and cargo-component 0.11.0 Should fix https://bytecodealliance.zulipchat.com/#narrow/stream/206238-general/topic/Running.20component.20model....

view this post on Zulip Aatash P (Apr 30 2024 at 00:58):

Nuke 🌄 said:

Aatash P looks like a bump and rebind is all that you should need https://github.com/bytecodealliance/component-docs/pull/134/

Just tried this out and applied that change to all the .toml files and it seems to have done the trick. Thank you so much!

view this post on Zulip Notification Bot (Apr 30 2024 at 01:01):

Nuke 🌄 has marked this topic as resolved.


Last updated: Dec 23 2024 at 12:05 UTC