Closed lrubasze closed 1 year ago
Caching all of target
can sometimes lead to errors as well, for example when you run test coverage with the likes of llvm-cov
. Granted, you could clean the output before the post
steps run, but it would be cool to make it easier to express this has cache significance other than with comments.
@Oppen thanks for reply.
Correct me if I am wrong but I suppose the issue you described refers to caching of target
in general, not necessarily in relation to the issue I have described. Unless I am not entirely getting your point.
Oh, you're right. I misinterpreted the current issue as being related to which subfolders were cached.
Maybe just a half-solution, but I excluded -sys
crates from the .cargo/registry/src
cleanup in https://github.com/Swatinem/rust-cache/commit/f6987ea139b70babe623061b3b9c01a93ea71187
In theory
cache
should be enough to recreate sources and reduce the build time.However, there are some crates, eg.
librocksdb-sys
that do not benefit from that. Restoring sources fromcache
is not enough. (more details ci: enable 'librocksdb-sys' to be able to be properly cached)How about addressing this problem by checking if some path from
cache-directories
belongs toregistry/src
and prevent this path from removal. Or maybe some additional config param with list ofsrc
entries to keep?