-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathjustfile
More file actions
41 lines (32 loc) · 1.36 KB
/
justfile
File metadata and controls
41 lines (32 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
TARGET_DIR := justfile_directory() + "/target"
BIN_DIR := TARGET_DIR + "/bin"
GUEST_DIR := justfile_directory() + "/guest"
default: run
install-cargo-component:
test -f {{ BIN_DIR }}/cargo-component || \
cargo install cargo-component \
--root {{ TARGET_DIR }}
build-component: install-cargo-component
test -f {{ TARGET_DIR }}/wasm32-wasip1/release/sample_wasi_http_rust.wasm || \
cargo-component build --release \
--manifest-path {{ GUEST_DIR }}/Cargo.toml \
--target-dir {{ TARGET_DIR }}
install-hyperlight-wasm-aot:
test -f {{ BIN_DIR }}/hyperlight-wasm-aot || \
cargo install hyperlight-wasm-aot \
--root {{ TARGET_DIR }}
aot-component: build-component install-hyperlight-wasm-aot
{{ BIN_DIR }}/hyperlight-wasm-aot compile --component \
{{ TARGET_DIR }}/wasm32-wasip1/release/sample_wasi_http_rust.wasm \
{{ TARGET_DIR }}/wasm32-wasip1/release/sample_wasi_http_rust.bin
install-wasm-tools:
test -f {{ BIN_DIR }}/wasm-tools || \
cargo install wasm-tools \
--root {{ TARGET_DIR }}
make-wit-world: install-wasm-tools
test -f hyperlight-world.wasm || \
{{ BIN_DIR }}/wasm-tools component wit hyperlight.wit -w -o hyperlight-world.wasm
build: make-wit-world
cargo build
run: build aot-component
cargo run -- {{ TARGET_DIR }}/wasm32-wasip1/release/sample_wasi_http_rust.bin