Skip to content

Commit 206d158

Browse files
committed
Add ensure tools as a seperate step
Signed-off-by: James Sturtevant <jstur@microsoft.com>
1 parent 1f10eac commit 206d158

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/dep_rust.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ jobs:
7878
path: ./x64/${{ matrix.config }}
7979

8080
- name: Build Rust component model examples
81-
run: just build-rust-component-examples ${{ matrix.config }}
81+
run: |
82+
# this must be build before the formatting and other jobs run
83+
# because the component model example depends on the wasm component built here
84+
just ensure-tools
85+
just build-rust-component-examples ${{ matrix.config }}
8286
8387
- name: Fmt
8488
run: just fmt-check

Justfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ wit-world := if os() == "windows" { "$env:WIT_WORLD=\"" + justfile_directory() +
77

88
set windows-shell := ["pwsh.exe", "-NoLogo", "-Command"]
99

10+
ensure-tools:
11+
cargo install --locked wasm-tools --version 1.235.0
12+
cargo install cargo-component --locked --version 0.21.1
13+
1014
build-all target=default-target: (build target) (build-wasm-examples target) (build-rust-wasm-examples target) (build-wasm-runtime target) (build-rust-component-examples target)
1115

1216
build target=default-target features="": (build-wasm-runtime target) (fmt-check)
@@ -33,8 +37,6 @@ build-rust-wasm-examples target=default-target: (mkdir-redist target)
3337
cp ./x64/{{ target }}/rust_wasm_samples.aot ./x64/{{ target }}/rust_wasm_samples.wasm
3438

3539
build-rust-component-examples target=default-target:
36-
cargo install --locked wasm-tools
37-
cargo install cargo-component --locked
3840
wasm-tools component wit ./src/component_sample/wit/example.wit -w -o ./src/component_sample/wit/component-world.wasm
3941
# 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
4042
# 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

0 commit comments

Comments
 (0)