mirror of
https://github.com/Swatinem/rust-cache
synced 2025-04-11 07:03:37 +00:00
disambiguate incremental caches
This commit is contained in:
parent
2de18fd6ad
commit
8c044fe7cc
11
dist/restore/index.js
vendored
11
dist/restore/index.js
vendored
|
@ -86767,7 +86767,11 @@ class CacheConfig {
|
|||
this.cachePaths = [];
|
||||
/** The primary cache key */
|
||||
this.cacheKey = "";
|
||||
/** The secondary (restore) key that only contains the prefix and environment */
|
||||
/**
|
||||
* The secondary (restore) key that only contains the prefix and environment
|
||||
* This should be used if the primary cacheKey is not available - IE pulling from main on a branch
|
||||
* instead of the branch itself
|
||||
* */
|
||||
this.restoreKey = "";
|
||||
/** Whether to cache CARGO_HOME/.bin */
|
||||
this.cacheBin = true;
|
||||
|
@ -86946,6 +86950,11 @@ class CacheConfig {
|
|||
let lockHash = digest(hasher);
|
||||
keyFiles.push(...parsedKeyFiles);
|
||||
self.keyFiles = sort_and_uniq(keyFiles);
|
||||
// todo(jon): make sure we differentiate incrementals on different branches
|
||||
// we can use just a single cache per incremental branch
|
||||
if (self.incremental) {
|
||||
key += `-incremental`;
|
||||
}
|
||||
key += `-${lockHash}`;
|
||||
self.cacheKey = key;
|
||||
self.cachePaths = [external_path_default().join(config_CARGO_HOME, "registry"), external_path_default().join(config_CARGO_HOME, "git")];
|
||||
|
|
11
dist/save/index.js
vendored
11
dist/save/index.js
vendored
|
@ -86767,7 +86767,11 @@ class CacheConfig {
|
|||
this.cachePaths = [];
|
||||
/** The primary cache key */
|
||||
this.cacheKey = "";
|
||||
/** The secondary (restore) key that only contains the prefix and environment */
|
||||
/**
|
||||
* The secondary (restore) key that only contains the prefix and environment
|
||||
* This should be used if the primary cacheKey is not available - IE pulling from main on a branch
|
||||
* instead of the branch itself
|
||||
* */
|
||||
this.restoreKey = "";
|
||||
/** Whether to cache CARGO_HOME/.bin */
|
||||
this.cacheBin = true;
|
||||
|
@ -86946,6 +86950,11 @@ class CacheConfig {
|
|||
let lockHash = digest(hasher);
|
||||
keyFiles.push(...parsedKeyFiles);
|
||||
self.keyFiles = sort_and_uniq(keyFiles);
|
||||
// todo(jon): make sure we differentiate incrementals on different branches
|
||||
// we can use just a single cache per incremental branch
|
||||
if (self.incremental) {
|
||||
key += `-incremental`;
|
||||
}
|
||||
key += `-${lockHash}`;
|
||||
self.cacheKey = key;
|
||||
self.cachePaths = [external_path_default().join(CARGO_HOME, "registry"), external_path_default().join(CARGO_HOME, "git")];
|
||||
|
|
|
@ -23,7 +23,11 @@ export class CacheConfig {
|
|||
public cachePaths: Array<string> = [];
|
||||
/** The primary cache key */
|
||||
public cacheKey = "";
|
||||
/** The secondary (restore) key that only contains the prefix and environment */
|
||||
/**
|
||||
* The secondary (restore) key that only contains the prefix and environment
|
||||
* This should be used if the primary cacheKey is not available - IE pulling from main on a branch
|
||||
* instead of the branch itself
|
||||
* */
|
||||
public restoreKey = "";
|
||||
|
||||
/** Whether to cache CARGO_HOME/.bin */
|
||||
|
@ -251,6 +255,8 @@ export class CacheConfig {
|
|||
keyFiles.push(...parsedKeyFiles);
|
||||
self.keyFiles = sort_and_uniq(keyFiles);
|
||||
|
||||
// todo(jon): make sure we differentiate incrementals on different branches
|
||||
// we can use just a single cache per incremental branch
|
||||
if (self.incremental) {
|
||||
key += `-incremental`;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue