diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2019-04-12 12:25:44 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2019-04-12 14:11:39 +0200 |
commit | 1bc05252f7cf93820d2815463a1f5adfc918f4c3 (patch) | |
tree | 70f69206a2bbd579af80e52fe446a734b1cb9bf4 /rules/project-name.in | |
parent | 23fb0950ad1e7d31918a130d92e53f32e4edb713 (diff) | |
download | ptxdist-1bc05252f7cf93820d2815463a1f5adfc918f4c3.tar.gz ptxdist-1bc05252f7cf93820d2815463a1f5adfc918f4c3.tar.xz |
ptxconfig: make reproducible builds configurable
Some PTXdist packages use SOURCE_DATE_EPOCH to make the build more
reproducible. Make this behaviour more configurable via a newly
introduced ptxdist options. And make it possible to disable the stable
SOURCE_DATE_EPOCH via 'ptxdist setup'.
By default, this will set SOURCE_DATE_EPOCH to the year and month of the
PTXdist version. Using the toolchain version and a custom value is also
possible.
Move setting SOURCE_DATE_EPOCH to the scripts that are evaluated just
before make is called. This way, the toolchain setup and validation already
happened. Otherwise ptxd_timestamp_toolchain() may fail early before the
relevant checks and errors.
Based on a patch from Florian Bäuerle <florian.baeuerle@allegion.com>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'rules/project-name.in')
-rw-r--r-- | rules/project-name.in | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/rules/project-name.in b/rules/project-name.in index 54562341b..6566c3257 100644 --- a/rules/project-name.in +++ b/rules/project-name.in @@ -80,4 +80,65 @@ config PROJECT_CHECK_LICENSES If this is enabled <pkg>.report is build during the normal build process. As a result all specified md5 sums for license files are verified. + +comment "------------------------------------" +comment "reproducible builds" +comment "------------------------------------" + + +choice + prompt "SOURCE_DATE_EPOCH timestamps source" + default REPRODUCIBLE_TIMESTAMP_PTXDIST + help + Use the specifies source to provide a stable SOURCE_DATE_EPOCH. + This helps making builds more reproducible. See + https://reproducible-builds.org/specs/source-date-epoch/ for more + details about SOURCE_DATE_EPOCH. + + For development this can be disabled in 'ptxdist setup'. + +config REPRODUCIBLE_TIMESTAMP_PTXDIST + bool + prompt "ptxdist version" + help + Use the year and month of the PTXdist version to generated the + timestamp. + +config REPRODUCIBLE_TIMESTAMP_TOOLCHAIN + bool + prompt "toolchain version" + help + Use the year and month of the toolchain version to generated the + timestamp. This only works for OSELAS.Toolchain. + This is useful to keep the timestamp stable across PTXdist + version updates. When a toolchain update happens, then the + compiler will probably produce different code, so a different + timestamp is ok as well. + +config REPRODUCIBLE_TIMESTAMP_CUSTOM + bool + prompt "custom timestamp" + +endchoice + +config REPRODUCIBLE_TIMESTAMP + string + default "toolchain" if REPRODUCIBLE_TIMESTAMP_TOOLCHAIN + default "ptxdist" if REPRODUCIBLE_TIMESTAMP_PTXDIST + default "custom" if REPRODUCIBLE_TIMESTAMP_CUSTOM + +if REPRODUCIBLE_TIMESTAMP_CUSTOM + +config REPRODUCIBLE_TIMESTAMP_STRING + string + prompt "custom timestamp" + help + Supply a custom fake timestamp to be injected to the build. + The timestamp is passed to 'date --date', e.g. "2018-11-01 UTC". + + Note: the timestamp should contain include the timezone. + Otherwise timezone changes may produce different results. + +endif + endmenu |