Skip to content

fix: add forge version check to check-build.sh#4677

Open
tenderdeve wants to merge 3 commits into
OffchainLabs:masterfrom
tenderdeve:fix/check-build-forge-version
Open

fix: add forge version check to check-build.sh#4677
tenderdeve wants to merge 3 commits into
OffchainLabs:masterfrom
tenderdeve:fix/check-build-forge-version

Conversation

@tenderdeve
Copy link
Copy Markdown

Summary

  • Add forge version validation to scripts/check-build.sh
  • Ensures forge 1.0.0 is installed before proceeding with the build
  • Prints a clear error explaining that newer forge versions use solar instead of solc for Yul compilation, which breaks the build
  • Suggests foundryup --version 1.0.0 as remediation

The check follows the same pattern as existing tool version checks in the script, using the command_exists and compare_versions helpers.

Fixes #4379

Test plan

  • Run ./scripts/check-build.sh with forge 1.0.0 installed — should pass
  • Run with a newer forge version — should fail with a clear message
  • Run without forge installed — should fail with "forge not found"

check-build.sh validates other tool versions but not forge,
allowing make build to fail with cryptic Yul compilation errors
when an incompatible forge version is installed. Add a version
check that ensures forge 1.0.0 is present and prints a clear
error with remediation steps if not.

Fixes OffchainLabs#4379
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 28, 2026

CLA assistant check
All committers have signed the CLA.

@tenderdeve tenderdeve marked this pull request as ready for review April 28, 2026 10:15
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.15%. Comparing base (6dce8d1) to head (e2c3993).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4677      +/-   ##
==========================================
+ Coverage   52.39%   60.15%   +7.75%     
==========================================
  Files         506      506              
  Lines       73739    60415   -13324     
==========================================
- Hits        38636    36340    -2296     
+ Misses      29947    18770   -11177     
- Partials     5156     5305     +149     

@bragaigor bragaigor self-assigned this May 6, 2026
Copy link
Copy Markdown
Contributor

@bragaigor bragaigor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. Just a few comments. And you're also missing a changelog file :)

Comment thread scripts/check-build.sh Outdated
Comment thread scripts/check-build.sh Outdated
Comment thread scripts/check-build.sh Outdated
Co-authored-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
tenderdeve pushed a commit to tenderdeve/nitro that referenced this pull request May 14, 2026
Address review feedback on OffchainLabs#4677:
- rename forge_max_version -> forge_version_needed (compare_versions
  uses exact match, not a ceiling)
- collapse Foundry/forge installation blocks into one cascade so the
  user sees a single appropriate error
- print success message when forge version matches (previously the
  matched branch printed the "not compatible" error)
- add changelog/tenderdeve-nit-4379.md
Address review feedback on OffchainLabs#4677:
- rename forge_max_version -> forge_version_needed (compare_versions
  uses exact match, not a ceiling)
- collapse Foundry/forge installation blocks into one cascade so the
  user sees a single appropriate error
- print success message when forge version matches (previously the
  matched branch printed the "not compatible" error)
- add changelog/tenderdeve-nit-4379.md
@tenderdeve tenderdeve force-pushed the fix/check-build-forge-version branch from 2c28d6f to e2c3993 Compare May 14, 2026 04:41
Copy link
Copy Markdown
Contributor

@bragaigor bragaigor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix and for iterating on the comments, much appreciated. The PR looks great from my side.

Quick heads-up: We recently changed our internal process around merging PRs, so this may take a bit longer than usual to land. Please bear with us, and thanks again for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

check-build.sh should validate forge --version to prevent make build failing

3 participants