Stream: rust-toolchain

Topic: ✔ use of undeclared crate or module `bindings` following ...


view this post on Zulip Mariano Guerra (Aug 02 2023 at 13:44):

hi, following https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasm-compose/example#building-the-components I get the following error:

error[E0433]: failed to resolve: use of undeclared crate or module `bindings`
 --> src/lib.rs:1:5
  |
1 | use bindings::exports::example::service::handler::{Error, Handler, Request, Response};
  |     ^^^^^^^^ use of undeclared crate or module `bindings`

error[E0433]: failed to resolve: use of undeclared crate or module `bindings`
  --> src/lib.rs:31:1
   |
31 | bindings::export!(Component);
   | ^^^^^^^^ use of undeclared crate or module `bindings`

For more information about this error, try `rustc --explain E0433`.
error: could not compile `svc` (lib) due to 2 previous errors

this is what I did:

rustup target add wasm32-wasi
git clone https://github.com/bytecodealliance/wasm-tools.git
cd wasm-tools
cargo install --path .
cd wasm-tools/crates/wasm-compose/
# https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasm-compose/example#building-the-components

cd service
cargo component build --release

am I missing a step?

view this post on Zulip Peter Huene (Aug 02 2023 at 14:54):

Unfortunately the example is out of date.

view this post on Zulip Peter Huene (Aug 02 2023 at 14:55):

I'll push up a fix in a little bit

view this post on Zulip Peter Huene (Aug 02 2023 at 18:37):

I put up https://github.com/bytecodealliance/wasm-tools/pull/1154 to get the example working again.

This PR updates the wasm-compose example based on the latest cargo-component changes.

view this post on Zulip Notification Bot (Aug 02 2023 at 18:58):

Mariano Guerra has marked this topic as resolved.


Last updated: Nov 22 2024 at 16:03 UTC