Automating Build Files
summary
A Google-internal build-file automation runs for a decade, supports 20+ languages and handles 250k requests/day. Three resolution strategies appear: fast string manipulation + syntactic edits (hundreds of ms), compiler-driven analysis (accurate but expensive), and the favored bazel query + semantic edits (1–2s, understands macros and rule semantics). The system calls out to Bulldozer for formatting, uses pragmas/metadata to map macros to generated rules, and recommends keeping BUILD files declarative to make automation reliable.
AI-written summary · about
chapters (14)
- 0:00Build file automation intro
- 1:05What automated build management does
- 3:57Why optimize dependencies
- 5:22Resolving imports with strings
- 9:16Problems with string imports
- 12:25Compiler output for dependencies
- 15:31Automating import resolution
- 17:37Updating build files syntactically
- 19:43Semantic edits for builds
- 22:57Choosing the right approach
- 25:05Making builds tool-friendly
- 28:07Q&A
- 30:15Fixing build anti-patterns
- 31:59Future of build tooling
