Skip to content

chore(op-program): migrate Makefile to justfile#19476

Merged
ajsutton merged 9 commits intodevelopfrom
aj/migrate-op-program-makefile-to-just
Mar 12, 2026
Merged

chore(op-program): migrate Makefile to justfile#19476
ajsutton merged 9 commits intodevelopfrom
aj/migrate-op-program-makefile-to-just

Conversation

@ajsutton
Copy link
Copy Markdown
Contributor

@ajsutton ajsutton commented Mar 10, 2026

Summary

  • Migrates all op-program build targets from Make to Just, following the repo-wide migration pattern
  • Replaces the Makefile with a deprecated shim that delegates to just with a deprecation warning
  • The reproducible-prestate target is kept as an explicit Make target (not in the deprecated shim) since it's called directly by external tooling
  • Preserves two distinct ldflags configurations: host (dynamic VERSION) and client (hardcoded v0.0.0 for reproducibility)
  • All 33 targets faithfully replicated including cross-compilation (MIPS64, RISC-V), Docker prestate builds, capture/verify compatibility tests, and VM compatibility checks
  • Updates Dockerfile.vmcompat to call just directly for the analyze target instead of going through the deprecated Make shim
  • Updates README to use just instead of make

Stack

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

Test plan

  • just --list shows all 33 targets
  • just --dry-run op-program-host confirms CGO_ENABLED=0 and dynamic VERSION ldflags
  • just --dry-run op-program-client confirms hardcoded v0.0.0 ldflags
  • just --dry-run op-program-client-mips64 confirms GOOS=linux GOARCH=mips64 GOMIPS64=softfloat
  • make op-program-host delegates to just with deprecation warning
  • CI passes

🤖 Generated with Claude Code

@ajsutton ajsutton requested a review from a team as a code owner March 10, 2026 22:58
@wiz-inc-a178a98b5d
Copy link
Copy Markdown

wiz-inc-a178a98b5d bot commented Mar 10, 2026

Wiz Scan Summary

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

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 7f06f05 to f29f080 Compare March 11, 2026 03:48
@ajsutton ajsutton changed the base branch from develop to aj/migrate-op-e2e-makefile-to-just March 11, 2026 03:48
@ajsutton ajsutton force-pushed the aj/migrate-op-e2e-makefile-to-just branch from 707214d to bc8a396 Compare March 11, 2026 04:01
@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-op-e2e-makefile-to-just branch from bc8a396 to ee44bd6 Compare March 11, 2026 04:11
@ajsutton ajsutton force-pushed the aj/migrate-op-program-makefile-to-just branch from ac12acf to e97849d Compare March 11, 2026 04:11
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.8%. Comparing base (8a674d6) to head (945b5e3).
⚠️ Report is 2 commits behind head on aj/migrate-op-e2e-makefile-to-just.

Additional details and impacted files
@@                         Coverage Diff                         @@
##           aj/migrate-op-e2e-makefile-to-just   #19476   +/-   ##
===================================================================
  Coverage                                75.8%    75.8%           
===================================================================
  Files                                     477      477           
  Lines                                   59985    59985           
===================================================================
  Hits                                    45510    45510           
  Misses                                  14475    14475           
Flag Coverage Δ
unit 75.8% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 6 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-op-e2e-makefile-to-just branch from ee44bd6 to 38cf3bd 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-op-e2e-makefile-to-just branch from 50c0f17 to b9a8200 Compare March 12, 2026 16:11
@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-op-e2e-makefile-to-just branch from b9a8200 to 8a674d6 Compare March 12, 2026 18:24
@ajsutton ajsutton force-pushed the aj/migrate-op-program-makefile-to-just branch from ef6564d to 945b5e3 Compare March 12, 2026 18:24
Copy link
Copy Markdown
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: op-program Makefile → justfile migration

Overall this is a solid, faithful migration. All 33 targets are preserved with correct behavior. A few items worth flagging:

1. PR description vs Dockerfile.vmcompat

The description says "Updates Dockerfile.vmcompat to use just instead of make for the analyze target", but line 34 still calls make "analyze-op-program-client-${VM_TARGET}". The only actual change is adding just to apk add so the deprecated Make shim can delegate to it. Not a code issue, just a misleading description.

2. VERSION is no longer env-overridable

Original Makefile: VERSION ?= v0.0.0 — accepts env/cmdline override, defaults to v0.0.0.
New git.just: computes VERSION from git tags, falling back to "untagged". No env('VERSION', ...) wrapper.

