ww test: allow -c with persistent workdirs

This commit is contained in:
2026-08-20 20:40:01 +09:00
parent db5782eff9
commit 77168fd891
5 changed files with 66 additions and 45 deletions

View File

@@ -6286,11 +6286,11 @@ transaction prevents partial sibling publication and canonical result emission
order remains unchanged. Direct invocation of a retained binary continues to
inherit caller cwd, environment, and separate standard descriptors.
`-o` can accompany `-w`: unchanged semantic actions are reused, changed source
invalidates the applicable test actions, the always-run link refreshes the
private runnable and retained copy, and the test still runs. This is build
reuse, not a result cache. `-c` retains its established incompatibility with
`-w`; this slice does not invent persistent compile-only ownership.
`-c` and `-o` can accompany `-w`: the workdir owns only semantic actions while
the invocation/output path owns only the retained copy. Unchanged actions are
reused, changed source invalidates the applicable test actions, and the
always-run link refreshes the private runnable and retained copy. Only `-c`
suppresses execution. This is build reuse, not a result cache.
No persisted byte schema changed. Build workdir format remains `18`, test
workdir format remains `19`, and semantic storage remains `3`.

View File

@@ -665,6 +665,9 @@ destinations and removes temporary stages and invocation-created output
prefixes. Test execution starts only after that transaction commits, so a
runtime failure leaves an explicitly retained binary. A no-test product
publishes no binary and does not create a directory solely for one.
`-w` may persist the unchanged semantic actions for either `-c` or running
retention without changing publication identity or introducing a test-result
cache.
When `ww test` executes a directory-owned product, the child process working
directory is that product's canonical absolute physical package source

View File

@@ -482,11 +482,12 @@ path as the one command-global semantic-action store; neither pattern spelling
nor package-group name derives a persistent subdirectory. The delegated driver
may create a missing store only after graph and request preflight, and rolls
back newly created empty prefixes if later setup fails. Every reuse decision
stays with the driver's content-identity contract above. `-w` and test `-c` do
not mix — the coordinator rejects the combination rather than guess which
artifact tree the caller owns. `test-library` uses exactly this: one
`ww test -j $(JOBS) -w out/wwbuild/wwtest-lib lib/...` line owns library
behavior (measured: 2.3s cold, 1.0s warm at
stays with the driver's content-identity contract above. Test `-c` may use the
same store: the workdir owns semantic actions and the invocation/output path
owns the separately staged retained executable. The `test-library` route uses
the same command-global store contract: one `ww test -j $(JOBS) -w
out/wwbuild/wwtest-lib lib/...` line owns library behavior (measured: 2.3s
cold, 1.0s warm at
`-j 4`, vs 4.7s for the retired 59-target per-file fan-out).
`test/lang` currently uses one package per source file, so its complete gate