Skip to content

Commit 835c1e2

Browse files
authored
Stop the gate stamping VCS metadata into throwaway binaries (#122)
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.
1 parent 3ba719c commit 835c1e2

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎Makefile‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,19 @@ workflows: ## Workflow YAML parses, no conflict markers, no disabled safety cont
1919
vet: ## go vet across all packages.
2020
go vet ./...
2121

22+
# -buildvcs=false: the gate builds throwaway binaries, so stamping git metadata
23+
# into them buys nothing and couples the gate to git plumbing it does not need.
24+
# It also breaks the agent loop outright. The loop works in a worktree under the
25+
# temp directory, and Go's VCS stamping fails there with
26+
# "error obtaining VCS status: exit status 128", before any repo code compiles.
27+
# A gate that cannot run where the loop runs is not a gate. Release binaries are
28+
# built separately in .github/workflows/release.yml and take their version from
29+
# -ldflags, not from stamping, so nothing user-visible depends on this.
2230
build: ## Build all packages.
23-
go build ./...
31+
go build -buildvcs=false ./...
2432

2533
test: ## Run all tests and write a coverage profile for CI upload.
26-
go test -race -coverprofile=coverage.txt -covermode=atomic ./...
34+
go test -buildvcs=false -race -coverprofile=coverage.txt -covermode=atomic ./...
2735

2836
tidy: ## Tidy the module graph.
2937
go mod tidy

0 commit comments

Comments
 (0)