Commit b8dc393
committed
fix(package): exclude target dir from backups with CACHEDIR.TAG
Create CACHEDIR.TAG files in build directories during `cargo package`
to exclude them from system backups. This ensures that temporary
packaging artifacts in target/package are not unnecessarily included
by backup tools like Time Machine on macOS.
The fix calls `create_dir_all_excluded_from_backups_atomic` when
creating the build directory and target directory for packaging,
which automatically creates the CACHEDIR.TAG file.
Update existing tests to verify that CACHEDIR.TAG files are now
created in the expected locations.
Fixes #162381 parent 22bb62d commit b8dc393
File tree
4 files changed
+11
-4
lines changed- src/cargo/ops/cargo_package
- tests/testsuite
4 files changed
+11
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
| |||
225 | 227 | | |
226 | 228 | | |
227 | 229 | | |
| 230 | + | |
228 | 231 | | |
229 | 232 | | |
230 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
| 528 | + | |
528 | 529 | | |
529 | 530 | | |
530 | 531 | | |
531 | 532 | | |
532 | 533 | | |
533 | 534 | | |
534 | 535 | | |
| 536 | + | |
535 | 537 | | |
536 | 538 | | |
537 | 539 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
| 497 | + | |
497 | 498 | | |
498 | 499 | | |
499 | 500 | | |
500 | 501 | | |
501 | 502 | | |
502 | 503 | | |
503 | 504 | | |
| 505 | + | |
504 | 506 | | |
505 | 507 | | |
506 | 508 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7825 | 7825 | | |
7826 | 7826 | | |
7827 | 7827 | | |
7828 | | - | |
| 7828 | + | |
7829 | 7829 | | |
7830 | 7830 | | |
7831 | | - | |
7832 | | - | |
| 7831 | + | |
| 7832 | + | |
7833 | 7833 | | |
7834 | 7834 | | |
0 commit comments