Hasty Briefsbeta

Bilingual

I want a better action graph serialization

a day ago
  • Defines 'action graph' as a serialized representation of all build steps generated by a configure step, used by tools like CMake and Ninja.
  • Contrasts serialized action graphs with persistent server-based systems like Bazel and Buck2, noting that serialization reduces memory usage and startup time.
  • Lists design goals for a serialization format: simple/fast loading, support for complex dependency edges (dynamic, negative, optional), and minimizing reconfigurations.
  • Critiques existing formats: Make is ambiguous and slow; Ninja lacks support for checksums, negative dependencies, file renames, optional files, and environment variables.
  • Proposes 'Magma', a new serialization language based on a small Clojure subset, with features like `ifwritten`/`ifchanged`/`ifcreated`/`ifdeleted` edges, dynamic dependencies (`dynout`), in-memory transformations, and file-watch-based triggers.
  • Highlights Magma's improvements: command spawning as arrays, native redirect/transform support, distinction between groups and phony targets, and reduced file I/O for fast loading.
  • Notes Magma's constraints (no shell commands, no globbing) and differences from Starlark, and discusses adding runner metadata (like Buck2's `RunInfo`) for executable artifacts.