This means:

  • Default changed from v0.0.0 to tag-computed / "untagged" for the host binary ldflags
  • make op-program-host VERSION=x.y.z through the deprecated shim won't forward — the env var is ignored by git.just
  • Client binaries are unaffected (_CLIENT_LDFLAGS hardcodes v0.0.0)
  • The repro pipeline only builds client binaries, so it's fine there

Worth checking if any CI job passes VERSION=... to op-program host builds.

3. TODO comment dropped from run-vm-compat

The original Makefile had # TODO(#18334): Uncomment once vm-compat supports go1.25 with commented-out docker build lines for the next target. The justfile drops this entirely, losing the issue reference.

Things that look good

  • repro.justfile correctly removes the ineffective GOOS/GOARCH/GOMIPS overrides (the mips64 target hardcodes these in env, so Make variable overrides were never used)
  • Dockerignore files correctly add !justfiles/
  • output-prestate-hash switches from echo "\n..." to printf "\n..." — more portable
  • Host binary correctly uses go_build with CGO_ENABLED=0; client binaries correctly omit it
  • _CLIENT_LDFLAGS faithfully reproduces PC_LDFLAGSSTRING (hardcoded v0.0.0, empty Meta)
  • Capture targets correctly use $VAR instead of Make's $$VAR
  • Deprecated shim list is more comprehensive than the original .PHONY declarations

Review generated by Claude Code

@ajsutton ajsutton force-pushed the aj/migrate-op-program-makefile-to-just branch from 0ad8729 to c01848c Compare March 12, 2026 22:28
Base automatically changed from aj/migrate-op-e2e-makefile-to-just to develop March 12, 2026 22:48
ajsutton and others added 9 commits March 12, 2026 22:53
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>
Migrate op-program 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>
The Makefile shim includes ../justfiles/deprecated.mk which delegates to
just. Docker builds for vmcompat and repro excluded justfiles/ from the
build context, causing "No such file or directory" errors in CI.

- Add !justfiles/ to both .dockerignore files
- Install just in Dockerfile.vmcompat (Dockerfile.repro already has it)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…o.justfile

The op-program-client-mips target hardcodes GOOS/GOARCH/GOMIPS64 in its
build commands, so passing GOOS=linux GOARCH=mips GOMIPS=softfloat from
repro.justfile was always redundant. With the Make-to-just migration, the
deprecated.mk shim forwards these as just variables, and just rejects
GOMIPS since it's not defined in the justfile.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update Dockerfile.vmcompat to call just directly for the analyze
  target instead of going through the deprecated make shim.
- Restore TODO(#18334) comment for go1.25 vm-compat support that was
  dropped during migration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Convert repro.justfile to call just directly instead of going through
make's deprecated shim. GOOS/GOARCH are passed as env vars for cannon
(read by go.just), while VERSION/GITCOMMIT/GITDATE are passed as just
variable overrides. The op-program mips targets hardcode their own
GOOS/GOARCH/GOMIPS so they don't need to be passed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ajsutton ajsutton force-pushed the aj/migrate-op-program-makefile-to-just branch from c01848c to c2b4af4 Compare March 12, 2026 22:54
@ajsutton
Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review! All three items have been addressed:

  1. PR description vs Dockerfile.vmcompat — Fixed. Dockerfile.vmcompat now calls just directly for the analyze target (line 34), removing the make call. make is kept in apk add since the external
    vm-compat tool still uses its own Makefile. PR description updated to match.

  2. VERSION no longer env-overridable — Confirmed no CI job or codebase caller passes VERSION to op-program host builds. The repro pipeline only builds client binaries (hardcoded v0.0.0), so
    unaffected. The repro.justfile has also been updated to call just instead of make, using just command-line variable overrides (just VERSION=v0.0.0 recipe) for VERSION/GITCOMMIT/GITDATE and env
    vars for GOOS/GOARCH.

  3. TODO comment dropped from run-vm-compat — Restored the # TODO(op-program: Fix vm-compat for go1.25 #18334) comment with the commented-out docker build lines for the next target.

@ajsutton ajsutton enabled auto-merge March 12, 2026 23:07
@ajsutton ajsutton added this pull request to the merge queue Mar 12, 2026
Merged via the queue into develop with commit 9a50c60 Mar 12, 2026
96 checks passed
@ajsutton ajsutton deleted the aj/migrate-op-program-makefile-to-just branch March 12, 2026 23:59
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