Skip to content

Commit 8400d7b

Browse files
committed
fix(ci): share l1-contracts solc across forge builds
1 parent db4ec58 commit 8400d7b

3 files changed

Lines changed: 22 additions & 5 deletions

File tree

Makefile

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,11 @@ bb-acir: noir bb-cpp-native bb-ts
227227
bb-docs:
228228
$(call build,$@,barretenberg/docs)
229229

230-
# BB Solidity - Solidity verifier contracts
231-
bb-sol: bb-cpp-native bb-crs
230+
# BB Solidity - Solidity verifier contracts.
231+
# Depends on l1-contracts-solc so that the foundry build uses the solc binary
232+
# pulled in by l1-contracts (see barretenberg/sol/foundry.toml) rather than
233+
# triggering a parallel svm download.
234+
bb-sol: bb-cpp-native bb-crs l1-contracts-solc
232235
$(call build,$@,barretenberg/sol)
233236

234237
#==============================================================================
@@ -309,8 +312,16 @@ noir-projects: noir-protocol-circuits mock-protocol-circuits noir-contracts azte
309312
# L1 Contracts - Ethereum L1 smart contracts
310313
#==============================================================================
311314

315+
# l1-contracts-solc: Download (or cache-hit) the pinned solc binary.
316+
# This is the single owner of the svm download. Other forge projects
317+
# (barretenberg/sol, docs/examples/solidity) point their foundry.toml at the
318+
# same binary, so they must wait on this target before invoking forge build,
319+
# otherwise parallel forge invocations race on ~/.svm.
320+
l1-contracts-solc:
321+
$(call build,$@,l1-contracts,download_solc)
322+
312323
# l1-contracts-src: Build all src/ contracts (fully independent!)
313-
l1-contracts-src:
324+
l1-contracts-src: l1-contracts-solc
314325
$(call build,$@,l1-contracts,build_src)
315326

316327
# l1-contracts-verifier: Build generated verifier and tests (depends on noir-protocol-circuits)

barretenberg/sol/foundry.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ evm_version = "cancun"
1212
[fuzz]
1313
runs = 2
1414

15-
solc = "0.8.29"
15+
# Use the pre-downloaded solc binary from l1-contracts. l1-contracts' build is
16+
# the single owner of the svm download; pointing other forge projects at the
17+
# same binary avoids parallel svm downloads racing on ~/.svm.
18+
solc = "../../l1-contracts/solc-0.8.30"
1619

1720
[lint]
1821
ignore = ["./lib/**"]

docs/examples/solidity/foundry.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
src = '.'
33
out = 'out'
44
libs = ['../../../l1-contracts/lib', '../../../l1-contracts/src']
5-
solc_version = '0.8.27'
5+
# Use the pre-downloaded solc binary from l1-contracts. l1-contracts' build is
6+
# the single owner of the svm download; pointing other forge projects at the
7+
# same binary avoids parallel svm downloads racing on ~/.svm.
8+
solc = "../../../l1-contracts/solc-0.8.30"
69
evm_version = 'prague'
710
optimizer = true
811

0 commit comments

Comments
 (0)