-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJustfile
33 lines (26 loc) · 1.25 KB
/
Justfile
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
build-adder:
cd components/adder && cargo component build --release
init-subtractor:
cd components/subtractor && npm install
build-subtractor: init-subtractor
cd components/subtractor && npm run build:component
build-calculator:
cd components/calculator && cargo component build --release
build-component: build-adder build-subtractor build-calculator
# compose the wasm components
wac plug ./components/calculator/target/wasm32-wasip1/release/calculator.wasm \
--plug ./components/adder/target/wasm32-wasip1/release/adder.wasm \
--plug ./components/subtractor/subtractor.wasm \
--output calculator-composed.wasm
# ahead-of-time compile the composed component
hyperlight-wasm-aot compile --component calculator-composed.wasm ./example/calculator-composed.bin
compile-wit:
wasm-tools component wit {{ justfile_directory() }}/example/calculator-composed.wit -w -o {{ justfile_directory() }}/example/calculator-composed-world.wasm
build-example: compile-wit
cd example && \
HYPERLIGHT_WASM_WORLD={{ justfile_directory() }}/example/calculator-composed-world.wasm \
cargo build
run-example: compile-wit
cd example && \
HYPERLIGHT_WASM_WORLD={{ justfile_directory() }}/example/calculator-composed-world.wasm \
cargo run