Skip to content

Stop using cargo-component to build examples - #582

Open
syntactically wants to merge 1 commit into
lm/nightly-targetsfrom
lm/no-cargo-component
Open

syntactically wants to merge 1 commit into
lm/nightly-targetsfrom
lm/no-cargo-component

Conversation

@syntactically

Copy link
Copy Markdown
Member

Previously, we built the component examples using cargo component, which is a useful easy entry tool for building components. Unfortunately, cargo component has not had a release for some time, and the version of wit-bindgen that it depends on and uses for bindings generation is quite old. That wit-bindgen is no longer compatible with modern wit-bindgen-rt when generating bindings using p3 future/stream/async types.

This commit replaces cargo component build with an explicit wit_bindgen::generate macro invocation (which, as a dependency of the example crates, is now in sync with the relevant wit-bingen-rt version) and RUSTFLAGS="-C linker=wasm-component-ld" cargo build --target=wasm32-unknown-unknown, which seems to work well enough.

Previously, we built the component examples using `cargo
component`, which is a useful easy entry tool for building
components. Unfortunately, `cargo component` has not had a release for
some time, and the version of wit-bindgen that it depends on and uses
for bindings generation is quite old.  That wit-bindgen is no longer
compatible with modern `wit-bindgen-rt` when generating bindings using
p3 future/stream/async types.

This commit replaces `cargo component build` with an explicit
`wit_bindgen::generate` macro invocation (which, as a dependency of
the example crates, is now in sync with the relevant `wit-bingen-rt`
version) and `RUSTFLAGS="-C linker=wasm-component-ld" cargo build
--target=wasm32-unknown-unknown`, which seems to work well enough.

Signed-off-by: Lucy Menon <168595099+syntactically@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant