Skip to content

build(tools): build generator tools once into bin/ instead of go run - #764

Merged
acamarata merged 1 commit into
mainfrom
fix/go-run-build-once
Oct 13, 2026
Merged

acamarata merged 1 commit into
mainfrom
fix/go-run-build-once

Conversation

@acamarata

Copy link
Copy Markdown
Collaborator

Source: Cam hygiene finding (Go build cache grew 707 GB on one host in a week; go run keeps the linked binary of every changed tool in GOCACHE since Go 1.24).

Changes: Makefile pattern rule bin/% builds each tools/* once; scripts/ci (flag-drift-audit, contract-smoke, auth-smoke), scripts/sport (generate-f02, generate-core-services) and workflows doc-sync + default-images-pullable build once then run the binary. .gitignore already ignores /bin/.

Verified by the builder: stdout/stderr and generated files byte-identical old vs new; make contract-check, contract-smoke (39 assertions), go vet ./tools/... pass. Cache growth on a second identical run is 0 MB for both; each source edit adds 31 MB with build vs 171 MB with go run. wiki-check fails identically before and after (comm sort order, locale).

Left as go run on purpose (out of scope): sdk-ts-cli-api-test.yml, coverage.yml, image-pin-bump.yml, .github/benchmarks/run.sh, scripts/release/test.sh, scripts/release/lib/steps1.sh, scripts/ci/live-safety-fixture.sh. Follow-up ticket candidate.

go run stores each linked tool in GOCACHE with no size cap (35-50 MB per changed tool; 707 GB on one host in a week). The Makefile, CI scripts, SPORT generators and two workflows now build each tool once into an ignored bin/ and run the binary. Generated output is byte-identical to the go run form.
@acamarata
acamarata merged commit 8f7ae67 into main Oct 13, 2026
21 checks passed
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