-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
A-cachingArea: caching of dependencies, repositories, and build artifactsArea: caching of dependencies, repositories, and build artifactsA-layoutArea: target output directory layout, naming, and organizationArea: target output directory layout, naming, and organizationC-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-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Z-gcNightly: garbage collectionNightly: garbage collection
Description
cargo has to recompile dependencies once a toolchain has updated/changed, this leaves all previous artifacts intact. However, this means when you're updating toolchains the target dir will just grow and grow.
Currently you can cargo clean
and rebuild, but it would be nice to be able to clean only the dependencies that are not compatible for the current toolchain. Perhaps cargo clean --incompatible
?
For example building a small crate
# cargo +nightly-2018-02-07 build; du -hd2 ./target
57M ./target/debug/deps
4.0K ./target/debug/examples
528K ./target/debug/.fingerprint
4.0K ./target/debug/native
18M ./target/debug/incremental
7.6M ./target/debug/build
82M ./target/debug
82M ./target
# cargo +nightly-2018-02-08 build; du -hd2 ./target
113M ./target/debug/deps
4.0K ./target/debug/examples
1.1M ./target/debug/.fingerprint
4.0K ./target/debug/native
35M ./target/debug/incremental
16M ./target/debug/build
163M ./target/debug
163M ./target
# cargo +nightly build; du -hd2 ./target
169M ./target/debug/deps
4.0K ./target/debug/examples
1.6M ./target/debug/.fingerprint
4.0K ./target/debug/native
52M ./target/debug/incremental
23M ./target/debug/build
245M ./target/debug
245M ./target
This can obviously be much more problematic on larger crates.
mati865, shepmaster, eyelash, ngotchac, Marwes and 62 more
Metadata
Metadata
Assignees
Labels
A-cachingArea: caching of dependencies, repositories, and build artifactsArea: caching of dependencies, repositories, and build artifactsA-layoutArea: target output directory layout, naming, and organizationArea: target output directory layout, naming, and organizationC-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-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Z-gcNightly: garbage collectionNightly: garbage collection