forked from aztec-labs-eng/aztec-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
183 lines (142 loc) · 6.52 KB
/
Copy pathMakefile
File metadata and controls
183 lines (142 loc) · 6.52 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# Aztec Packages Build System
#
# This Makefile is called by the root bootstrap.sh build and build_and_test functions.
# It coordinates the build order and dependencies between projects.
# The actual build logic remains in each project's bootstrap.sh script.
#
# Note that "test" targets don't *run* tests, they just output test commands to /tmp/test_cmds.
#
# Expectation is to run with one of the following targets:
# - make fast
# - make full
# - make release
# Shell to use for all commands
SHELL := /bin/bash
# Make would otherwise default to the first target in the file.
.DEFAULT_GOAL := fast
export DENOISE := 1
ROOT := $(shell git rev-parse --show-toplevel)
# Core helper to run a shell command with colored, prefixed output
# Usage: $(call run_command,label,directory,command)
# Color is automatically computed from label hash by color_prefix script
define run_command
@cd $(2) && $(ROOT)/ci3/color_prefix $(1) "$(3)"
endef
# Main build helper - calls bootstrap.sh with optional function argument
# Usage: $(call build,label,project-path[,function-name])
# label: Display name for colored output (usually the target name)
# project-path: Path to the project directory
# function-name: Optional bootstrap.sh command
define build
$(call run_command,$(1),$(ROOT)/$(2),$(ROOT)/ci3/denoise './bootstrap.sh $(3)')
endef
# Collects the test commands from the given project
# Writes the full output to /tmp/test_cmds atomically.
# The test engine is expected to be running and it will read commands from this file.
# MAKEFILE_TARGET is exported so filter_test_cmds can inject it into the hash prefix for targeted rebuilds.
# prefix_test_cmds inserts TEST_CMD_PREFIX between the hash prefix and the command: a repo that
# drives this one as a subdirectory runs the test engine from its own root, so it prefixes the
# commands with a cd into this checkout. It runs before the filter so the cached-test check
# hashes the same line the engine records.
define test
$(call run_command,$(1),$(ROOT)/$(2),\
export MAKEFILE_TARGET=$(1) && ./bootstrap.sh test_cmds $(3) | $(ROOT)/ci3/prefix_test_cmds | $(ROOT)/ci3/filter_test_cmds | $(ROOT)/ci3/atomic_append /tmp/test_cmds)
endef
#==============================================================================
# PHONY TARGETS - List every target that has a file/dir of the same name.
#==============================================================================
.PHONY: noir-projects release-image playground docs aztec-up spartan labs-aztec-toolchain
#==============================================================================
# BOOTSTRAP TARGETS
#==============================================================================
# Fast bootstrap.
fast: yarn-project yarn-project-tests \
aztec-nr \
noir-contracts \
aztec-up aztec-up-tests \
contract-snapshots-tests \
spartan \
playground playground-tests \
docs docs-tests \
release-image release-image-tests \
claude-tests
# Full bootstrap.
full: fast yarn-project-benches
# Everything required to run the full benchmark suite (see bootstrap.sh bench_cmds), and nothing more.
# yarn-project-benches covers the e2e bench inputs and yarn-project's own benches;
# noir-contracts was previously built transitively via yarn-project.
# chonk-inputs and crs pre-download the pinned Chonk IVC inputs and the CRS: the proof
# benches run in no-network containers, so bb and bb.js must find both on disk rather
# than fetch on demand.
bench: yarn-project-benches noir-contracts chonk-inputs crs
chonk-inputs:
$(call run_command,$@,$(ROOT)/labs-aztec-toolchain,./download_chonk_inputs.sh)
crs:
$(call run_command,$@,$(ROOT)/ci3/aws,./download_crs.sh)
# Release.
release: fast
#==============================================================================
# .claude tooling
#==============================================================================
.PHONY: claude-tests
claude-tests:
$(call test,$@,.claude)
#==============================================================================
# Labs Aztec Toolchain
#==============================================================================
labs-aztec-toolchain:
$(call build,$@,labs-aztec-toolchain)
#==============================================================================
# Noir Projects
#==============================================================================
# Format check. It also warms the nargo dependency cache, so it must complete before the
# subproject builds to avoid parallel nargo runs tripping over each other downloading.
noir-projects-format-check: labs-aztec-toolchain
$(call build,$@,noir-projects,format_check)
noir-contracts: noir-projects-format-check labs-aztec-toolchain
$(call build,$@,noir-projects/noir-contracts)
aztec-nr: noir-projects-format-check labs-aztec-toolchain
$(call build,$@,noir-projects/aztec-nr)
# These tests are not included in the dep tree.
# Rather this target must be explicitly called by bootstrap.sh after it's started the txe's.
noir-projects-txe-tests:
$(call test,$@,noir-projects/aztec-nr)
$(call test,$@,noir-projects/noir-contracts)
contract-snapshots-tests: noir-projects-format-check labs-aztec-toolchain
$(call test,$@,noir-projects/contract-snapshots)
# Noir Projects - Aggregate target
noir-projects: noir-contracts aztec-nr
#==============================================================================
# Yarn Project - TypeScript monorepo with all TS packages
#==============================================================================
yarn-project: noir-projects labs-aztec-toolchain
$(call build,$@,yarn-project)
# crs: the prover e2e tests run in no-network containers, so bb and bb.js must find the
# CRS on disk rather than fetch on demand.
yarn-project-tests: yarn-project crs
$(call test,$@,yarn-project/end-to-end)
$(call test,$@,yarn-project)
yarn-project-benches: yarn-project
$(call build,$@,yarn-project/end-to-end,build_bench)
#==============================================================================
# The Rest
#==============================================================================
# Release Image - Docker image for releases
release-image: yarn-project labs-aztec-toolchain
$(call build,$@,release-image)
release-image-tests: release-image
$(call test,$@,release-image)
playground: yarn-project
$(call build,$@,playground)
playground-tests: playground
$(call test,$@,playground)
docs: yarn-project labs-aztec-toolchain
$(call build,$@,docs)
docs-tests: docs
$(call test,$@,docs)
aztec-up: yarn-project labs-aztec-toolchain
$(call build,$@,aztec-up)
aztec-up-tests: aztec-up
$(call test,$@,aztec-up)
spartan:
$(call build,$@,spartan)