forked from ChainSafe/forest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
122 lines (95 loc) · 3.45 KB
/
Makefile
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
SER_TESTS = "tests/serialization_tests"
ifndef RUST_TEST_THREADS
RUST_TEST_THREADS := 1
OS := $(shell uname)
ifeq ($(OS),Linux)
RUST_TEST_THREADS := $(shell nproc)
else ifeq ($(OS),Darwin)
RUST_TEST_THREADS := $(shell sysctl -n hw.ncpu)
endif # $(OS)
endif
install:
cargo install --locked --path forest --force
clean-all:
cargo clean
clean:
@echo "Cleaning local packages..."
@cargo clean -p forest
@cargo clean -p forest_libp2p
@cargo clean -p forest_blocks
@cargo clean -p forest_chain_sync
@cargo clean -p forest_message
@cargo clean -p forest_state_manager
@cargo clean -p forest_interpreter
@cargo clean -p forest_crypto
@cargo clean -p forest_encoding
@cargo clean -p forest_ipld
@cargo clean -p forest_legacy_ipld_amt
@cargo clean -p forest_json
@cargo clean -p forest_fil_types
@cargo clean -p forest_ipld_blockstore
@cargo clean -p forest_rpc
@cargo clean -p forest_key_management
@cargo clean -p forest_json_utils
@cargo clean -p forest_test_utils
@cargo clean -p forest_message_pool
@cargo clean -p forest_genesis
@cargo clean -p forest_actor_interface
@cargo clean -p forest_hash_utils
@cargo clean -p forest_networks
@echo "Done cleaning."
# Lints with everything we have in our CI arsenal
lint-all: lint audit udeps spellcheck
audit:
cargo audit --ignore RUSTSEC-2020-0071 --ignore RUSTSEC-2022-0040
udeps:
cargo udeps --features test_constructors
spellcheck:
cargo spellcheck --code 1
lint: license clean
cargo fmt --all --check
taplo fmt --check
taplo lint
cargo clippy --all-targets -- -D warnings
cargo clippy --all-targets --features forest_deleg_cns -- -D warnings
# Formats Rust and TOML files
fmt:
cargo fmt --all
taplo fmt
build:
cargo build --bin forest
release:
cargo build --release --bin forest
docker-run:
docker build -t forest:latest -f ./Dockerfile . && docker run forest
# Git submodule test vectors
pull-serialization-tests:
git submodule update --init
run-serialization-vectors:
cargo test --release --manifest-path=$(SER_TESTS)/Cargo.toml --features "submodule_tests" -- --test-threads=$(RUST_TEST_THREADS)
run-vectors: run-serialization-vectors
test-vectors: pull-serialization-tests run-vectors
# Test all without the submodule test vectors with release configuration
test:
cargo test --all --exclude serialization_tests --exclude forest_message --exclude forest_crypto -- --test-threads=$(RUST_TEST_THREADS)
cargo test -p forest_crypto --features blst --no-default-features -- --test-threads=$(RUST_TEST_THREADS)
cargo test -p forest_message --features blst --no-default-features -- --test-threads=$(RUST_TEST_THREADS)
test-release:
cargo test --release --all --exclude serialization_tests --exclude forest_message --exclude forest_crypto -- --test-threads=$(RUST_TEST_THREADS)
cargo test --release -p forest_crypto --features blst --no-default-features -- --test-threads=$(RUST_TEST_THREADS)
cargo test --release -p forest_message --features blst --no-default-features -- --test-threads=$(RUST_TEST_THREADS)
smoke-test:
./scripts/smoke_test.sh
test-all: test-release test-vectors
# Checks if all headers are present and adds if not
license:
./scripts/add_license.sh
docs:
cargo doc --no-deps
mdbook:
mdbook serve documentation
mdbook-build:
mdbook build ./documentation
rustdoc:
cargo doc --workspace --all-features --no-deps
.PHONY: clean clean-all lint build release test test-all test-release license test-vectors run-vectors pull-serialization-tests install docs run-serialization-vectors rustdoc