Hello!
We were surprised to find that our cache had doubled in size. The first thing we did was enable debug logs to figure out where the space in the cache was going. We eventually found the problem, but not straight away.
However, we eventually realised that the logs lacked information on how much space a particular path occupied out of the total cache size.
Currently, rust-cache has a complex caching scheme:
|
self.cachePaths = [path.join(CARGO_HOME, "registry"), path.join(CARGO_HOME, "git")]; |
|
if (self.cacheBin) { |
|
self.cachePaths = [ |
|
path.join(CARGO_HOME, "bin"), |
|
path.join(CARGO_HOME, ".crates.toml"), |
|
path.join(CARGO_HOME, ".crates2.json"), |
|
...self.cachePaths, |
|
]; |
|
} |
|
const cacheTargets = core.getInput("cache-targets").toLowerCase() || "true"; |
|
if (cacheTargets === "true") { |
|
self.cachePaths.push(...workspaces.map((ws) => ws.target)); |
|
} |
|
|
|
const cacheDirectories = core.getInput("cache-directories"); |
|
for (const dir of cacheDirectories.trim().split(/\s+/).filter(Boolean)) { |
|
self.cachePaths.push(dir); |
|
} |
It might be useful to include information on how much space was used in the Post Cache Cargo step, along with the key debug logs :)
Hello!
We were surprised to find that our cache had doubled in size. The first thing we did was enable debug logs to figure out where the space in the cache was going. We eventually found the problem, but not straight away.
However, we eventually realised that the logs lacked information on how much space a particular path occupied out of the total cache size.
Currently,
rust-cachehas a complex caching scheme:rust-cache/src/config.ts
Lines 272 to 289 in 85fb424
It might be useful to include information on how much space was used in the
Post Cache Cargostep, along with the keydebuglogs :)