Skip to content

Stop the gate stamping VCS metadata into throwaway binaries - #122

Merged
charlesgreen merged 1 commit into
mainfrom
gate-no-buildvcs
Aug 2, 2026
Merged

charlesgreen merged 1 commit into
mainfrom
gate-no-buildvcs

Conversation

@charlesgreen

Copy link
Copy Markdown
Contributor

Work item 3 from #119, promoted from "consider" to "the fix" by evidence from two agent runs.

The failure

Every agent run reports a red gate:

error obtaining VCS status: exit status 128
Use -buildvcs=false to disable VCS stamping.

It fails at go build ./... before any repo code compiles, so the gate says red for a reason unrelated to the change under test. On #115 the agent worked around it with TMPDIR=$PWD/.tmp go test ./cmd/simplycubed, which passed — the code was fine, the environment was not.

A gate that cannot run where the loop runs is not a gate. One that fails for unrelated reasons is worse, because it invites someone to weaken it to get green.

Why this is the right fix rather than a workaround

The gate builds binaries and throws them away. Stamping git metadata into them buys nothing and couples the gate to git plumbing it has no reason to touch. Go's own error message recommends exactly this flag.

Nothing user-visible depends on it:

  • internal/buildinfo reads the module version from debug.ReadBuildInfo, not the VCS stamp
  • release binaries are built separately in .github/workflows/release.yml with the version passed via -ldflags -X

Honesty about reproduction

I could not reproduce the failure on a developer machine or in a runner probe (30731396430) — go build with stamping on succeeded in a worktree under /tmp on a runner. The agent reproduces it consistently, twice.

So this is not "I found the root cause and fixed it." It is "the gate has no reason to do the thing that is failing, and Go's own error names this flag as the remedy." The remaining question of why it differs is still #119.

Verified: gate passes normally, and from a worktree with TMPDIR inside it.

The loop works in a git worktree under the temp directory, and Go's VCS
stamping fails there:

  error obtaining VCS status: exit status 128
  Use -buildvcs=false to disable VCS stamping.

It fails before any repo code compiles, so every agent run reports a red
gate for a reason that has nothing to do with the change under test. A
gate that cannot run where the loop runs is not a gate, and one that fails
for unrelated reasons invites someone to weaken it.

The gate builds binaries it throws away. Stamping git metadata into them
buys nothing and couples the gate to git plumbing it does not need.

Nothing user-visible depends on it. buildinfo reads the module version
from debug.ReadBuildInfo, not the VCS stamp, and release binaries are
built separately in release.yml with the version passed via -ldflags.
@codecov

codecov Bot commented Aug 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@charlesgreen
charlesgreen merged commit 835c1e2 into main Aug 2, 2026
3 checks passed
@charlesgreen
charlesgreen deleted the gate-no-buildvcs branch August 2, 2026 08:23
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