Skip to content

chore: migrate root Makefile to justfile#19477

Merged
ajsutton merged 10 commits intodevelopfrom
aj/migrate-root-makefile-to-just
Mar 13, 2026
Merged

chore: migrate root Makefile to justfile#19477
ajsutton merged 10 commits intodevelopfrom
aj/migrate-root-makefile-to-just

Conversation

@ajsutton
Copy link
Contributor

@ajsutton ajsutton commented Mar 10, 2026

Summary

  • Migrates all root Makefile targets to the root justfile, including build targets, Docker targets, test runners, and CI-specific test infrastructure
  • Replaces the root Makefile with the standard deprecated shim (justfiles/deprecated.mk) that forwards make invocations to just with a deprecation warning
  • Converts all make -C ./subdir target calls to cd subdir && just target — all subdirectories already have justfiles with deprecated Make shims
  • Adds semgrep-ci target (uses semgrep ci with develop baseline) alongside the existing semgrep target (uses semgrep scan)
  • Updates op-e2e/justfile to use cd .. && just cannon-prestates instead of make -C ..
  • Restores explanatory GOPRIVATE comment on mod-tidy
  • Updates CONTRIBUTING.md to reference just instead of make

Stack

  1. optimism#19473 — linter migration + shared infrastructure (merged)
  2. optimism#19474 — cannon migration (merged)
  3. optimism#19475 — op-e2e migration (merged)
  4. optimism#19476 — op-program migration
  5. This PR — root Makefile migration
  6. optimism#19482 — CI config update
  7. optimism#19483 — cannon testdata migration

Test plan

  • just --list at repo root shows all migrated targets
  • make build triggers the deprecation shim and delegates to just build
  • CI targets (go-tests-ci, go-tests-short-ci, go-tests-fraud-proofs-ci) work correctly in CircleCI
  • CI passes

🤖 Generated with Claude Code

@ajsutton ajsutton requested a review from a team as a code owner March 10, 2026 22:59
@ajsutton ajsutton force-pushed the aj/migrate-root-makefile-to-just branch from 14de15f to 5e8004e Compare March 11, 2026 03:48
@ajsutton ajsutton changed the base branch from develop to aj/migrate-op-program-makefile-to-just March 11, 2026 03:48
@wiz-inc-a178a98b5d
Copy link

wiz-inc-a178a98b5d bot commented Mar 11, 2026

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total -

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

@ajsutton ajsutton force-pushed the aj/migrate-op-program-makefile-to-just branch from f29f080 to ac12acf Compare March 11, 2026 04:01
@ajsutton ajsutton force-pushed the aj/migrate-root-makefile-to-just branch from 5e8004e to 7d3bec3 Compare March 11, 2026 04:01
@ajsutton ajsutton force-pushed the aj/migrate-op-program-makefile-to-just branch from ac12acf to e97849d Compare March 11, 2026 04:11
@ajsutton ajsutton force-pushed the aj/migrate-root-makefile-to-just branch 2 times, most recently from 0f7fa35 to 1739da5 Compare March 11, 2026 04:21
@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.8%. Comparing base (9a50c60) to head (8ce1363).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #19477      +/-   ##
===========================================
+ Coverage     75.3%    75.8%    +0.5%     
===========================================
  Files          194      477     +283     
  Lines        11285    59985   +48700     
===========================================
+ Hits          8502    45506   +37004     
- Misses        2639    14479   +11840     
+ Partials       144        0     -144     
Flag Coverage Δ
cannon-go-tests-64 ?
contracts-bedrock-tests ?
unit 75.8% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 671 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ajsutton ajsutton force-pushed the aj/migrate-op-program-makefile-to-just branch from 1e19f45 to cf8a75d Compare March 11, 2026 15:37
@ajsutton ajsutton force-pushed the aj/migrate-root-makefile-to-just branch from 1739da5 to 12e44a5 Compare March 11, 2026 15:37
@ajsutton ajsutton force-pushed the aj/migrate-op-program-makefile-to-just branch from cf8a75d to ccc870a Compare March 11, 2026 16:20
@ajsutton ajsutton force-pushed the aj/migrate-root-makefile-to-just branch from 12e44a5 to 7fa2ea1 Compare March 11, 2026 16:20
@ajsutton ajsutton force-pushed the aj/migrate-op-program-makefile-to-just branch from ccc870a to ef6564d Compare March 12, 2026 16:11
@ajsutton ajsutton force-pushed the aj/migrate-root-makefile-to-just branch from 7fa2ea1 to ecf46fb Compare March 12, 2026 16:11
@ajsutton ajsutton force-pushed the aj/migrate-op-program-makefile-to-just branch from ef6564d to 945b5e3 Compare March 12, 2026 18:24
@ajsutton ajsutton force-pushed the aj/migrate-root-makefile-to-just branch from ecf46fb to f42c9d3 Compare March 12, 2026 18:25
Copy link
Member

@sebastianst sebastianst left a comment

Choose a reason for hiding this comment

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

Review: root Makefile → justfile migration

This is a large but straightforward migration. All original Make targets are replicated in the justfile, and the pre-existing justfile targets (release-notes, shellcheck, etc.) are preserved. A few items:

1. PR description says op-e2e/justfile was updated — it wasn't

