Exclude target directory from Time Machine#4386
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
|
Tests fail on |
|
I don't believe the test is flaky but rather related to the upgrade of libgit2-sys here. Mind either updating the test or leaving the dep as it was? |
Cargo.toml
Outdated
There was a problem hiding this comment.
Could this be in a cfg that only gets pulled in on OSX?
There was a problem hiding this comment.
What's the syntax for this? I've tried [target.'cfg(macos)'.dependencies], but it didn't get picked up.
There was a problem hiding this comment.
Ah looks like you found it!
src/cargo/ops/cargo_rustc/layout.rs
Outdated
There was a problem hiding this comment.
I think you can perhaps avoid some indentation issues here with:
let is_excluded_key: string::CFString = match ... {
Ok(k) => k,
Err(_) => return,
};
// ...|
I didn't notice libgit got updated. I've tried to commit only lines of cargo.lock that had core-foundation, but it broke the file (parse error), so I committed the whole thing. |
|
Looks like this fails to compile on stable/beta? |
src/cargo/util/read2.rs
Outdated
There was a problem hiding this comment.
That's a change on master. Github is displaying diff incorrectly. I'll rebase.
Cargo.toml
Outdated
There was a problem hiding this comment.
We shouldn't commit this = change
Temporary/derived files outside dedicated system directories should be explicitly excluded from backups to prevent undesirable bloat and churn.
|
Passes after fixes and rebase |
|
@bors: r+ |
|
📌 Commit 8e0a7ca has been approved by |
Exclude target directory from Time Machine Fixes #3884
|
☀️ Test successful - status-appveyor, status-travis |
This patch follows the lead of rust-lang#4386 (which excludes target directories from Time Machine backups) and is motived by the same reasons listen in rust-lang#3884. CACHEDIR.TAG is an OS-independent mechanism supported by Borg, restic, GNU Tar and other backup/archiving solutions. See https://bford.info/cachedir/ for more information about the specification. This has been discussed in Rust Internals earlier this year[1] and it seems like it's an uncontroversial improvement so I went ahead with the patch. [1] https://internals.rust-lang.org/t/pre-rfc-put-cachedir-tag-into-target/12262/11
Exclude the target directory from backups using CACHEDIR.TAG This patch follows the lead of #4386 (which excludes target directories from Time Machine backups) and is motived by the same reasons listen in #3884. CACHEDIR.TAG is an OS-independent mechanism supported by Borg, restic, GNU Tar and other backup/archiving solutions. See https://bford.info/cachedir/ for more information about the specification. This has been discussed in Rust Internals earlier this year[1] and it seems like it's an uncontroversial improvement so I went ahead with the patch. One thing I'm wondering is whether this should maybe cover the whole main target directory (right now it applies to `target/debug`, `target/release` etc. but not to target root). [1] https://internals.rust-lang.org/t/pre-rfc-put-cachedir-tag-into-target/12262/11
Fixes #3884