Skip to content

Commit

Permalink
feat: add install-rust-targets
Browse files Browse the repository at this point in the history
Fix #108
  • Loading branch information
dierbei committed Jul 11, 2023
1 parent 5ca163a commit b6cb79b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ jobs:
"containerd-shim-wws-v1 -> target"
- name: "Install Rust Wasm targets"
run: |
rustup target add wasm32-wasi
rustup target add wasm32-unknown-unknown
make install-rust-targets
- name: "Install dependencies"
run: |
sudo apt-get update
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ jobs:
"containerd-shim-wws-v1 -> target"
- name: "Install Rust Wasm targets"
run: |
rustup target add wasm32-wasi
rustup target add wasm32-unknown-unknown
make install-rust-targets
- name: "Install dependencies"
run: |
sudo apt-get update
Expand All @@ -42,8 +41,7 @@ jobs:
"containerd-shim-wws-v1 -> target"
- name: "Install Rust Wasm targets"
run: |
rustup target add wasm32-wasi
rustup target add wasm32-unknown-unknown
make install-rust-targets
- name: "Install dependencies"
run: |
sudo apt-get update
Expand Down
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ build: build-spin-cross-$(TARGET) build-slight-cross-$(TARGET) build-wws-cross-$
install-cross:
@if [ -z $$(which cross) ]; then cargo install cross --git https://github.com/cross-rs/cross; fi

.PHONY: install-rust-targets
install-rust-targets:
rustup target add wasm32-wasi && rustup target add wasm32-unknown-unknown

# build-cross can be be used to build any cross supported target (make build-cross-x86_64-unknown-linux-musl)
.PHONY: build-spin-cross-%
build-spin-cross-%: install-cross
Expand All @@ -54,15 +58,15 @@ build-wws-cross-%: install-cross
cross build --release --target $* --manifest-path=containerd-shim-wws-v1/Cargo.toml -vvv

.PHONY: build-spin
build-spin:
build-spin: install-rust-targets
cargo build --release --manifest-path=containerd-shim-spin-v1/Cargo.toml

.PHONY: build-slight
build-slight:
build-slight: install-rust-targets
cargo build --release --manifest-path=containerd-shim-slight-v1/Cargo.toml

.PHONY: build-wws
build-slight:
build-wss:
cargo build --release --manifest-path=containerd-shim-wws-v1/Cargo.toml

.PHONY: install
Expand Down Expand Up @@ -121,5 +125,5 @@ clean-slight:
cargo clean --manifest-path containerd-shim-slight-v1/Cargo.toml

.PHONY: clean-wws
clean-slight:
clean-wss:
cargo clean --manifest-path containerd-shim-wws-v1/Cargo.toml

0 comments on commit b6cb79b

Please sign in to comment.