Skip to content

Commit

Permalink
Include CPU arch in the cache key (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd authored Feb 8, 2025
1 parent f0deed1 commit 27b8ea9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions dist/restore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86755,9 +86755,10 @@ class CacheConfig {
key += `-${job}`;
}
}
// Add runner OS to the key to avoid cross-contamination of cache
// Add runner OS and CPU architecture to the key to avoid cross-contamination of cache
const runnerOS = external_os_default().type();
key += `-${runnerOS}`;
const runnerArch = external_os_default().arch();
key += `-${runnerOS}-${runnerArch}`;
self.keyPrefix = key;
// Construct environment portion of the key:
// This consists of a hash that considers the rust version
Expand Down
5 changes: 3 additions & 2 deletions dist/save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86755,9 +86755,10 @@ class CacheConfig {
key += `-${job}`;
}
}
// Add runner OS to the key to avoid cross-contamination of cache
// Add runner OS and CPU architecture to the key to avoid cross-contamination of cache
const runnerOS = external_os_default().type();
key += `-${runnerOS}`;
const runnerArch = external_os_default().arch();
key += `-${runnerOS}-${runnerArch}`;
self.keyPrefix = key;
// Construct environment portion of the key:
// This consists of a hash that considers the rust version
Expand Down
5 changes: 3 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ export class CacheConfig {
}
}

// Add runner OS to the key to avoid cross-contamination of cache
// Add runner OS and CPU architecture to the key to avoid cross-contamination of cache
const runnerOS = os.type();
key += `-${runnerOS}`;
const runnerArch = os.arch();
key += `-${runnerOS}-${runnerArch}`;

self.keyPrefix = key;

Expand Down

0 comments on commit 27b8ea9

Please sign in to comment.