Hello, Im trying to go through the examples from the component docs (the calculator example) and Im having some problems.
I can build the module using the given rust and wit files, but cargo component build --release
fails to export the add
function from adder, so it fails with the following error:
error: failed to validate exported interface `docs:calculator/add@0.1.0`
Caused by:
module does not export required function `docs:calculator/add@0.1.0#add`
Has wit-bindgen
changed the way that things get exported? I needed to add wit-bindgen-rt
as a dependency also in order to make it this far.
Thank you
I am betting it's you are using a too recent version of cargo component. 0.10.1
?
If so, https://github.com/bytecodealliance/component-docs/pull/118 might be what we need.
Not sure if you resolved this but see the release notes for 0.9.0 (https://github.com/bytecodealliance/cargo-component/releases/tag/v0.9.0) the dependencies did in fact change
Shaun Kerr said:
Hello, Im trying to go through the examples from the component docs (the calculator example) and Im having some problems.
I can build the module using the given rust and wit files, but
cargo component build --release
fails to export theadd
function from adder, so it fails with the following error:error: failed to validate exported interface `docs:calculator/add@0.1.0` Caused by: module does not export required function `docs:calculator/add@0.1.0#add`
Has
wit-bindgen
changed the way that things get exported? I needed to addwit-bindgen-rt
as a dependency also in order to make it this far.Thank you
Last updated: Dec 23 2024 at 12:05 UTC