docs(agents): stop asserting a go shim that is not present on every host - #3
Merged
Merged
Conversation
… host
AGENTS.md's Build Cache Conventions told agents to "just run `go build` /
`make` — do NOT set `GOCACHE` yourself" on the stated grounds that "the host
`go` shim already routes the default `GOCACHE` to a shared on-disk cache
(~/.cache/go-build) and pins compile/link temp to disk
(GOTMPDIR=/var/tmp/gotmp)", concluding that a warm shared cache "is never
corrupted by a normal build".
Every factual clause is false on an unshimmed developer machine. Verified on
the macOS host this repo is developed on:
which -a go -> /usr/local/bin/go (one entry, a plain Homebrew
symlink to ../Cellar/go/1.26.5/bin/go — no shim)
go env GOCACHE -> /Users/<u>/Library/Caches/go-build, not ~/.cache/go-build
~/.cache/go-build -> absent
go env GOTMPDIR -> "" (empty; linker scratch follows $TMPDIR unpinned)
df /tmp -> APFS disk, not the "size-capped RAM-backed tmpfs (61G)"
the same section warns about
The shim is a fleet-provisioning artifact; nothing in this repo installs it.
The section now says so up front and gives the two commands that settle it,
rather than stating the shimmed configuration as universal fact.
The costly half is the "never corrupted by a normal build" conclusion. It is
true only for a build with the project's normal flags — and diagnosing a broken
build is exactly when an agent varies CGO_CPPFLAGS, CGO_CXXFLAGS, or tags.
Following this instruction, two agents nine hours apart wrote CGO_CXXFLAGS-only
go-icu-regex archives into the shared cache (e9a0aecd748d 03:52:20Z,
f2cb903213fb 13:06:44Z, both 2026-08-01; gcy-lcs). Each needed manual nm
verification and surgical deletion, because nothing detects a poisoned entry —
the resulting failure names the flags, never the cache. Added the rule that was
missing: diagnostic and flag-varying builds get a throwaway GOCACHE, via the
isolated-build recipe already documented a few lines below.
The hard ban on `go clean -cache`, the /tmp guidance, and the isolated-build
recipe are unchanged in substance; the /tmp paragraph is now scoped to fleet
executors, where its tmpfs premise actually holds. The recipe's
`mktemp -d -p /var/tmp` was checked for portability and works on macOS.
Refs: gcy-2o1, gcy-lcs, gcy-ajv
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.
Refs
gcy-2o1,gcy-lcs,gcy-ajv.The defect
AGENTS.md→ Build Cache Conventions told agents to "just rungo build/make— do NOT setGOCACHEyourself", on the stated grounds that "the hostgoshim already routes the defaultGOCACHEto a shared on-disk cache (~/.cache/go-build) and pins compile/link temp to disk (GOTMPDIR=/var/tmp/gotmp)", concluding a warm shared cache "is never corrupted by a normal build."Every factual clause is false on an unshimmed developer machine. Verified on the macOS host this repo is developed on:
goshimwhich -a go→ one entry, a plain Homebrew symlink to../Cellar/go/1.26.5/bin/goGOCACHE=~/.cache/go-build/Users/<u>/Library/Caches/go-build;~/.cache/go-buildabsentGOTMPDIR=/var/tmp/gotmp""— empty;/var/tmp/gotmpabsent, linker scratch follows$TMPDIRunpinned/tmpis a size-capped RAM-backed tmpfs (61G)" (same section)The shim is a fleet-provisioning artifact; nothing in this repo installs it. The section now says so up front and gives the two commands that settle it, instead of stating the shimmed configuration as universal fact.
The costly half
"Never corrupted by a normal build" is true only for a build with the project's normal flags — and diagnosing a broken build is exactly when an agent varies
CGO_CPPFLAGS,CGO_CXXFLAGS, or tags.Following this instruction, two agents nine hours apart wrote
CGO_CXXFLAGS-only go-icu-regex archives into the shared cache —e9a0aecd748d@ 03:52:20Z andf2cb903213fb@ 13:06:44Z, both 2026-08-01 (gcy-lcs). Each needed manualnmverification and surgical deletion, because nothing detects a poisoned entry: the resulting failure names the flags, never the cache.So this PR adds the rule that was missing — diagnostic and flag-varying builds get a throwaway
GOCACHE, via the isolated-build recipe already documented a few lines below.Unchanged in substance
The hard ban on
go clean -cache, the/tmpguidance, and the isolated-build recipe all stay. The/tmpparagraph is now scoped to fleet executors, where its tmpfs premise actually holds. The recipe'smktemp -d -p /var/tmpwas checked for portability and does work on macOS.make check-docs(go test ./test/docsync) passes via the pre-commit hook.Follow-up, deliberately not in this PR
The gate list still reads "
go vet ./...clean", andmake vetis literallygo vet ./...with no CGO configuration —TEST_ENVforwardsCGO_CPPFLAGSbut leaves it empty unless the caller set it. That is the shape that made the refinery's quality-gate fallback die on go-icu-regex. Confirming it costs a real compile on a host under an operational build hold, so it is filed ongcy-2o1rather than guessed at here.