-
Notifications
You must be signed in to change notification settings - Fork 81
/
Copy pathMakefile
87 lines (63 loc) · 3.14 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
SHELL=/usr/bin/env bash
DOCKER := docker
DOCKER_IMAGE_NAME := builtin-actors-builder
DOCKER_RUN_OPTS := --rm -v $(PWD)/output:/output
DOCKER_PLATFORM := --platform linux/amd64
# Run cargo fmt
rustfmt:
cargo fmt --all --check
# NOTE: Check all targets, then check the build target specifically. Otherwise, it might build for
# testing but not otherwise due to feature resolution shenanigans.
# Run cargo check
check:
cargo clippy --all --all-targets -- -D warnings
cargo clippy --all -- -D warnings
# Run cargo test
test:
cargo test --workspace
docker-builder:
$(DOCKER) buildx build $(DOCKER_PLATFORM) . -t $(DOCKER_IMAGE_NAME); \
# Create a bundle in a deterministic location
bundle:
cargo run -- -o output/builtin-actors.car
bundle-repro: docker-builder
$(DOCKER) run $(DOCKER_PLATFORM) -e BUILD_FIL_NETWORK $(DOCKER_RUN_OPTS) $(DOCKER_IMAGE_NAME)
# Create all canonical network bundles
all-bundles: bundle-mainnet bundle-caterpillarnet bundle-butterflynet bundle-calibrationnet bundle-devnet bundle-testing bundle-testing
all-bundles-repro: bundle-mainnet-repro bundle-caterpillarnet-repro bundle-butterflynet-repro bundle-calibrationnet-repro bundle-devnet-repro bundle-testing-repro
bundle-mainnet:
BUILD_FIL_NETWORK=mainnet cargo run -- -o output/builtin-actors-mainnet.car
bundle-mainnet-repro: docker-builder
$(DOCKER) run $(DOCKER_PLATFORM) $(DOCKER_RUN_OPTS) $(DOCKER_IMAGE_NAME) "mainnet"
bundle-caterpillarnet:
BUILD_FIL_NETWORK=caterpillarnet cargo run -- -o output/builtin-actors-caterpillarnet.car
bundle-caterpillarnet-repro: docker-builder
$(DOCKER) run $(DOCKER_PLATFORM) $(DOCKER_RUN_OPTS) $(DOCKER_IMAGE_NAME) "caterpillarnet"
bundle-butterflynet:
BUILD_FIL_NETWORK=butterflynet cargo run -- -o output/builtin-actors-butterflynet.car
bundle-butterflynet-repro: docker-builder
$(DOCKER) run $(DOCKER_PLATFORM) $(DOCKER_RUN_OPTS) $(DOCKER_IMAGE_NAME) "butterflynet"
bundle-calibrationnet:
BUILD_FIL_NETWORK=calibrationnet cargo run -- -o output/builtin-actors-calibrationnet.car
bundle-calibrationnet-repro: docker-builder
$(DOCKER) run $(DOCKER_PLATFORM) $(DOCKER_RUN_OPTS) $(DOCKER_IMAGE_NAME) "calibrationnet"
bundle-devnet:
BUILD_FIL_NETWORK=devnet cargo run -- -o output/builtin-actors-devnet.car
bundle-devnet-repro: docker-builder
$(DOCKER) run $(DOCKER_PLATFORM) $(DOCKER_RUN_OPTS) $(DOCKER_IMAGE_NAME) "devnet"
bundle-testing:
BUILD_FIL_NETWORK=testing cargo run -- -o output/builtin-actors-testing.car
BUILD_FIL_NETWORK=testing-fake-proofs cargo run -- -o output/builtin-actors-testing-fake-proofs.car
bundle-testing-repro: docker-builder
$(DOCKER) run $(DOCKER_PLATFORM) $(DOCKER_RUN_OPTS) $(DOCKER_IMAGE_NAME) "testing"
# Check if the working tree is clean.
check-clean:
@git diff --quiet || { \
echo "Working tree dirty, please commit any changes first."; \
exit 1; \
}
.PHONY: rustfmt check check-clean test bundle
.PHONY: all-bundles bundle-mainnet bundle-caterpillarnet bundle-butterflynet bundle-calibrationnet \
bundle-devnet bundle-testing all-bundles-repro bundle-mainnet-repro bundle-caterpillarnet-repro \
bundle-butterflynet-repro bundle-calibrationnet-repro bundle-devnet-repro bundle-testing-repro \
docker-builder