Skip to content

Build graph cache: the key covers the directories build(ctx) lists, so a deleted source is no longer a declared input (#2452) - #2644

Merged
ehartford merged 1 commit into
fix-2525from
fix-2452
Oct 25, 2026
Merged

ehartford merged 1 commit into
fix-2525from
fix-2452

Conversation

@ehartford

@ehartford ehartford commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Root cause: build_cache_graph_key (src/BuildGraphCache.w) hashed build.w,
build/*.w, the compiler, with.toml and the recorded env reads, but not the
directory listings build(ctx) read. A build.w that declares one input per
file under src/ kept serving the cached graph after a file there was
deleted: action target 'use-src' missing declared input: …/src/b.txt
(and, for the compiler's own graph, a false "dependency cycle" after it).

The comptime evaluator records list\t<dir> for each directory build(ctx)
lists (list_files, glob, host_list_files; ComptimeEvaluator
record_listing_effect), and the key re-lists each one by name
(build_cache_graph_env_fingerprint). A file's contents do not move the key.

Evidence (stage1, a project whose build.w lists src/):
before missing declared input: …/src/b.txt
after build.w.effects records list\t…/src; the graph is re-evaluated, no missing input

Test: test/internals/graph_cache_listing_key_test.w (fails before: the
deleted-file key assertion).

Closes #2452

…o a deleted source is no longer a declared input (#2452)

Root cause: build_cache_graph_key (src/BuildGraphCache.w) hashed build.w,
build/*.w, the compiler, with.toml and the recorded env reads, but not the
directory listings build(ctx) read. A build.w that declares one input per
file under src/ kept serving the cached graph after a file there was
deleted: `action target 'use-src' missing declared input: …/src/b.txt`
(and, for the compiler's own graph, a false "dependency cycle" after it).

The comptime evaluator records `list\t<dir>` for each directory build(ctx)
lists (list_files, glob, host_list_files; ComptimeEvaluator
record_listing_effect), and the key re-lists each one by name
(build_cache_graph_env_fingerprint). A file's contents do not move the key.

Evidence (stage1, a project whose build.w lists src/):
before  missing declared input: …/src/b.txt
after   build.w.effects records `list\t…/src`; the graph is re-evaluated, no missing input

Test: test/internals/graph_cache_listing_key_test.w (fails before: the
deleted-file key assertion).
@ehartford
ehartford added this pull request to stack #2645 October 25, 2026 19:58
@ehartford ehartford changed the title fix 2452 Build graph cache: the key covers the directories build(ctx) lists, so a deleted source is no longer a declared input (#2452) Oct 25, 2026
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery green on the stack top (fix-2452, 4c4d19f), driven by the pinned seed nightly-20261025-local-1-c88f3eeff0bc:

battery rc=0 wall=439s
GREEN

The gate (src/main build :gate) was green before it: survey: all targets green, 288.9 s.

@ehartford
ehartford marked this pull request as ready for review October 25, 2026 20:07
@ehartford
ehartford merged commit dfbafcf into main Oct 25, 2026
@ehartford
ehartford deleted the fix-2452 branch October 25, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build graph cache survives a deleted or added source file: the key hashes build.w but not the directory listings it reads

1 participant