Conversation
Go 1.18+ silently enabled -buildvcs=auto, which stamps every binary with VCS metadata (commit, modified status) via debug.ReadBuildInfo(). No code in this repo reads this metadata — version info is injected via -X ldflags instead. The VCS stamping adds unnecessary overhead: Go must query git state for every build/test invocation, and changes to git state (e.g. untracked files) can invalidate build cache entries. Explicitly set -buildvcs=false for both build and test invocations. Partially generated by AI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Skipping CI for Draft Pull Request. |
|
Images are ready for the commit at 0e04bb8. To use with deploy scripts, first |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19585 +/- ##
==========================================
- Coverage 49.26% 49.25% -0.01%
==========================================
Files 2735 2735
Lines 206138 206138
==========================================
- Hits 101545 101543 -2
- Misses 97046 97047 +1
- Partials 7547 7548 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/retest |
| shift | ||
| if [[ "$RACE" == "true" ]]; then | ||
| CGO_ENABLED=1 go "$tool" -race -ldflags="${ldflags[*]}" -tags "$(tr , ' ' <<<"$GOTAGS")" "$@" | ||
| CGO_ENABLED=1 go "$tool" -race -buildvcs=false -ldflags="${ldflags[*]}" -tags "$(tr , ' ' <<<"$GOTAGS")" "$@" |
There was a problem hiding this comment.
This list is getting long, making it harder to spot the difference. Perhaps we should try to de-duplicate with something like:
if [[ "$RACE" == "true" ]]; then
env="CGO_ENABLED=1"
args="-race"
else
env=""
args=""
fi
$env go "$tool" $args -buildvcs=false -ldflags="${ldflags[*]}" -tags "$(tr , ' ' <<<"$GOTAGS")" "$@"
There was a problem hiding this comment.
You're right. It is getting too long to parse. I like your suggestion much better.
Problem:
Go 1.18+ silently enabled
-buildvcs=auto, which stamps every binary with VCS metadata (commit, modified status) viadebug.ReadBuildInfo(). No code in this repo reads this metadata — version info is injected via-Xldflags instead.The VCS stamping adds unnecessary overhead: Go must query git state for every build/test invocation, and changes to git state (e.g. untracked files) can invalidate build cache entries.
Fix:
Explicitly set
-buildvcs=falseininvoke_go()ingo-tool.sh, which is the single choke point for all Go build/test/run invocations.Testing and quality
How I validated my change
-buildvcs=false.