From 0de82523fb93f475226356b37418ce4b69acdcdf Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Tue, 29 Aug 2023 14:27:08 -0700 Subject: [PATCH] build: debug depshash --- script/generate-deps-hash.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/script/generate-deps-hash.js b/script/generate-deps-hash.js index 9161da0d6e..c927fce645 100644 --- a/script/generate-deps-hash.js +++ b/script/generate-deps-hash.js @@ -35,14 +35,19 @@ addAllFiles(path.resolve(__dirname, '../patches')); // Create Hash const hasher = crypto.createHash('SHA256'); -hasher.update(`HASH_VERSION:${HASH_VERSIONS[process.platform] || FALLBACK_HASH_VERSION}`); +const addToHashAndLog = (s) => { + console.log('Hashing:', s); + return hasher.update(s); +}; +addToHashAndLog(`HASH_VERSION:${HASH_VERSIONS[process.platform] || FALLBACK_HASH_VERSION}`); for (const file of filesToHash) { + console.log('Hashing Content:', file, crypto.createHash('SHA256').update(fs.readFileSync(file)).digest('hex')); hasher.update(fs.readFileSync(file)); } // Add the GCLIENT_EXTRA_ARGS variable to the hash const extraArgs = process.env.GCLIENT_EXTRA_ARGS || 'no_extra_args'; -hasher.update(extraArgs); +addToHashAndLog(extraArgs); const effectivePlatform = extraArgs.includes('host_os=mac') ? 'darwin' : process.platform;