November 24, 2025
Macro Mojo or Macro Mayday?
Migrating to Bazel symbolic macros
Bazel’s new symbolic macros spark a culture war: “Who even uses this outside Google”
TLDR: Bazel 8 adds “symbolic macros” for clearer, stricter build templates and hints at future lazy evaluation. The crowd is split: some applaud cleaner rules, others slam Bazel’s custom language and question its relevance beyond Google, with complaints about projects “dying behind Bazel walls.”
Bazel (a build tool that automates how big software gets compiled) just rolled out symbolic macros in Bazel 8. Think of them as named templates that generate build steps with clearer rules: typed inputs, who-can-see-what, and strict name matching (your macro “tool” must make things like “tool_genrule,” not random names). The team even teases future lazy evaluation, meaning Bazel won’t expand a macro until you actually need it. For folks modernizing old setups, this promises fewer surprises than legacy macros, which acted like sneaky copy‑paste code. Documentation points to cleaner conventions and fewer gotchas—see the Bazel site—but the new naming cops are already writing tickets.
The comments? Spicy. diath wants build configs in familiar languages (Python, Lua, JavaScript) and drops the mic with “no benefit” to custom languages. tannhaeuser questions whether anyone outside Google even uses Bazel, calling once‑popular projects “dying behind bazel walls.” Memes fly: the “macro police” bust your build, “first‑class macros” get roasted as “macro aristocracy,” while optimists cheer “no more mystery‑meat macros.” It’s clarity vs. complexity, and a big existential “who is this for?” The drama is real—read the docs, pick your side, and prepare for build‑system flame wars.
Key Points
- •Symbolic macros, introduced in Bazel 8, provide typed attributes and allow defining and limiting the visibility of created targets.
- •Macros are expanded during the loading phase, whereas build rules run during the analysis phase.
- •Symbolic macros are treated as first-class in Bazel and are invoked by supplying attribute values; they aim to support lazy evaluation in a future release.
- •Naming restrictions require targets created by a symbolic macro to match the macro’s name or start with it followed by _, ., or -; violations cause errors.
- •Symbolic macros must follow standard visibility rules and cannot access sources unless passed as arguments or made public; legacy macros differed in naming and argument handling (positional/keyword).