-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mark .cargo/git and .cargo/registry as cache dirs #10553
Conversation
Fixes rust-lang#10457 (but still needs tests)
r? @ehuss (rust-highfive has picked a reviewer for you, use r? to override) |
OK I added some tests and this is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks and glad to see you post this PR!
I'm not sure at this point whether these errors https://github.com/rust-lang/cargo/runs/6096576521?check_suite_focus=true are related or just noise... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Though I don't expect you remove all the tests 😅 Sorry for misleading. Could you bring them back?
Oh of course, sorry. How about this? |
Ignore errors creating the registry directory
Probably can't fail, but just in case
@rust-lang/cargo This pull request marks @rfcbot merge |
Team member @weihanglo has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Here we come to a consensus and this is not actually a big change, so I am going to merge it without waiting the FCP. Thanks @sourcefrog for the works! @bors r+ |
📌 Commit 4bcfd9e has been approved by |
☀️ Test successful - checks-actions |
Update cargo 8 commits in edffc4ada3d77799e5a04eeafd9b2f843d29fc23..f63f23ff1f1a12ede8585bbd1bbf0c536e50293d 2022-04-19 17:38:29 +0000 to 2022-04-28 03:15:50 +0000 - move workspace inheritance untable docs to the correct place (rust-lang/cargo#10609) - Cargo add support for workspace inheritance (rust-lang/cargo#10606) - chore: Upgrade toml_edit (rust-lang/cargo#10603) - Mark .cargo/git and .cargo/registry as cache dirs (rust-lang/cargo#10553) - fix(yank): Use '--version' like install (rust-lang/cargo#10575) - Disallow setting registry tokens with --config (rust-lang/cargo#10580) - Set cargo --version git hash length to 9 (rust-lang/cargo#10579) - Prefer `key.workspace = true` to `key = { workspace = true }` (rust-lang/cargo#10584)
adapt to newly added CACHEDIR.TAG files. see rust-lang/cargo#10553
Fixes #10457
What does this PR try to resolve?
As we previously discussed in #10457 this marks
~/.cargo/git
and~/.cargo/registry
as not to be included in backups, and not subject to content indexing. These directories can be fairly large and frequently changed, and should only contain content that can be re-downloaded if necessary.How should we test and review this PR?
I did two manual tests:
cargo update
in a source tree that has a git dependency, and observe that afterwards, there is aCACHEDIR.TAG
in~/.cargo/git
.cargo update
and observe that there's aCACHEDIR.TAG
in~/.cargo/registry
.(I ran this on Linux. This code should also trigger OS-specific behavior on macOS and Windows that's the same as is currently applied to
target/
.)I added some test assertions.