Skip to content

feat: Write CACHEDIR.TAG to the pack cache directory#328

Merged
Pavel Zwerschke (pavelzw) merged 3 commits into
mainfrom
copilot/add-cachedir-tag-to-cache-directory
Jul 3, 2026
Merged

feat: Write CACHEDIR.TAG to the pack cache directory#328
Pavel Zwerschke (pavelzw) merged 3 commits into
mainfrom
copilot/add-cachedir-tag-to-cache-directory

Conversation

Copilot AI commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

The --use-cache directory was not marked as a cache, so backup and archiving tools would traverse and store it. This adds a standard CACHEDIR.TAG marker per the spec.

Changes

  • src/pack.rs
    • Added write_cachedir_tag(cache_dir) — creates the cache dir if needed and writes CACHEDIR.TAG, skipping the write when it already exists to preserve file mtimes across runs.
    • Invoked from pack() when cache_dir (--use-cache) is set, before packages download.
  • tests/integration_test.rs — extended test_package_caching to 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.

Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by pixi-pack.
# For information about cache directory tags see https://bford.info/cachedir/

Copilot AI changed the title [WIP] Add CACHEDIR.TAG to cache directory Write CACHEDIR.TAG to the pack cache directory Jul 3, 2026
@pavelzw Pavel Zwerschke (pavelzw) changed the title Write CACHEDIR.TAG to the pack cache directory feat: Write CACHEDIR.TAG to the pack cache directory Jul 3, 2026
Comment thread README.md Outdated
@github-actions github-actions Bot added the enhancement New feature or request label Jul 3, 2026
@delsner
Daniel Elsner (delsner) marked this pull request as ready for review July 3, 2026 15:01
@pavelzw
Pavel Zwerschke (pavelzw) merged commit 0bac5eb into main Jul 3, 2026
20 checks passed
@pavelzw
Pavel Zwerschke (pavelzw) deleted the copilot/add-cachedir-tag-to-cache-directory branch July 3, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CACHEDIR.TAG to cache directory

3 participants