-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the build reproducible #2024
Conversation
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()". This was originally filed in Debian as #891899. [0] https://reproducible-builds.org/ [1] https://bugs.debian.org/891899 Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
rollup.config.js
Outdated
@@ -15,9 +15,11 @@ const commitHash = (function () { | |||
} | |||
})(); | |||
|
|||
const now = new Date(process.env.SOURCE_DATE_EPOCH ? (process.env.SOURCE_DATE_EPOCH * 1000) : new Date().getTime()).getTime(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous version would put a human readable date into the banner. Would it be ok with your efforts to remove the final getTime()
here? Or maybe use toISOString
instead to get a more standardised output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm easy! :) (indeed, see the linked Debian bug for a patch for the previous version)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see! I guess I would go with the original suggestion then.
Thanks! |
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()".
This was originally filed in Debian as #891899.
[0] https://reproducible-builds.org/
[1] https://bugs.debian.org/891899
Signed-off-by: Chris Lamb chris@chris-lamb.co.uk