Deep dive into Go's build system
summary
Go builds the toolchain three times when bootstrapping and can compile the whole repo in ~53 seconds on a laptop; builds work by loading package patterns, fetching module zips from proxy.golang.org, unzipping into GOMODCACHE, and compiling packages into a content-addressed build cache keyed by hashes of Go version, build flags and source. Linking remains a single-step bottleneck, so compile is parallel but link is not. Reproducibility relies on embedding build ids and using flags like -trimpath and locking the Go version; tool-exec lets you intercept compiler/linker invocations.
AI-written summary · about
chapters (6)
- 0:00Start
- 6:09package patterns
- 7:14loading packages
- 26:09parallelism
- 27:43reproducibility
- 31:14supply chain security
related talks
26mWrite Once, Compile Lots, Run Anywhere
59mUnleashing the Go Toolchain
43mDebugging Code Generation in Go
22mDynamic Go Instrumentation for Production Environments
39mIs Go A Good Language to Build Compilers?
06mLightning Talk: Getting The Most Out Of Go Tool Dependencies
31mHow to Write a Self-Hosted Go Compiler from Scratch
26mBuilding Go with Bazel
