I am getting this compilation issue with latest release of cargo component:
error[internal]: left behind trailing whitespace
--> <stdin>:21896:21896:1
|
21896 |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
warning: rustfmt has failed to format. See previous 292 errors.
thread 'main' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wit-bindgen-rust-0.20.0/src/lib.rs:1107:13:
assertion failed: status.success()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Hi @Sehz. Sorry about that! The latest version of cargo-component
tries to format the generated bindings automatically, which is hitting some issues on vary complicated bindings.
We've filed https://github.com/bytecodealliance/wit-bindgen/issues/880 to improve this.
In the meantime, you can disable the automatic formatting by setting package.metadata.component.bindings.format
to false
.
I'll amend the release notes with the above information updated!
Ok. that fixed the issue. But now getting different error: ```Error: failed to load cargo metadata
Caused by:
cargo metadata
exited with an error: error: failed to parse manifest at Cargo.toml
Caused by:
feature `wasm-component` includes `dep:wit-bindgen`, but `wit-bindgen` is not listed as a dependency```
I am following example here: https://github.com/bytecodealliance/cargo-component/blob/main/example/Cargo.toml. If I add wit-bindgen
as dependency like previous release , it works
Sounds like a feature local to your Cargo.toml
(i.e. wasm-component
) needs to be updated to use wit-bindgen-rt
instead of wit-bindgen
I am running latest version of was-component: cargo component --version
cargo-component-component 0.9.0 (dc7cb41 2024-03-01 wasi:ab5a448)
never mind. There was feature dep to cargo component. sorry
Sehz has marked this topic as resolved.
Last updated: Nov 25 2024 at 19:03 UTC