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 doesn't clean build artifacts from old nighlies #5516

Closed
bjorn3 opened this issue May 11, 2018 · 8 comments
Closed

Cargo doesn't clean build artifacts from old nighlies #5516

bjorn3 opened this issue May 11, 2018 · 8 comments
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@bjorn3
Copy link
Member

bjorn3 commented May 11, 2018

This caused my disk to fill up completely.

@bjorn3
Copy link
Member Author

bjorn3 commented Jun 15, 2018

Ping?

@matklad
Copy link
Member

matklad commented Jun 15, 2018

Cargo itself can't know if a particular artifact will be used in the future or not, because one project could be build using several different Rust versions. So, some explicit user action is required to clean unnecessary artifacts, because only the user knows which artifacts are unnecessary. To that end, cargo clean sub command exists. Does it help for your use case?

@bjorn3
Copy link
Member Author

bjorn3 commented Jun 15, 2018

Yes, but it is annoying to clean also the compiled dependencies, etc compiled with the current rustc version.

@alexcrichton alexcrichton added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Jun 27, 2018
@Manishearth
Copy link
Member

Can we at least have a global/local cargo config for this, perhaps on by default? I don't compile projects across compilers. I also suspect that's a pretty rare thing for most people to do aside from on CI, and we can ask Travis to flip a config for this.

I just deleted a 140GB target directory, this is kinda ridiculous 😄

@Manishearth
Copy link
Member

Another possible heuristic is that we can delete old files that are not currently necessary. So if there are some artifacts from another compiler that were built today, don't touch them, but delete any older ones.

@bjorn3
Copy link
Member Author

bjorn3 commented Sep 28, 2018

So if there are some artifacts from another compiler that were built today, don't touch them, but delete any older ones.

+1 I would like to keep them a bit longer though (~1 or 2 weeks)

@dwijnand
Copy link
Member

Duplicate of #5026

@dwijnand dwijnand marked this as a duplicate of #5026 Sep 28, 2018
@Hi-Angel
Copy link

To that end, cargo clean sub command exists. Does it help for your use case?

Nope, apparently cargo clean is just a fancy version of rm -rf. From the comment I expected it to get rid of outdated builds, but instead it removed whole target/ directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

No branches or pull requests

6 participants