Repository navigation
fix(cache): fingerprint only whether files a task probes exist - #869
Open
lifeiscontent wants to merge 2 commits into
Open
lifeiscontent wants to merge 2 commits into
lifeiscontent wants to merge 2 commits into
Conversation
Vite's `searchForWorkspaceRoot` calls `fs.existsSync` on `pnpm-workspace.yaml` and `lerna.json` in every ancestor directory. fspy recorded `access` as a read, so the probe made the file's content an input, and editing an unrelated line of `pnpm-workspace.yaml` missed the cache of every task that loads a Vite config. - fspy reports `access`, `faccessat` and `faccessat2` (preload and seccomp) and `NtQueryAttributesFile` (Windows) as a new `Probe` access. `stat` calls and `NtQueryFullAttributesFile` stay reads, since their callers can use the size or modification time. - A path a task only probes is fingerprinted by whether it exists: a new `FileExists` for a file, `Folder(None)` for a directory, `NotFound` otherwise. A task that also reads the path tracks its content. - The cache schema version goes to 19, since older builds can't decode `FileExists`. On Windows, Node's `fs.existsSync` stats an existing file after `GetFileAttributesW` to detect broken symlinks, and that stat is a read, so the file stays a content input there. Fixes voidzero-dev#860
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Vite's
searchForWorkspaceRootcallsfs.existsSynconpnpm-workspace.yamlandlerna.jsonin every ancestor directory. fspy recordedaccessas a read, so the probe made the file's content an input. Editing an unrelated line ofpnpm-workspace.yaml, such as an unused catalog entry, missed the cache of every task that loads a Vite config. In a 199-task monorepo one such edit left 1 cache hit out of 184 tasks.Changes
access,faccessatandfaccessat2(preload and seccomp) andNtQueryAttributesFile(Windows) as a newProbeaccess.statcalls andNtQueryFullAttributesFilestay reads, since their callers can use the size or modification time.FileExistsfor a file,Folder(None)for a directory,NotFoundotherwise. A task that also reads the path, in any process, tracks its content, so a catalog lint still misses when the file changes.FileExists.fs.existsSyncstats an existing file afterGetFileAttributesWto detect broken symlinks, and that stat is a read, so the file stays a content input there. Fixing that depends on how stat-like metadata reads are classified, which this PR leaves as is.Fixes #860