From 0457d54c9d7836253eef2e08296dfe66946cb27b Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Mon, 18 Jul 2022 13:33:58 -0400 Subject: [PATCH] Fix invalid build timestamp on certain timezones (#15245) Currently the build .zip has its time set to the Unix epoch, which apparently causes problems on certain operating systems when in a timezone that is behind GMT. The build timestamp has been changed to MetaMask's birthday. Time zone adjustments will no longer result in invalid dates. --- development/build/etc.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/development/build/etc.js b/development/build/etc.js index a75cd650f..3da86409f 100644 --- a/development/build/etc.js +++ b/development/build/etc.js @@ -49,7 +49,10 @@ function createZipTask(platform, buildType, version) { gulp.src(`dist/${platform}/**`), // sort files and set `mtime` to epoch to ensure zip build is deterministic sort(), - gulpZip(`${path}.zip`, { modifiedTime: new Date(0) }), + // Modified time set to an arbitrary static date to ensure build the is reproducible. + // The date chosen is MetaMask's birthday. Originally we chose the Unix epoch, but this + // resulted in invalid dates on certain timezones/operating systems. + gulpZip(`${path}.zip`, { modifiedTime: new Date('2016-07-14T00:00:00') }), gulp.dest('builds'), ); };