Closed fourbytes closed 3 years ago
The current heuristics for build artifacts cleanup are a bit rough.
So, the right way here is probably to get the names of the crates to be measured for coverage and remove the build artifacts for those crates using (relatively recently added) --package
option of cargo clean
.
EDIT: The answer to the original question "Is there a particular reason for this?" is: "This is due to a bit rough heuristic to avoid false positives/false negatives".
Gotcha, removing artifacts for only crates being measured seems like a great way to go. Thanks.
I've just moved our projects from Tarpaulin to cargo-llvm-cov and coverage is much more accurate. I noticed however that our caching stopped working and it took me a good while to figure out why, but it seems to be due to this line which cleans the target directory when the
CI
environment variable is set.Is there a particular reason for this? If I manually unset
CI
I am able to get caching working nicely again without recompiling hundreds of dependencies. Imho it would be better to leave it up to the user with an--always-clean
flag or similar.