feat: Write CACHEDIR.TAG to the pack cache directory#328
Merged
Pavel Zwerschke (pavelzw) merged 3 commits intoJul 3, 2026
Conversation
Copilot
AI
changed the title
[WIP] Add CACHEDIR.TAG to cache directory
Write CACHEDIR.TAG to the pack cache directory
Jul 3, 2026
Daniel Elsner (delsner)
marked this pull request as ready for review
July 3, 2026 15:01
Daniel Elsner (delsner)
requested a review
from Pavel Zwerschke (pavelzw)
as a code owner
July 3, 2026 15:01
Daniel Elsner (delsner)
approved these changes
Jul 3, 2026
Pavel Zwerschke (pavelzw)
approved these changes
Jul 3, 2026
Pavel Zwerschke (pavelzw)
deleted the
copilot/add-cachedir-tag-to-cache-directory
branch
July 3, 2026 15:11
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.
The
--use-cachedirectory was not marked as a cache, so backup and archiving tools would traverse and store it. This adds a standardCACHEDIR.TAGmarker per the spec.Changes
src/pack.rswrite_cachedir_tag(cache_dir)— creates the cache dir if needed and writesCACHEDIR.TAG, skipping the write when it already exists to preserve file mtimes across runs.pack()whencache_dir(--use-cache) is set, before packages download.tests/integration_test.rs— extendedtest_package_cachingto assert the tag exists and carries the standard signature.README.md— noted the tag in the cache section.The tag lives at the cache root; the per-platform layout under it is unchanged and it does not affect pack output archives.