-
Notifications
You must be signed in to change notification settings - Fork 2.9k
How to effectively clean target folder for CI caching #5885
Copy link
Copy link
Open
Labels
A-cachingArea: caching of dependencies, repositories, and build artifactsArea: caching of dependencies, repositories, and build artifactsC-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`S-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.
Metadata
Metadata
Assignees
Labels
A-cachingArea: caching of dependencies, repositories, and build artifactsArea: caching of dependencies, repositories, and build artifactsC-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`S-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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I have a workspace repository with several crates in it (> 10). A clean build of all of them takes about 10 minutes on Travis, which is why I want to cache the
target/folder.The problem is, the target folder gets quite big (~ 1.7GB) so it takes also about 3 minutes to upload the cache to S3 after the build.
The question is: How can I clean the
targetfolder from any artifacts generated by my own code?If I can achieve that, then the
targetfolder would only have the artifacts of all the dependencies in it. As long as they don't change, Travis would not have to re-upload the cache. At the same time, rebuilding only the workspace crates takes only 30 seconds.I have already tried several things:
cargo clean -pfor every workspace packagetargetthat mention a workspace crate's nameNone of the above were enough in order to get the
targetfolder into a state where NOTHING changes between two builds.I couldn't really understand the layout of the
targetfolder: The artifacts of dependencies seem to be mixed up with those of the workspace crates. Is there some documentation available on how the target folder is structured?