-
Notifications
You must be signed in to change notification settings - Fork 2
/
justfile
65 lines (53 loc) · 1.78 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
set positional-arguments
export MIRIFLAGS := "-Zmiri-disable-isolation -Zmiri-tree-borrows"
export CARGO_TARGET_WASM32_WASI_RUNNER := "tools/wasmtime.sh"
export WASMTIME_BACKTRACE_DETAILS := "1"
install-tools:
command -v cargo-hack &>/dev/null || cargo install cargo-hack
rustup +nightly component add miri
rustup target add wasm32-unknown-unknown
rustup target add wasm32-wasi
rustup target add x86_64-unknown-linux-musl
rustup target add x86_64-unknown-linux-gnu
test:
cargo test
test-wasm:
cargo test --target wasm32-wasi -- --nocapture
build-wasm:
cargo +nightly build --profile wasm \
--target wasm32-unknown-unknown \
--features serde \
-Z build-std=std,panic_abort \
-Z build-std-features=panic_immediate_abort \
--no-default-features \
--features wasm
mkdir -p target/wasm-opt
@echo "optimizing wasm files ..."
fd . -d1 -ewasm target/wasm32-unknown-unknown/wasm \
-x wasm-opt -Oz -o target/wasm-opt/{/} {}
@echo "optimized wasm files saved to target/wasm-opt"
build-mini:
cargo build --profile wasm \
--target x86_64-unknown-linux-gnu \
-Z build-std=std,panic_abort \
-Z build-std-features=panic_immediate_abort \
--no-default-features
before-commit:
cargo check
cargo test
@just test-wasm
test-all: install-tools
cargo test
@just test-wasm
@echo "testing with miri, this will take a long time"
@just test-miri
@just test-miri-32
#cargo hack test --feature-powerset
@miri *args:
cargo miri "$@"
test-miri:
cargo +nightly miri test
test-miri-32:
cargo +nightly miri --target i686-unknown-linux-gnu test
default:
@just --list