[opensuse-factory] enable source_date_epoch_from_changelog
For https://en.opensuse.org/openSUSE:Reproducible_Builds Now that this upstream RPM patch has landed in Factory https://build.opensuse.org/package/view_file/Base:System/rpm/0001-set-SOURCE... I propose to add in the openSUSE:Factory project config under Macros: %source_date_epoch_from_changelog Y %source_date_epoch_from_changelog will set the SOURCE_DATE_EPOCH environment variable to the date of the latest changelog entry and various tools will use that date instead of the 'current' date/time. gcc, cmake, asciidoc and many others. That helps to improve the overall reproducibility of packages. E.g. __DATE__ and __TIME__ preprocessor macros in .c files will then no more create differing binary rpms that trigger superfluous rebuilds of depending packages and waste mirror bandwidth. Also rpm itself will use it to set the "Build Date" field of the resulting package... but the "Signature" field remains as it was. Btw: there are two other macros I have in https://build.opensuse.org/project/prjconf/home:bmwiedemann:reproducible In a later stage, if/when we want to go for bit-identical builds, we can also set %_buildhost SOMECONSTANTSTRING but before, we probably want to add a way to find the actual buildhost in case it created faulty RPM packages. and then later %clamp_mtime_to_source_date_epoch Y which will make sure that packages contain no files with 'current' date. That one is known to have some negative effects on python packages with .pyc files which can be mostly avoided with such a patch https://github.com/python/cpython/pull/296 but it is still uncertain what other formats might be affected in similar ways. Ciao Bernhard M.
On Apr 11 2017, "Bernhard M. Wiedemann" <bernhardout@lsmod.de> wrote:
I propose to add in the openSUSE:Factory project config under Macros: %source_date_epoch_from_changelog Y
Why "Y"? Wouldn't that be a syntax error? Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 2017-04-11 11:04, Andreas Schwab wrote:
On Apr 11 2017, "Bernhard M. Wiedemann" <bernhardout@lsmod.de> wrote:
I propose to add in the openSUSE:Factory project config under Macros: %source_date_epoch_from_changelog Y
Why "Y"? Wouldn't that be a syntax error?
in rpm macros, there are multiple aliases for booleans, where Y=1 and N=0 -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 2017-04-11 10:55, Bernhard M. Wiedemann wrote:
For https://en.opensuse.org/openSUSE:Reproducible_Builds
Now that this upstream RPM patch has landed in Factory https://build.opensuse.org/package/view_file/Base:System/rpm/0001-set-SOURCE...
I propose to add in the openSUSE:Factory project config under Macros: %source_date_epoch_from_changelog Y
%source_date_epoch_from_changelog will set the SOURCE_DATE_EPOCH environment variable to the date of the latest changelog entry and various tools will use that date instead of the 'current' date/time. gcc, cmake, asciidoc and many others. That helps to improve the overall reproducibility of packages. E.g. __DATE__ and __TIME__ preprocessor macros in .c files will then no more create differing binary rpms that trigger superfluous rebuilds of depending packages and waste mirror bandwidth.
Also rpm itself will use it to set the "Build Date" field of the resulting package... but the "Signature" field remains as it was.
Dimstar enabled it yesterday on Factory. But we will probably only see the full effect after the next full rebuild (probably in some weeks) If you suspect that it causes problems, you can do local builds without it using osc build --define='%source_date_epoch_from_changelog N' So far, I have not heard of any problems. Ciao Bernhard M.
participants (2)
-
Andreas Schwab
-
Bernhard M. Wiedemann