• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 28422333258

30 Jun 2026 05:23AM UTC coverage: 92.827% (+1.5%) from 91.309%
28422333258

push

github

web-flow
Pre-compile the Go standard library once per toolchain config instead of per-package (#23422)

Disclaimer: Like my previous Go PR, I'm still not primarily a golang
developer. However, the fact that Golang doesn't work properly in Pants
has been the bane of my existence for like 2 years now. The moment that
Mythos/Fable dropped I immediately had it dig deeply into whether the
whole road to proper-golang-in-pants could be opened up. So this is all
by Claude Code with Fable 5 (xhigh), with consults to GPT 5.5 (xhigh)
and Gemini 3.1 Pro. I've had it check and recheck, I ran many different
roles over it, and I had it explain and re-explain it to me, and then I
checked myself.

So, as much as I dislike AI slop and am worried about AI PR overload,
I've done my very best to avoid exactly that while still using AI. I
hope we can get this road unblocked.

The rest is Fable talking:

---

Since Go 1.20, Go distributions no longer ship pre-compiled standard
library archives, so Pants compiles every needed stdlib package from
source: roughly 200 compile/symabis/assembly/pack build actions on a
cold build, repeated for every build-options variant. This PR replaces
all of that with a single cached `GODEBUG=installgoroot=all go install
-trimpath -pkgdir <sandbox-relative> std` action per `(Go version, GOOS,
GOARCH, cgo_enabled)` configuration (~6 s, ~175 MB, ~355 archives), the
same architecture Bazel's rules_go uses.

Design: stdlib build requests on compatible configurations become "slim"
(no sources, no dependency recursion, no embed-config processes), and
`build_go_package` short-circuits them to the harvested archive. Each
archive enters the result as its own digest handle in
`transitive_pkg_archives`, so compile sandboxes still contain only
direct deps' archives and the closure is merged exactly once at link,
which preserves the invariant from #23421. The transitive closure comes
from a new `deps` field parsed from `go list -json std`. cgo is a
cache-key dimens... (continued)

255 of 258 new or added lines in 13 files covered. (98.84%)

1 existing line in 1 file now uncovered.

93755 of 101000 relevant lines covered (92.83%)

3.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.51
/src/python/pants/backend/codegen/protobuf/go/rules.py


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc