Skip to content

ci: share one compile across microVM release stamp builds - #2433

Merged
rdimitrov merged 1 commit into
mainfrom
claude/faster-microvm-release-test
Oct 20, 2026
Merged

rdimitrov merged 1 commit into
mainfrom
claude/faster-microvm-release-test

Conversation

@rdimitrov

Copy link
Copy Markdown
Member

Summary

microvm-ci-release_test.sh is the CI critical path after #2430: ~470 s of the 504 s "Test GitHub Actions scripts" job.

Cause: the host-stamp contract builds ./cmd/mecated four times and ./cmd/mecatui once with -trimpath, then runs go test ./cmd/mecatui without -trimpath. Different flags mean different build-cache keys, so the test recompiled everything a second time. On top of that, each -X variant relinks a large binary with full DWARF.

Change: every build and the go test now use the release job's flags (CGO_ENABLED=0, -trimpath, -ldflags="-s -w …", see release.yml "publish-mecatui-host"). They share one compile; later variants only relink, and stripped links are ~4x faster. This also makes the stamped binaries closer to what the release actually ships.

No assertion changes: same binaries, same linker symbols, same checks.

Local cold-cache timing of this section (18 cores):

before after
first mecated build 39 s 32 s
each later relink 12–17 s 3–9 s
go test ./cmd/mecatui 33 s 13 s
total 117 s 61 s

Running the links in parallel gave no further gain locally, so the script stays sequential.

Stacked on #2430 (base claude/festive-mclean-7dc29f); retarget to main once that merges.

Test plan

  • sh -n on the script; shellcheck output unchanged from base
  • task lint: only a pre-existing darwin-only gosec hit in environment/microvm/launch_ownership_darwin.go (untouched; CI lints on Linux)
  • CI "Test GitHub Actions scripts" passes and its "Test microVM release scripts" step drops from ~395 s

🤖 Generated with Claude Code

@rdimitrov
rdimitrov force-pushed the claude/faster-microvm-release-test branch from 48d5f3a to 654a29d Compare October 20, 2026 11:07
Base automatically changed from claude/festive-mclean-7dc29f to main October 20, 2026 11:35
The host-stamp contract built mecated five times and mecatui once with
-trimpath, then ran go test on cmd/mecatui without it. The mismatched
flags forced a second cold compile, and full-DWARF links made each -X
relink slow.

Use the release job's CGO_ENABLED=0, -trimpath, and -s -w for every
build and the go test, so they share one compile and each variant only
relinks. Locally on a cold cache this cuts the section from 117 s to 61 s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rdimitrov
rdimitrov force-pushed the claude/faster-microvm-release-test branch from 654a29d to 6f536c6 Compare October 20, 2026 11:42
@rdimitrov
rdimitrov merged commit c9caf0d into main Oct 20, 2026
43 checks passed
@rdimitrov
rdimitrov deleted the claude/faster-microvm-release-test branch October 20, 2026 11:51
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Oct 23, 2026
2 tasks
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.

1 participant