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

Delete files in target folder that are no longer needed #7948

Closed
bvssvni opened this issue Feb 29, 2020 · 2 comments
Closed

Delete files in target folder that are no longer needed #7948

bvssvni opened this issue Feb 29, 2020 · 2 comments
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@bvssvni
Copy link

bvssvni commented Feb 29, 2020

My problem is that I have a lot of projects, which takes up disc space. From time to time I need to go through projects and delete "target" folders. I checked the size of these folders, and I wonder why they can be over 1GB in size sometimes.

If possible, I would like a command working like "cargo build", but in addition removes the files that are no longer needed for this particular build.

I know that I can use "cargo clean", but this removes all files, including those who could save time for the next build.

@bvssvni bvssvni added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Feb 29, 2020
@bvssvni
Copy link
Author

bvssvni commented Feb 29, 2020

Here is an example use case: I update dependency versions of libraries, which means that Cargo downloads a new version and builds it. However, it does not delete the old version when no longer needed. The old versions stays in the target folder and accumulate over time. If I delete the "target" folder, I need to wait for rebuilding all dependencies.

@ehuss
Copy link
Contributor

ehuss commented Feb 29, 2020

Thanks for the suggestion. There is a meta tracking issue for this at #7150 with links to various duplicate issues, so I'm going to close in favor of that.

@ehuss ehuss closed this as completed Feb 29, 2020
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

2 participants