Repository navigation
Fix incremental diagnostics after global file deletion - #64845
John Favret (johnfav03) merged 1 commit into
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
Core incremental-cache and persistence changes need human confirmation of successful regression validation.
0 open findings
What changed in this PR
Addresses #64552 by correcting deleted-file processing in the native compiler’s incremental snapshots, preventing stale diagnostics after lib or target changes.
Changes:
- Processes every deleted file and removes obsolete pending state.
- Invalidates affected diagnostics when global scope changes.
- Adds regression tests and baselines for deletion, diagnostic caching, and build-info persistence.
| File | Description |
|---|---|
tsc/testdata/baselines/reference/tsc/incremental/unchecked-deleted-paths-with-no-emit-composite-true.js |
Pending-state cleanup with composite enabled. |
tsc/testdata/baselines/reference/tsc/incremental/unchecked-deleted-paths-with-no-emit-composite-false.js |
Pending-state cleanup without composite. |
tsc/testdata/baselines/reference/tsc/incremental/retained-library-diagnostics-after-global-deletion-cleared-true.js |
Library errors cleared after deletion. |
tsc/testdata/baselines/reference/tsc/incremental/retained-library-diagnostics-after-global-deletion-cleared-true-with-single-threaded.js |
Error clearing in single-threaded mode. |
tsc/testdata/baselines/reference/tsc/incremental/retained-library-diagnostics-after-global-deletion-cleared-true-with-one-checker.js |
Error clearing with one checker. |
tsc/testdata/baselines/reference/tsc/incremental/retained-library-diagnostics-after-global-deletion-cleared-false.js |
New library errors after deletion. |
tsc/testdata/baselines/reference/tsc/incremental/retained-library-diagnostics-after-global-deletion-cleared-false-with-single-threaded.js |
New errors in single-threaded mode. |
tsc/testdata/baselines/reference/tsc/incremental/retained-library-diagnostics-after-global-deletion-cleared-false-with-one-checker.js |
New errors with one checker. |
tsc/testdata/baselines/reference/tsc/incremental/mixed-file-deletion-with-add-and-change.js |
Mixed deletion, addition, and modification baseline. |
tsc/internal/execute/tsctests/tsc_test.go |
Adds incremental CLI regression scenarios. |
tsc/internal/execute/incremental/programtosnapshot.go |
Corrects deletion handling and cache invalidation. |
tsc/internal/execute/incremental/buildinfo_path_test.go |
Tests deletion traversal, caching, and persisted state. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
I actually think I have a fix for this in #64712 that's broader and fixes all possible variants. |
|
Though I think you have some extra good stuff on top, looking harder. |
|
Yeah, probably better to take yours and I'll deal with the rebase. |
|
Okay, that sounds good to me; I'll give your PR a review when I get a minute |
Fixes #64552
Incremental snapshot construction stopped after the first deleted file because the native
SyncMap.Rangecallback used the opposite continuation convention from Strada, making global-scope invalidation depend on nondeterministic map iteration order. This means stale diagnostics or obsolete pending state could be persisted whenlibortargetchanges removed multiple files.