Skip to content

fix(docs/examples): propagate forge build failures in compile-solidity#23346

Closed
AztecBot wants to merge 2 commits into
merge-train/spartanfrom
claudebox/fix-23336-amm-pipelining
Closed

fix(docs/examples): propagate forge build failures in compile-solidity#23346
AztecBot wants to merge 2 commits into
merge-train/spartanfrom
claudebox/fix-23336-amm-pipelining

Conversation

@AztecBot

@AztecBot AztecBot commented May 16, 2026

Copy link
Copy Markdown
Collaborator

Why

merge-train/spartan CI failed after #23336 (which only touches yarn-project/end-to-end/src/e2e_amm.test.ts). Root cause is unrelated to that PR: a transient DNS failure on binaries.soliditylang.org while forge was downloading solc caused forge build for aave_bridge to exit non-zero. The bash loop in docs/examples/bootstrap.sh::compile-solidity ignored that and kept going. The function returned 0 with aave_bridge's artifacts never written, and downstream validate_project aave_bridge failed with TS2307: Cannot find module '../../../target/solidity/aave_bridge/AavePortal.sol/AavePortal.json' (and TS2578 knock-on noise from @ts-expect-error directives that suppressed viem's strict ABI typing).

Log: http://ci.aztec-labs.com/bc425a95fd076f0d
Full analysis: https://gist.github.com/AztecBot/e0b9e2d66c2912f4179839796f97d47b

The reason the inner failure was silent is that run_step (in the same file) calls set +e before invoking the step function, so the subshell's forge build failures don't abort the loop, and the subshell's exit status reflects the last forge build (which succeeded).

What

docs/examples/bootstrap.sh::compile-solidity:

  1. Wrap each forge build in the existing ci3/retry helper (3 attempts × 5s sleep = ~10s of retry backoff per subdir, well under 30s).
  2. Record any subdir that fails all 3 attempts to an $OUTPUT_DIR/.failed marker (the subshell can't mutate an outer-scope array).
  3. After the loop, if the marker exists, list the failed subdirs and return 1. The outer run_step then retries the whole step once more — worst case ~6 attempts before failing CI loudly.

The happy path is unchanged: one forge build per subdir, no extra sleeps.

Test plan

Verified locally with HOME=/tmp ./docs/examples/bootstrap.sh compile-solidity:

  • Happy path: all three subdirs compile, expected JSONs (AavePortal.sol/AavePortal.json, MockERC20.sol/MockERC20.json, MockAToken.sol/MockAToken.json, MockAavePool.sol/MockAavePool.json) exist, exit 0.
  • Failure path (temporary broken_test/Bad.sol with invalid Solidity): ci3/retry printed Failed after 3 attempts: ..., marker captured, ERROR: Solidity compilation failed for: broken_test, exit 1.

The DNS-failure itself can't be reproduced locally — that's the whole reason we're hardening the script.

Supersedes #23345 (used inline 5-attempt 5→80s backoff against next; this PR uses the existing helper against the correct merge-train base with a tighter total backoff).

Out of scope

validate-webapp-tutorial is also silently returning 0 today while emitting real type errors (EmbeddedWallet / PXEConfig / GasSettings API drift) and a vite rollup error. Same set +e pattern. Not fixed here — needs its own PR with API updates to the tutorial code.

ClaudeBox log: https://claudebox.work/s/95a1d08774663f9c?run=2

@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels May 16, 2026
@AztecBot

Copy link
Copy Markdown
Collaborator Author

Automatically closing this stale claudebox draft PR (no updates for 5+ days). Re-open if still needed.

@AztecBot AztecBot closed this May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant