Skip to content

v0.9.0

Choose a tag to compare

@marcelocantos marcelocantos released this 31 May 02:45
· 6 commits to master since this release
ddcc5bd

Headline: include std/c.mk now tracks C/C++ headers correctly with no -include *.d, no -MP, no .d files in the source tree, and no deleted-header crashes. mk learns what each recipe actually read, records it in the content-hashed build database, and self-heals on deletion.

Added

  • Discovered-dependency model (DESIGN.md §11). Two edge kinds: hard (declared, ordering + staleness) and soft (discovered, staleness only). A vanished soft-dep counts as "changed," never as "missing input" — the stale edge triggers the very rebuild that erases it.
  • [deps: <format>] annotation. Recipe writes a depfile to $depfile; mk parses it and folds the reads into the DB. Formats: gcc, makefile, msvc, json, lines, trace.
  • [scan: <cmd>] + [scan-format: <fmt>]. Cheap pre-pass for two-phase analysis; in-graph paths it discovers are built before the heavy recipe runs.
  • [writes: manifest <path>] / [writes: trace]. Dynamic outputs not known statically; mk fingerprints them and tracks them for staleness.
  • [reads: <glob>…]. Declared read envelope; reads outside the envelope are flagged (warn / error under --verify).
  • $depfile recipe variable. Path mk allocates under .mk/deps/[<config>/]<target>.d.
  • --verify CLI flag. Errors on undeclared reads of in-graph targets (latent ordering races) and on envelope violations.
  • Linux trace mode. [deps: trace] / [writes: trace] runs the recipe under strace and records observed reads/writes from %file syscalls. macOS returns a clear "not yet implemented" error directing users to the depfile adapter.

Changed

  • std/c.mk and std/cxx.mk now carry [deps: gcc] and emit -MMD -MF $depfile. include std/c.mk Just Works for header tracking.
  • NewExecutor collapsed from three growing constructors into a single struct-arg NewExecutor(graph, state, vars, *ExecutorArgs).
  • BuildState.Record signature gains a discovered []string and a discoveredOutputs []string parameter.

Design

The full rationale, prior art (Ninja, tup, Shake, redo, Vesta, Build Systems à la Carte), and non-goals are in docs/discovered-dependencies.md.