Repository navigation
build(tools): build generator tools once into bin/ instead of go run - #764
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.