Releases: bytecodealliance/cargo-component
v0.13.1
v0.13.0
v0.12.0
What's Changed
- add support for missing settings from wit-bindgen by @sehnryr in #273
- fix kebab case issue by @fibonacci1729 in #274
- Help mesasage improvement (#138) by @chikoski in #278
- Update the example to use the latest version of cargo-component by @rylev in #283
- fix test assertions after rust upgrade by @calvinrp in #287
- Add
profile.release
toCargo.toml
generated bycargo component new
by @calvinrp in #289 - Update install instruction to use --locked by @fibonacci1729 in #292
- Update to latest Warg release to support registry federation by @calvinrp in #288
- removed unused warg-credentials dependency by @calvinrp in #295
- Warg update 0.7 by @calvinrp in #296
New Contributors
- @sehnryr made their first contribution in #273
- @fibonacci1729 made their first contribution in #274
- @chikoski made their first contribution in #278
- @calvinrp made their first contribution in #287
Full Changelog: v0.11.0...v0.12.0
v0.11.0
Compatibility
- Wasmtime: 17.0.0+
- WASI: 0.2.0
- Warg (registry support): 0.4.0
What's Changed
- Update wit-bindgen and wasm-tools. by @sunfishcode in #266
- Synchronize artifact componentization. by @peterhuene in #270
- Bump version to 0.11.0. by @peterhuene in #271
Full Changelog: v0.10.1...v0.11.0
v0.10.1
Bug fixes
This patch release contains a single fix to prevent bindings being generated for cargo projects that are not meant to be components.
Bindings generation now only occurs based on either:
- The presence of a
[package.metadata.component]
section inCargo.toml
(the default forcargo component new
projects). - The presence of a
wit
directory in the project.
Compatibility
- Wasmtime: 17.0.0+
- WASI: 0.2.0
- Warg (registry support): 0.4.0
What's Changed
- Prevent bindings generation for normal cargo projects. by @peterhuene in #260
- Bump
cargo-component
version to 0.10.1. by @peterhuene in #261
Full Changelog: v0.10.0...v0.10.1
v0.10.0
New features
The biggest change included in this release is the support for the latest Warg registry protocol (including registry auth tokens) and also moved the keyring management out of cargo-component
and into the warg-credentials
crate.
Bug fixes
The code generated by cargo component new --target
now properly works with the latest generated bindings when the target world contains exports with resources; it now generates a scaffolding type to implement a resource and sets the trait-associated type when generating interface implementations.
Compatibility
- Wasmtime: 17.0.0+
- WASI: 0.2.0
- Warg (registry support): 0.4.0
What's Changed
- Fix panic in bindings generation for component dependencies. by @peterhuene in #253
- Fix
new --target
option for exports with resources. by @peterhuene in #254 - rely on warg-credentials for keyring management by @macovedj in #251
- Bump version to 0.10.0. by @peterhuene in #256
Full Changelog: v0.9.1...v0.10.0
v0.9.1
Issues fixed
This release contains a fix introduced in wit-bindgen
0.21.0 to eliminate trailing whitespace that was causing the automatic formatting of the generated bindings to fail.
Users that applied the workaround of setting package.metadata.component.bindings.format
to false
in Cargo.toml
are encouraged to remove the setting after upgrading to 0.9.1; if formatting continues to fail, please let us know by filing an issue.
Users may wish to update the version of the wit-bindgen-rt
dependency in Cargo.toml
to 0.21.0
, but that should not be required.
Upgrading from previous versions
If upgrading from a version of cargo-component
older than 0.9.0
, please see the release notes for the 0.9.0 release that details several breaking changes.
Compatibility
- Wasmtime: 17.0.0+
- WASI: 0.2.0
- Warg (registry support): 0.3.0
What's Changed
- Update to wit-bindgen 0.21. by @sunfishcode in #247
- Bump
cargo-component
to 0.9.1. by @peterhuene in #249
Full Changelog: v0.9.0...v0.9.1
v0.9.0
⚠️ 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 reintroduced the export!
macro; an invocation of this macro is required for the core module built from the Rust sources to export the required items.
Building your project without an export!
invocation may result in this error message:
error: module does not export required function `<name>`
To fix this, add the following to your src/lib.rs
:
bindings::export!(Component with_types_in bindings);
Where Component
is the name of the type implementing the generated bindings traits.
Changes to dependencies
To further reduce the chances of a wit-bindgen
change breaking cargo-component
, a new crate named wit-bindgen-rt
was introduced which contains only the runtime functions necessary for bindings to work.
Please replace the following in Cargo.toml
:
wit-bindgen = { version = "<version>", default-features = false, features = ["realloc"]}
with:
bitflags = "2.4.2"
wit-bindgen-rt = "0.20.0"
Changes to [package.metadata.component.bindings]
in Cargo.toml
With the reintroduction of the export!
macro, the implementor
and resources
settings that were used to customize the implementing type names in user code have been removed.
Remove these two settings if previously used.
For replacing the implementor
setting, pass the implementing type name (e.g. MyImplementingType
) to the export!
macro:
bindings::export!(MyImplementingType with_types_in bindings);
For replacing the resources
setting, use the trait-associated type to specify the implementing resource type:
struct MyResource;
impl bindings::exports::example::Guest for Component {
type MyResource = MyResource;
// ...
}
With the implementing types now expressed directly in Rust source, this should hopefully improve compiler diagnostics when there is a mismatch.
Automatic Source Formatting of Generated Bindings
This release of cargo-component
includes a feature to automatically format the source code of the generated bindings.
However, rustfmt
may fail on overly complex generated source. We've opened an issue to help with that.
You may observe a failure to format the source code of the form:
warning: rustfmt has failed to format.
thread 'main' panicked at .../wit-bindgen-rust-0.20.0/src/lib.rs:1107:13:
assertion failed: status.success()
To work around this issue, disable the source formatting of the generated bindings with:
[package.metadata.component.bindings]
format = false
Highlights
cargo-component
now componentizes based off the presence of bindings type information in the core module rather than expecting that[package.metadata.component]
section exists inCargo.toml
, an often confusing waycargo-component
worked previously.- The
run
,bench
, andtest
commands now print out what is being run like the corresponding commands incargo
. - Added
aarch64-unknown-linux-gnu
binary artifact, which should now work withcargo-binstall
(thanks to @nacardin).
Compatibility
- Wasmtime: 17.0.0+
- WASI: 0.2.0
- Warg (registry support): 0.3.0
What's Changed
- Update dependencies to latest. by @peterhuene in #237
- Various improvements to
cargo-component
. by @peterhuene in #240 - Support building aarch64-unknown-linux-gnu binary by @nacardin in #232
- Bump dependencies to latest. by @peterhuene in #243
- Remove status section from the README. by @peterhuene in #244
New Contributors
Full Changelog: v0.8.0...v0.9.0
v0.8.0
Compatibility
- Wasmtime: 17.0.0+
- WASI: 0.2.0
- Warg (registry support): 0.3.0
What's Changed
- Add support for
std_feature
by @sunfishcode in #231 - Implement unlocked-dep imports for component dependencies. by @peterhuene in #230
- Update to wit-component 0.21 and wit-parser 0.14. by @sunfishcode in #233
- Bump version to 0.8.0. by @peterhuene in #234
Full Changelog: v0.7.1...v0.8.0
v0.7.1
Compatibility
- Wasmtime: 17.0.0+
- WASI: 0.2.0 (stable preview 2! 🎉)
- Warg (registry support): 0.2.0
What's Changed
- Update the README. by @peterhuene in #218
- Update CI to setup wasmtime via release artifacts. by @peterhuene in #219
- Add a
package.metadata.component.proxy
setting. by @peterhuene in #221 - Add missing GH token for installing Wasmtime. by @peterhuene in #222
- Use
workspace_default_packages
now that it is implemented. by @peterhuene in #220 - tests fix by @macovedj in #223
- Bump for 0.7.1 release. by @peterhuene in #228
Full Changelog: v0.7.0...v0.7.1