Repository navigation
v0.9.0
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).$depfilerecipe variable. Path mk allocates under.mk/deps/[<config>/]<target>.d.--verifyCLI 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 understraceand records observed reads/writes from%filesyscalls. macOS returns a clear "not yet implemented" error directing users to the depfile adapter.
Changed
std/c.mkandstd/cxx.mknow carry[deps: gcc]and emit-MMD -MF $depfile.include std/c.mkJust Works for header tracking.NewExecutorcollapsed from three growing constructors into a single struct-argNewExecutor(graph, state, vars, *ExecutorArgs).BuildState.Recordsignature gains adiscovered []stringand adiscoveredOutputs []stringparameter.
Design
The full rationale, prior art (Ninja, tup, Shake, redo, Vesta, Build Systems à la Carte), and non-goals are in docs/discovered-dependencies.md.