Stream: cargo-component

Topic: 0.9.0 released


view this post on Zulip Peter Huene (Mar 02 2024 at 00:35):

cargo-component 0.9.0 has now been released.

Please review the release notes here as there are a number of breaking changes relating to this release.

⚠️ Breaking Changes ⚠️ There are a few breaking changes in this release that impact existing cargo-component projects. The reintroduction of the export! macro The latest generated bindings has rein...

view this post on Zulip Yoshua Wuyts (Mar 02 2024 at 00:37):

woooohhhh!!!! :partying_face:

view this post on Zulip Peter Huene (Mar 02 2024 at 00:37):

The binary artifacts are still being built, just FYI

view this post on Zulip Friedrich Vandenberghe (Mar 03 2024 at 08:28):

When reading the changelog I see that there are some breaking changes to [package.metadata.component.bindings], does this also apply for std_feature?

Because I just upgraded to 0.9, and now I get the following error:

error[E0152]: found duplicate lang item `panic_impl`
  --> src/lib.rs:68:1
   |
68 | / fn panic(_panic: &core::panic::PanicInfo<'_>) -> ! {
69 | |     // My panic
70 | |     loop {}
71 | | }
   | |_^
   |
   = note: the lang item is first defined in crate `std` (which `wit_bindgen_rt` depends on)
   = note: first definition in `std` loaded from /home/zelzahn/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-wasi/lib/libstd-b30c25b1d25082c4.rlib

I have set std_feature to true and set the #![no_std] attribute in my lib.rs.

view this post on Zulip Peter Huene (Mar 03 2024 at 14:17):

@Friedrich Vandenberghe it shouldn't have, unless there was a regression in wit-bindgen (double checked that the option was being passed from cargo-component to wit-bindgen); let me take a deeper look, although I'm about to board a plane

view this post on Zulip Peter Huene (Mar 03 2024 at 14:21):

Oh whoops, it appears we left #![no_std] off wit-bindgen-rt when we refactored it out into its own crate

view this post on Zulip Peter Huene (Mar 03 2024 at 14:22):

we should be able to fix that with a patch to wit-bindgen-rt and cargo update on your project will then hopefully get you working again

view this post on Zulip Peter Huene (Mar 03 2024 at 14:24):

I'll also add a test to cargo-component so this doesn't regress in the future

view this post on Zulip Peter Huene (Mar 03 2024 at 14:28):

I've opened https://github.com/bytecodealliance/wit-bindgen/pull/877; once that's merged and released, I'll add that regression test to cargo-component

We forgot to add this when we refactored wit-bindgen-rt into its own crate.

view this post on Zulip Friedrich Vandenberghe (Mar 04 2024 at 07:07):

Thanks for the swift response! :big_smile:

view this post on Zulip Peter Huene (Mar 04 2024 at 16:24):

When 0.21.0 of wit-bindgen-rt is released, you should be able to cargo upgrade --incompatible (if you're using cargo-edit) or just manually update the dependency your project; it should not require a cargo-component release


Last updated: Nov 25 2024 at 19:03 UTC