forked from chainwayxyz/citrea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
103 lines (80 loc) · 3.52 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
# The release tag of https://github.com/ethereum/tests to use for EF tests
EF_TESTS_URL := https://github.com/chainwayxyz/ef-tests/archive/develop.tar.gz
EF_TESTS_DIR := crates/evm/ethereum-tests
.PHONY: help
help: ## Display this help message
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
build: ## Build the the project
@cargo build
build-release: ## Build the project in release mode
@cargo build --release
clean: ## Cleans compiled
@cargo clean
clean-node: ## Cleans local dbs needed for sequencer and nodes
sudo rm -rf resources/dbs/postgres
rm -rf resources/dbs/sequencer-db
rm -rf resources/dbs/prover-db
rm -rf resources/dbs/full-node-db
test-legacy: ## Runs test suite with output from tests printed
@cargo test -- --nocapture -Zunstable-options --report-time
test: $(EF_TESTS_DIR) ## Runs test suite using next test
@cargo nextest run --workspace --all-features --no-fail-fast $(filter-out $@,$(MAKECMDGOALS))
install-dev-tools: ## Installs all necessary cargo helpers
cargo install --locked dprint
cargo install cargo-llvm-cov
cargo install cargo-hack
cargo install cargo-udeps
cargo install flaky-finder
cargo install cargo-nextest --locked
cargo install cargo-binstall
cargo binstall cargo-risczero
ifeq ($(shell uname -ms), Darwin x86_64)
cargo risczero build-toolchain
else
cargo risczero install --version v2024-04-22.0
endif
rustup target add thumbv6m-none-eabi
rustup component add llvm-tools-preview
cargo install cargo-llvm-cov
lint: ## cargo check and clippy. Skip clippy on guest code since it's not supported by risc0
## fmt first, because it's the cheapest
cargo +nightly fmt --all --check
cargo check --all-targets --all-features
$(MAKE) check-fuzz
SKIP_GUEST_BUILD=1 cargo clippy --all-targets --all-features
lint-fix: ## cargo fmt, fix and clippy. Skip clippy on guest code since it's not supported by risc0
cargo +nightly fmt --all
cargo fix --allow-dirty
SKIP_GUEST_BUILD=1 cargo clippy --fix --allow-dirty
check-features: ## Checks that project compiles with all combinations of features.
cargo hack check --workspace --feature-powerset --exclude-features default --all-targets
check-fuzz: ## Checks that fuzz member compiles
$(MAKE) -C crates/sovereign-sdk/fuzz check
check-no-std: ## Checks that project compiles without std
$(MAKE) -C crates/sovereign-sdk/rollup-interface $@
$(MAKE) -C crates/sovereign-sdk/module-system/sov-modules-core $@
find-unused-deps: ## Prints unused dependencies for project. Note: requires nightly
cargo +nightly udeps --all-targets --all-features
find-flaky-tests: ## Runs tests over and over to find if there's flaky tests
flaky-finder -j16 -r320 --continue "cargo test -- --nocapture"
coverage: $(EF_TESTS_DIR) ## Coverage in lcov format
cargo llvm-cov --locked --lcov --output-path lcov.info nextest --workspace --all-features
coverage-html: ## Coverage in HTML format
cargo llvm-cov --locked --all-features --html nextest --workspace --all-features
docs: ## Generates documentation locally
cargo doc --open
set-git-hook:
git config core.hooksPath .githooks
# Downloads and unpacks Ethereum Foundation tests in the `$(EF_TESTS_DIR)` directory.
#
# Requires `wget` and `tar`
$(EF_TESTS_DIR):
mkdir $(EF_TESTS_DIR)
wget $(EF_TESTS_URL) -O ethereum-tests.tar.gz
tar -xzf ethereum-tests.tar.gz --strip-components=1 -C $(EF_TESTS_DIR)
rm ethereum-tests.tar.gz
.PHONY: ef-tests
ef-tests: $(EF_TESTS_DIR) ## Runs Ethereum Foundation tests.
cargo nextest run -p citrea-evm general_state_tests
%:
@: