Skip to content

Commit b7db64b

Browse files
committed
convert wit to wasm files
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
1 parent fa33aa0 commit b7db64b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.github/workflows/dep_rust.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ jobs:
8282
# this must be build before the formatting and other jobs run
8383
# because the component model example depends on the wasm component built here
8484
just ensure-tools
85+
just compile-wit
8586
just build-rust-component-examples ${{ matrix.config }}
8687
8788
- name: Fmt

Justfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,14 @@ mkdir-redist target=default-target:
2828
mkdir {{ mkdir-arg }} x64
2929
mkdir {{ mkdir-arg }} x64/{{ target }}
3030

31+
compile-wit:
32+
wasm-tools component wit ./src/wasmsamples/components/runcomponent.wit -w -o ./src/wasmsamples/components/runcomponent-world.wasm
33+
wasm-tools component wit ./src/component_sample/wit/example.wit -w -o ./src/component_sample/wit/component-world.wasm
34+
3135
build-wasm-runtime target=default-target:
3236
cd ./src/wasm_runtime && cargo build --verbose --profile={{ if target == "debug" {"dev"} else { target } }} && rm -R target
3337

34-
build-wasm-examples target=default-target:
35-
wasm-tools component wit ./src/wasmsamples/components/runcomponent.wit -w -o ./src/wasmsamples/components/runcomponent-world.wasm
38+
build-wasm-examples target=default-target: (compile-wit)
3639
{{ build-wasm-examples-command }} {{target}}
3740

3841
build-rust-wasm-examples target=default-target: (mkdir-redist target)
@@ -41,8 +44,7 @@ build-rust-wasm-examples target=default-target: (mkdir-redist target)
4144
cargo run -p hyperlight-wasm-aot compile ./src/rust_wasm_samples/target/wasm32-unknown-unknown/{{ target }}/rust_wasm_samples.wasm ./x64/{{ target }}/rust_wasm_samples.aot
4245
cp ./x64/{{ target }}/rust_wasm_samples.aot ./x64/{{ target }}/rust_wasm_samples.wasm
4346

44-
build-rust-component-examples target=default-target:
45-
wasm-tools component wit ./src/component_sample/wit/example.wit -w -o ./src/component_sample/wit/component-world.wasm
47+
build-rust-component-examples target=default-target: (compile-wit)
4648
# 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
4749
# 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
4850
rustup target add wasm32-unknown-unknown

0 commit comments

Comments
 (0)