The description says "Updates op-e2e/justfile to use cd .. && just cannon-prestates instead of make -C .." but the op-e2e/justfile has no changes in this PR's commits (945b5e3b6e..f42c9d3f71). The op-e2e justfile still has make -C .. cannon-prestates.

2. Several targets still round-trip through Make shims

Targets like cannon, op-program, op-challenger, op-dispute-mon still call make -C ./subdir target. Since cannon and op-program already have deprecated Make shims (from earlier PRs in the stack), the flow is just cannonmake -C ./cannon cannon → deprecated shim → just cannon. Not a bug, but an unnecessary indirection that could be cleaned up (e.g. cd cannon && just cannon). Same for reproducible-prestate-op-program, op-program-client, op-program-host, make-pre-test, generate-mocks-op-node, generate-mocks-op-service, and test-unit.

3. mod-tidy dropped the explanatory comment

The original had a useful comment explaining why GOPRIVATE is set (bypasses the Go module proxy for freshly released versions). Minor, but the comment was helpful context.

Things that look good

  • update-op-geth renamed correctly: Pre-existing update-op-geth ref (bash script) renamed to update-op-geth-ref to avoid conflict with the Make target's update-op-geth (Python script). Both preserved.
  • cross-op-node GIT_VERSION computation: Faithfully reproduced in bash. Actually cleaner — the Make version used $(GITCOMMIT) which wasn't defined in the root Makefile scope; the just version computes it fresh with git rev-parse HEAD.
  • _go-tests-ci-internal flags as positional param: Works fine since bash word-splits the string. No current flags contain spaces.
  • go-tests-fraud-proofs-ci: Correctly sets OP_E2E_CANNON_ENABLED="true" (vs "false" in the regular test targets) and includes all CI env vars.
  • ALL_TEST_PACKAGES construction: String concatenation produces identical result.
  • help target: just --list is a clean replacement for the grep-based Make help.
  • CI test infrastructure (go-tests-ci, go-tests-short-ci, go-tests-ci-kona-action, go-tests-fraud-proofs-ci): All faithfully replicated including CircleCI node sharding logic.
  • CONTRIBUTING.md: Clean update.

Review generated by Claude Code

@ajsutton ajsutton force-pushed the aj/migrate-root-makefile-to-just branch from f42c9d3 to 79184e5 Compare March 12, 2026 22:15
@ajsutton ajsutton force-pushed the aj/migrate-op-program-makefile-to-just branch from 0ad8729 to c01848c Compare March 12, 2026 22:28
@ajsutton ajsutton force-pushed the aj/migrate-root-makefile-to-just branch from 79184e5 to 43e1e93 Compare March 12, 2026 22:29
@ajsutton ajsutton force-pushed the aj/migrate-op-program-makefile-to-just branch from c01848c to c2b4af4 Compare March 12, 2026 22:54
@ajsutton ajsutton force-pushed the aj/migrate-root-makefile-to-just branch from 996889c to a74e5f5 Compare March 12, 2026 22:54
@ajsutton
Copy link
Contributor Author

Restored the parallel build of prestates. It just uses basic bash wait rather than parallel to avoid an extra dependency.

Base automatically changed from aj/migrate-op-program-makefile-to-just to develop March 12, 2026 23:59
ajsutton and others added 4 commits March 13, 2026 00:08
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…d shim

The deprecated.mk shim was changed to pass JUSTFLAGS as just CLI
variable overrides (`just VAR=val target`), but just rejects overrides
for variables not declared in the justfile. This broke CI jobs where
Make variable assignments propagate through sub-makes (e.g.
GO_TEST_FLAGS, GUEST_PROGRAM).

Revert to passing them as environment variables via `env`, which is
how the shim originally worked in the cannon migration PR.

Fixes: go-tests-short, sanitize-op-program CI failures

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate root build targets from Make to Just. The Makefile now
delegates to just with a deprecation warning, preserving backwards
compatibility for existing make invocations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ajsutton and others added 5 commits March 13, 2026 00:09
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All subdirectories now have justfiles with deprecated Make shims,
so convert remaining make -C calls to cd && just. Also restores
the explanatory comment on mod-tidy's GOPRIVATE usage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
just doesn't parallelize dependencies like make -j does. Use background
processes with wait to run op-program and kona prestate builds concurrently.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The cd into cannon/ was changing the CWD for the rest of the script,
causing gotestsum to run from cannon/ instead of the repo root. The
original Makefile used $(MAKE) -C which spawns a subprocess. Use a
subshell to match that behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The bare `cd op-program` on line 180 changed cwd persistently, so the
following `cd rust` tried to resolve `op-program/rust/` which doesn't
exist. Wrap both in subshells to preserve the original working directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ajsutton ajsutton force-pushed the aj/migrate-root-makefile-to-just branch from b8b50f9 to f9af61b Compare March 13, 2026 00:09
Copy link
Contributor

@wwared wwared left a comment

Choose a reason for hiding this comment

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

🚢

@ajsutton ajsutton enabled auto-merge March 13, 2026 00:28
These directories were removed in #19506 but the justfile still
referenced them, causing go-tests-short-ci to fail with
"lstat ./devnet-sdk/: no such file or directory".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ajsutton ajsutton added this pull request to the merge queue Mar 13, 2026
Merged via the queue into develop with commit 74c6df4 Mar 13, 2026
128 checks passed
@ajsutton ajsutton deleted the aj/migrate-root-makefile-to-just branch March 13, 2026 01:27
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.

3 participants