[Pkg-javascript-devel] Bug#891899: node-rollup: please make the build reproducible

Chris Lamb lamby at debian.org
Fri Mar 2 09:48:49 UTC 2018


Source: node-rollup
Version: 0.50.0-1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed
that node-rollup could not be built reproducibly as it encodes
the current build time via "new Date()".

Patch attached.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
--- a/debian/patches/0001-reproducible-build.patch	1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/0001-reproducible-build.patch	2018-03-02 09:41:49.392154726 +0000
@@ -0,0 +1,19 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2018-03-02
+
+--- node-rollup-0.50.0.orig/rollup.config.js
++++ node-rollup-0.50.0/rollup.config.js
+@@ -14,9 +14,11 @@ const commitHash = (function() {
+ 	}
+ })();
+ 
++const now = new Date(process.env.SOURCE_DATE_EPOCH ? (process.env.SOURCE_DATE_EPOCH * 1000) : new Date().getTime());
++
+ const banner = readFileSync('src/banner.js', 'utf-8')
+ 	.replace('${version}', pkg.version)
+-	.replace('${time}', new Date())
++	.replace('${time}', now.toUTCString())
+ 	.replace('${commitHash}', commitHash);
+ 
+ export default [
--- a/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/series	2018-03-02 09:20:55.357126507 +0000
@@ -0,0 +1 @@
+0001-reproducible-build.patch


More information about the Pkg-javascript-devel mailing list