-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Support cargo clean --workspace #14720
Copy link
Copy link
Closed
Labels
C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-cleanS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewStatus: Issue or feature is accepted, and has a team member available to help mentor or review
Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-cleanS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewStatus: Issue or feature is accepted, and has a team member available to help mentor or review
Type
Fields
Give feedbackNo fields configured for issues without a type.
Problem
We have a large workspace (~500k loc).
targetdir bloats quickly, butcargo cleanwill let us recompile all dependencies (We have >1000 dependencies, and some dependencies take minutes to compile).Recompiling dependencies is unnecessary, and it wastes time and energy.
We only want to clean build artifacts of "our own code". Actually it also takes up most of the space:
Current workarounds
Crates in my workspace have a common prefix, like
risingwave-xxx. So I could just find & delete:A more cargo native solution (mentioned by @weihanglo):
But this turns out to be much slower than the brute force way above. @weihanglo says: we should make
-pin cargo-clean also aware of glob syntax. Then it might be faster. But I'm thinking sth like--workspace-membersis more straightforward, and I'm not sure whether there's other cases we want a regexp clean.Proposed Solution
Add a flag
--workspace-membersforcargo clean, which is essentially(but more efficient)
Notes
Original posted at https://x.com/yayale_umi/status/1848921059011268944