Repository navigation
feat(cache): skip reads inside directories tagged with CACHEDIR.TAG - #794
Open
lifeiscontent wants to merge 2 commits into
Open
lifeiscontent wants to merge 2 commits into
lifeiscontent wants to merge 2 commits into
Conversation
Tools like Vitest read and rewrite their own cache on every run, so a task that uses them reads a file it also writes and is never cached. The Cache Directory Tagging spec gives tools a runner-agnostic way to mark such directories, and Cargo already writes the tag in target/. After a run, the directories of each tracked read inside the workspace are checked once for a valid CACHEDIR.TAG, and reads inside a tagged directory are dropped from automatic inputs, like paths reported through ignoreInput. Writes there are still outputs, so a cache hit restores them.
Contributor
Author
|
Vitest now writes |
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
Closes #793. Tools that rewrite their own cache on every run, like Vitest, make their task read a file it also writes, so it's never cached.
CACHEDIR.TAGlets a tool mark that directory without depending on a runner-specific client.Changes
CACHEDIR.TAG. Reads inside a tagged directory are dropped from automatic inputs, the same way asignoreInput.target/keep working.RelativePath::parent, a section indocs/inputs.md, and e2e tests for a tagged directory, no tag, invalid tags, and output restore.