From: Chris Lamb Date: Sat, 7 Dec 2019 15:41:56 +0000 (+0000) Subject: Make the build reproducible (#6817) X-Git-Tag: v3.0.0-alpha~204 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4483d18648a4de1fff9a03a95bfec416c0f1be4;p=thirdparty%2FChart.js.git Make the build reproducible (#6817) Whilst working on the Reproducible Builds effort [0] we noticed that Chart.js could not be built reproducibly. This is because it was embedding another build date in a "banner" comment. This patch uses the value from SOURCE_DATE_EPOCH [1] if present. This was originally filed in Debian as #946333 [2]. [0] https://reproducible-builds.org/ [1] https://reproducible-builds.org/specs/source-date-epoch/ [2] https://bugs.debian.org/946333 Signed-off-by: Chris Lamb --- diff --git a/rollup.config.js b/rollup.config.js index e8b593793..3cbfe0b5c 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -12,7 +12,7 @@ const input = 'src/index.js'; const banner = `/*! * Chart.js v${pkg.version} * ${pkg.homepage} - * (c) ${new Date().getFullYear()} Chart.js Contributors + * (c) ${(new Date(process.env.SOURCE_DATE_EPOCH ? (process.env.SOURCE_DATE_EPOCH * 1000) : new Date().getTime())).getFullYear()} Chart.js Contributors * Released under the MIT License */`;