Skip to content

Commit 8920e36

Browse files
committed
Add cargo component
Signed-off-by: James Sturtevant <jstur@microsoft.com>
1 parent 85730e1 commit 8920e36

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

Justfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ build-rust-wasm-examples target=default-target: (mkdir-redist target)
3333

3434
build-rust-wasi-examples target=default-target:
3535
cargo install --locked wasm-tools
36+
cargo install cargo-component --locked
3637
wasm-tools component wit ./src/wasi_samples/wit/example.wit -w -o ./src/wasi_samples/wit/component-world.wasm
3738
# use cargo component so we don't get all the wasi imports https://github.com/bytecodealliance/cargo-component?tab=readme-ov-file#relationship-with-wasm32-wasip2
3839
# we also explicitly target wasm32-unknown-unknown since cargo component might try to pull in wasi imports https://github.com/bytecodealliance/cargo-component/issues/290

src/wasi_samples/src/bindings.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,7 @@ macro_rules! __export_example_impl {
272272
#[doc(inline)]
273273
pub(crate) use __export_example_impl as export;
274274
#[cfg(target_arch = "wasm32")]
275-
#[unsafe(
276-
link_section = "component-type:wit-bindgen:0.41.0:wasi-sample:example:example:encoded world"
277-
)]
275+
#[unsafe(link_section = "component-type:wit-bindgen:0.41.0:wasi-sample:example:example:encoded world")]
278276
#[doc(hidden)]
279277
#[allow(clippy::octal_escapes)]
280278
pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 335] = *b"\

0 commit comments

Comments
 (0)