From 4703dc0a1d812a0ad66c764868352e62ea69968c Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Wed, 4 Aug 2021 15:31:17 -0700 Subject: [PATCH] build: bust the deps cache on windows (#30401) --- script/generate-deps-hash.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/script/generate-deps-hash.js b/script/generate-deps-hash.js index d32e9946cbf5..ca22e23ad61d 100644 --- a/script/generate-deps-hash.js +++ b/script/generate-deps-hash.js @@ -3,7 +3,14 @@ const fs = require('fs'); const path = require('path'); // Fallback to blow away old cache keys -const HASH_VERSION = 3; +const FALLBACK_HASH_VERSION = 3; + +// Per platform hash versions to bust the cache on different platforms +const HASH_VERSIONS = { + darwin: 3, + win32: 4, + linux: 3 +}; // Base files to hash const filesToHash = [ @@ -28,7 +35,7 @@ addAllFiles(path.resolve(__dirname, '../patches')); // Create Hash const hasher = crypto.createHash('SHA256'); -hasher.update(`HASH_VERSION:${HASH_VERSION}`); +hasher.update(`HASH_VERSION:${HASH_VERSIONS[process.platform] || FALLBACK_HASH_VERSION}`); for (const file of filesToHash) { hasher.update(fs.readFileSync(file)); }