forked from holochain/holochain
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
148 lines (127 loc) · 4.71 KB
/
Copy pathMakefile
File metadata and controls
148 lines (127 loc) · 4.71 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# holochain Makefile
# All default features of binaries excluding mutually exclusive features wasmer-sys-cranelift & wasmer-wasmi
# and tx5 transport and iroh transport
COMMON_DEFAULT_FEATURES=slow_tests,build_wasms,sqlite-encrypted
DEFAULT_FEATURES=transport-iroh,$(COMMON_DEFAULT_FEATURES)
DEFAULT_FEATURES_TRANSPORT_TX5=transport-tx5-backend-go-pion,$(COMMON_DEFAULT_FEATURES)
UNSTABLE_FEATURES=unstable-sharding,unstable-functions,unstable-migration,$(DEFAULT_FEATURES)
# mark everything as phony because it doesn't represent a file-system output
.PHONY: default \
static-all static-fmt static-toml static-clippy static-clippy-unstable \
static-doc build-workspace-wasmer-sys-cranelift build-workspace-wasmer-wasmi \
build-workspace-wasmer-sys-llvm test-workspace-wasmer-sys-cranelift \
test-workspace-wasmer-sys-llvm test-workspace-wasmer-wasmi \
build-workspace-wasmer-sys-cranelift-unstable \
test-workspace-wasmer-sys-cranelift-unstable \
toml-fix
# default to running everything (first rule)
default: build-workspace-wasmer-sys-cranelift \
test-workspace-wasmer-sys-cranelift \
build-workspace-wasmer-wasmi \
test-workspace-wasmer-wasmi
# execute all static code validation
static-all: static-fmt static-toml static-clippy static-clippy-unstable static-doc
# ensure committed code is formatted properly
static-fmt:
cargo fmt --check
# lint our toml files
static-toml:
cargo install taplo-cli@0.10.0
taplo format --check ./*.toml
taplo format --check ./crates/**/*.toml
# fix our toml files
toml-fix:
cargo install taplo-cli@0.10.0
taplo format ./*.toml
taplo format ./crates/**/*.toml
# ensure our chosen style lints are followed
static-clippy:
CHK_SQL_FMT=1 cargo clippy --all-targets --features $(DEFAULT_FEATURES)
static-clippy-unstable:
CHK_SQL_FMT=1 cargo clippy --all-targets --features $(UNSTABLE_FEATURES)
# ensure we can build the docs
# --no-deps skips generating HTML for third-party dependencies, which is the
# bulk of the work; we only care that our own crates' docs build cleanly.
static-doc:
RUSTDOCFLAGS=-Dwarnings cargo doc --workspace --no-deps
# build all targets
# this not only builds the test binaries for usage by `test-workspace`,
# but also ensures targets like benchmarks remain buildable.
# NOTE: excludes must match test-workspace nextest params,
# otherwise some rebuilding will occur due to resolver = "2"
build-workspace-wasmer-sys-cranelift:
cargo build \
--workspace \
--locked \
--all-targets \
--no-default-features \
--features $(DEFAULT_FEATURES),wasmer-sys-cranelift
build-workspace-wasmer-sys-cranelift-unstable:
cargo build \
--workspace \
--locked \
--all-targets \
--no-default-features \
--features $(UNSTABLE_FEATURES),wasmer-sys-cranelift
build-workspace-wasmer-sys-llvm:
cargo build \
--workspace \
--locked \
--all-targets \
--no-default-features \
--features $(DEFAULT_FEATURES),wasmer-sys-llvm
build-workspace-wasmer-wasmi:
cargo build \
--workspace \
--locked \
--all-targets \
--no-default-features \
--features $(DEFAULT_FEATURES),wasmer-wasmi
build-workspace-wasmer-sys-cranelift-transport_tx5:
cargo build \
--workspace \
--locked \
--all-targets \
--no-default-features \
--features $(DEFAULT_FEATURES_TRANSPORT_TX5),wasmer-sys-cranelift
# execute tests on all crates with the cranelift wasmer compiler and iroh transport
test-workspace-wasmer-sys-cranelift:
RUST_BACKTRACE=1 cargo nextest run \
--workspace \
--locked \
--no-default-features \
--features $(DEFAULT_FEATURES),wasmer-sys-cranelift
# execute tests on all crates with the LLVM wasmer compiler and iroh transport
test-workspace-wasmer-sys-llvm:
RUST_BACKTRACE=1 cargo nextest run \
--workspace \
--locked \
--no-default-features \
--features $(DEFAULT_FEATURES),wasmer-sys-llvm
# executes tests on all crates with wasmer compiler
test-workspace-wasmer-sys-cranelift-unstable:
RUST_BACKTRACE=1 cargo nextest run \
--workspace \
--locked \
--no-default-features \
--features $(UNSTABLE_FEATURES),wasmer-sys-cranelift
# execute tests on all crates with wasmer interpreter
test-workspace-wasmer-wasmi:
RUST_BACKTRACE=1 cargo nextest run \
--workspace \
--locked \
--no-default-features \
--features $(DEFAULT_FEATURES),wasmer-wasmi
# execute tests on all crates with wasmer compiler and tx5 transport
test-workspace-wasmer-sys-cranelift-transport_tx5:
RUST_BACKTRACE=1 cargo nextest run \
--workspace \
--locked \
--no-default-features \
--features $(DEFAULT_FEATURES_TRANSPORT_TX5),wasmer-sys-cranelift
clean:
cargo clean
# Remove untracked .dna files
git ls-files -z --others --ignored --exclude-standard -- '*.dna' | xargs -0 rm --
# Remove untracked .happ files
git ls-files -z --others --ignored --exclude-standard '*.happ' | xargs -0 rm --