Skip to content

Add CACHEDIR.TAG to .embuild/espressif directories#102

Merged
ivmarkov merged 1 commit intoesp-rs:masterfrom
drinkcat:cache-dir
Mar 28, 2026
Merged

Add CACHEDIR.TAG to .embuild/espressif directories#102
ivmarkov merged 1 commit intoesp-rs:masterfrom
drinkcat:cache-dir

Conversation

@drinkcat
Copy link
Copy Markdown
Contributor

Thank you for your contribution!

We appreciate the time and effort you've put into this pull request.
To help us review it efficiently, please ensure you've gone through the following checklist:

Submission Checklist 📝

  • I have updated existing examples or added new ones (if applicable).
  • [*] I have used cargo fmt command to ensure that all changed code is formatted correctly.
  • [*] I have used cargo clippy command to ensure that all changed code passes latest Clippy nightly lints.
  • [*] My changes were added to the CHANGELOG.md in the proper section. ---> Added a main section, not sure how you want to deal with versioning.

Pull Request Details 📖

Description

On Linux, this is the standard way to prevent cache directories from being included in backups, and mirrors what cargo does (look at target directory).

cargo does quite a bit more though, including preventing backup on MacOS and indexing on Windows, we might want to pull in more of the code (sadly we can't directly pull these functions from cargo-util).

I only did this for espidf and pio, not sure if it makes sense elsewhere.

Testing

In a personal project, add to Cargo.toml:

[patch.crates-io]
embuild = { path = "../embuild" }

Then cargo build:

$ cat .embuild/espressif/CACHEDIR.TAG 
Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by embuild.
# For information about cache directory tags see https://bford.info/cachedir/

On Linux, this is the standard way to prevent cache directories
from being included in backups, and mirrors what cargo does (look
at `target` directory).

cargo does quite a bit more though, including preventing backup
on MacOS and indexing on Windows, we might want to pull in more
of the code (sadly we can't directly pull these functions from
cargo-util).
@ivmarkov ivmarkov merged commit 36702a2 into esp-rs:master Mar 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants