docs: record persistent builder identity

This commit is contained in:
2026-08-12 15:51:55 +09:00
parent badde25fa9
commit c4bdc5dc4f
2 changed files with 71 additions and 22 deletions

View File

@@ -236,18 +236,20 @@ tools in invocation-owned directories and apply the same exact cleanup rule.
`ww build -w DIR` and single-file `ww test -w DIR` replace that scratch with a
caller-owned persistent package-artifact workdir: the directory must already
exist, is never cleaned by the driver, and holds one committed unit, `.wwi`,
`.s`, `.o`, and dep `.a` per package plus byte copies of the compiler and
assembler and a small mode stamp. A package is reused only when its freshly
composed unit byte-equals the committed unit and the recorded tool copies
byte-equal the live tools — content identity only, no mtimes, no hashes, every
decision reproducible with `cmp` against plain files. Recompiled artifacts
land at staged `.new` names and commit by rename with the unit renamed last,
so an interrupted build forces a recompile rather than a false reuse; the
link always reruns. One workdir serves one invocation at a time and one
(root, mode) shape; both driver stages implement the identical contract.
This is build staleness in the Make/mk/Go sense, not a result cache: tests
always run, and the byte-identity and bootstrap gates keep building on fresh
scratch. `make clean` reclaims every workdir under `out/`.
`.s`, `.o`, and dep `.a` per package plus byte copies of the invoking driver,
compiler, and assembler and a small mode stamp. A package is reused only when
its freshly composed unit byte-equals the committed unit and every applicable
recorded executable byte-equals the live executable — content identity only,
no mtimes, no hashes, every decision reproducible with `cmp` against plain
files. The driver identity covers the graph, unit-composition, archive, and
commit algorithms that neither unit bytes nor compiler identity can name.
Recompiled artifacts land at staged `.new` names and commit by rename with the
unit renamed last, so an interrupted build forces a recompile rather than a
false reuse; the link always reruns. One workdir serves one invocation at a
time and one (root, mode) shape; both driver stages implement the identical
contract. This is build staleness in the Make/mk/Go sense, not a result cache:
tests always run, and the byte-identity and bootstrap gates keep building on
fresh scratch. `make clean` reclaims every workdir under `out/`.
On a package or tree target, `ww test -w DIR` forwards to the coordinator,
which keys one persistent driver workdir per package group under `DIR`