Skip to content
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

cargo clean does not clean downloaded crates #14256

Closed
carbotaniuman opened this issue Jul 16, 2024 · 3 comments
Closed

cargo clean does not clean downloaded crates #14256

carbotaniuman opened this issue Jul 16, 2024 · 3 comments
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.

Comments

@carbotaniuman
Copy link

Problem

I tried to build a crate, but ran into an issue where a dependency was corrupted. I then tried to cargo clean the project, thinking that would fix it, but it didn't. I had to nuke my WSL and reinstall it to get the crate to build, losing a lot of time and effort.

Steps

No response

Possible Solution(s)

cargo clean should also apply to dependencies, and not just the direct project.

Notes

No response

Version

No response

@carbotaniuman carbotaniuman added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Jul 16, 2024
@weihanglo
Copy link
Member

See https://doc.rust-lang.org/nightly/cargo/guide/cargo-home.html#directories and unstable -Zgc feature if you want to manually remove source caches for now.

Assuming “downloaded crates” refer to downloaded source code resides under $CARGO_HOME/registry/{crate,src}, the design is tracked in #13060. Going to close this in favor of that. Please comment below if there is any reason keeping this issue open. Thank you.

@weihanglo weihanglo closed this as not planned Won't fix, can't repro, duplicate, stale Jul 16, 2024
@carbotaniuman
Copy link
Author

Thanks for the pointers - I wish I'd have found those links sooner... I'm not sure my issue is directly related to the gc issue though - I would like to clean my dependencies entirely, not gc them depending on cache age.

@epage
Copy link
Contributor

epage commented Jul 16, 2024

Unlike some other build systems, dependency source is kept in a global cache while cargo clean is focused on your local cache. Think of the GC feature as a way for managing the global cache. The interface for doing so is not yet defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

3 participants