forked from anza-xyz/mollusk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
100 lines (85 loc) · 2.75 KB
/
Makefile
File metadata and controls
100 lines (85 loc) · 2.75 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
SHELL := /usr/bin/env bash
NIGHTLY_TOOLCHAIN := nightly-2025-10-07
SOLANA_VERSION := 3.0.0
.PHONY: audit build-test-programs prepublish publish format format-check \
clippy test check-features all-checks nightly-version solana-version
# Print the nightly toolchain version for CI
nightly-version:
@echo $(NIGHTLY_TOOLCHAIN)
# Print the Solana version for CI
solana-version:
@echo $(SOLANA_VERSION)
audit:
@cargo audit \
--ignore RUSTSEC-2022-0093 \
--ignore RUSTSEC-2024-0344 \
--ignore RUSTSEC-2024-0421 \
--ignore RUSTSEC-2024-0376 \
--ignore RUSTSEC-2025-0009
# RUSTSEC-2022-0093: ed25519-dalek: Double Public Key Signing Function Oracle Attack
# RUSTSEC-2024-0344: curve25519-dalek
# RUSTSEC-2024-0421: idna accepts Punycode labels that do not produce any non-ASCII when decoded
# RUSTSEC-2024-0376: Remotely exploitable Denial of Service in Tonic
# RUSTSEC-2025-0009: Some AES functions may panic when overflow checking is enabled
build-test-programs:
@cargo build-sbf --manifest-path test-programs/cpi-target/Cargo.toml
@cargo build-sbf --manifest-path test-programs/custom-syscall/Cargo.toml
@cargo build-sbf --manifest-path test-programs/epoch-stake/Cargo.toml
@cargo build-sbf --manifest-path test-programs/primary/Cargo.toml
# Pre-publish checks
prepublish:
@agave-install init $(SOLANA_VERSION)
@rm -rf target
@cargo build
@$(MAKE) build-test-programs
@$(MAKE) format-check
@$(MAKE) clippy
@$(MAKE) check-features
@$(MAKE) test
# Publish crates in order
publish:
@set -e && set -u && set -o pipefail && \
CRATES=( \
"mollusk-svm-error" \
"mollusk-svm-keys" \
"mollusk-svm-fuzz-fs" \
"mollusk-svm-fuzz-fixture" \
"mollusk-svm-fuzz-fixture-firedancer" \
"mollusk-svm-result" \
"mollusk-svm" \
"mollusk-svm-bencher" \
"mollusk-svm-programs-memo" \
"mollusk-svm-programs-token" \
"mollusk-svm-cli" \
) && \
for crate in "$${CRATES[@]}"; do \
echo "Publishing $$crate..." && \
cargo publish -p $$crate --token $$TOKEN $(ARGS) && \
echo "$$crate published successfully!" && \
sleep 5; \
done && \
echo "All crates published successfully!"
format:
@cargo +$(NIGHTLY_TOOLCHAIN) fmt --all -- --check
format-fix:
@cargo +$(NIGHTLY_TOOLCHAIN) fmt --all
clippy:
@cargo +$(NIGHTLY_TOOLCHAIN) clippy --all --all-features --all-targets -- -D warnings
clippy-fix:
@cargo +$(NIGHTLY_TOOLCHAIN) clippy --all --all-features --all-targets --fix --allow-dirty --allow-staged -- -D warnings
check-features:
@cargo hack check --feature-powerset --no-dev-deps
build:
@$(MAKE) build-test-programs
@cargo build
test:
@$(MAKE) build-test-programs
@cargo test --all-features
# Run all checks in sequence
all-checks:
@echo "Running all checks..."
@$(MAKE) format
@$(MAKE) clippy
@$(MAKE) check-features
@$(MAKE) test
@echo "All checks passed!"