You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would you be willing to help implement this feature?
Notes
Initially I tried to use libfaketime with a fixed timestamp. This did work for nitro.json (ie. new Date()), but Node.js stats.mtime somehow always returns the current time, even though other cli tools returned the fake time (eg. ls, stat, date). Adding native support for SOURCE_DATE_EPOCH seems to be the preferred solution anyways: https://reproducible-builds.org/docs/timestamps/
The text was updated successfully, but these errors were encountered:
Describe the feature
I'd like to create reproducible builds using a framework based on Nitro.
I discovered three instances where Nitro injects non-reproducible timestamps into the output:
date
field innitro.json
: https://github.com/unjs/nitro/blob/6f1fa4bfe8cd184b3c8607e0de669c6346b4996f/src/core/build/prod.ts#L38mtime
field inserver-assets
: https://github.com/unjs/nitro/blob/6f1fa4bfe8cd184b3c8607e0de669c6346b4996f/src/rollup/plugins/server-assets.ts#L51mtime
field inpublic-assets
: https://github.com/unjs/nitro/blob/6f1fa4bfe8cd184b3c8607e0de669c6346b4996f/src/rollup/plugins/public-assets.ts#L58Using
kaniko --reproducible
I was able to create a fully reproducible build (ie. identical container sha256) after applying this patch withpnpm patch
patches/nitropack.patch
This uses the recommended environment variable
SOURCE_DATE_EPOCH
, see https://reproducible-builds.org/docs/source-date-epoch/Additional information
Notes
Initially I tried to use libfaketime with a fixed timestamp. This did work for
nitro.json
(ie.new Date()
), but Node.jsstats.mtime
somehow always returns the current time, even though other cli tools returned the fake time (eg.ls
,stat
,date
). Adding native support forSOURCE_DATE_EPOCH
seems to be the preferred solution anyways: https://reproducible-builds.org/docs/timestamps/The text was updated successfully, but these errors were encountered: