-
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
cargo clean ~/.cargo #3289
Comments
Also, I'm not sure what I can actually safely delete. |
In general it's always safe to completely |
FWIW, it looks like you can safely delete |
Hey Florian - just ran into this - 👍 would have expected this to be built in. |
I made a small plugin that prints cache size and can clean out different parts of it, feel free to try it out: |
|
The following command in addition to what has been mention may help saving disk space.
It wont do anything a cargo build can fix again. |
This is a sorta old bug, it seems real weird that this is still not a supported feature of cargo. Most package managers have a "clear cache files" command. I feel like I shouldn't have had to search google to find a github issue with scary "manually delete these files" instructions, I should have been able to find how to do it just by typing "cargo help"… |
For anyone interested I have released
To be extra sure you can perform a If you have any additional ideas or feature requests, I would be glad to hear them. :) |
This patch adds the `--include-cache` flag to `cargo clean`, which allows the command to also remove related artifacts from `CARGO_HOME` such as downloaded `.crate` files in `~/.cargo/cache/` and extracted source directories in `~/.cargo/src/`. Note that this feature is not intended to replace the `cargo-cache` command which does smart cache management. Instead, this command simply blows away whatever it's asked to delete with no smarts whatsoever. Fixes rust-lang#3289.
Deleting The downside is that it deletes both crates sources and index, so the whole index has to be downloaded all over again after each cleanup, and it's not small. An option to cleanup source but keep the index would be nice. |
You can delete |
I guess still not a thing... |
#10070 added a My concern with this approach is that We also need to keep in mind other kinds of global caches that we will have
I think it would also help to have a design that also explores prior art |
NPM and Composer are package managers for languages that aren't compiled, so there also isn't any cache for compiled artifacts. I don't get what distinction between different types of caches you are trying to make. |
FYI we are working on global cache garbage collection. Its being tracked in #12633 |
I'm going to close in favor of #12633. I don't think this issue tracks anything beyond what is implemented in the tracking issue. |
Thank you so much for this tool. 5G of data space saved! 🚀 |
Would it be possible to have a
cargo clean
command for all the downloaded deps in~/.cargo
? I'm currently using a small HDD (Chromebook) and would like to cleanup whatever I can, included sources and the local index (not sure it's in~/.cargo
).The text was updated successfully, but these errors were encountered: