-
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
Ensure discoverability of automatic garbage collection #13176
Comments
If the focus is on helping people when they go offline, would #13137 prevent people from running into that problem so its not needed? As suggested, my biggest concern is bloated output. People already complain about how noisy cargo is. |
#13137 would certainly help alleviate the most common case of this. But if I have a project versioned in git with e.g. feature branches that pull in additional dependencies, I don't think there's a good way for cargo to detect that without this feature getting significantly more complex. And even if cargo went so far as to search git branches, what if I'm using a VCS other than git? What if I keep some of my projects on an external USB drive? What if I simply moved my project folders around while reorganizing my home directory? The reality is that Cargo doesn't (and can't) have control over the things that use its cache, and so it fundamentally can't (reliably) know if any item in the cache is actually no longer used by something. And trying to make the autoclean feature more sophisticated to handle more and more cases is never going to be enough, and would likely become a significant maintenance burden even if that were attempted. So it would be both easier and (in some sense) more robust to just take the simple approach of ensuring that the user is informed and can opt out if needed/desired for their usage patterns.
Yeah, noise can be an issue. I would suggest just keeping the message short. Maybe something along the lines of:
|
Alternatively, when
So that people are aware of the feature even when they intentionally disabled it. |
Problem
Cache cleaning is coming to Cargo, which I am really excited about.
Ideally, it should (once mature) be opt-out: active by default, with reasonable defaults, unless a user configures it. But how is a new user ever supposed to know the feature exists and that it can be configured?
This may catch users unaware, wiping out their crate cache behind their back before they embark on a journey in which they wished to revive an old project while sitting in a train, plane, in a cabin in the woods, etc...
Proposed Solution
The GC feature should be discoverable, so that new users, even those who didn't read the documentation, or who forgot about it, are regularly reminded about its existence.
A potential solution would be to remind users of the feature... whenever the feature kicks in. According to the article:
It would be very useful if at the very time automatic cleaning runs to determine what to clean, it would print:
Since this feedback is not time-sensitive, it would be fine -- should the cleaning run in the background -- to provide it on the next run of
cargo
after cleaning completes instead. It would still be only once a day, and it would still make the feature discoverable by new users.Notes
Bottom of the reddit comment chain which inspired this issue.
The text was updated successfully, but these errors were encountered: