Skip to content
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

build: Make sure SOURCE_DATE_EPOCH is in the past #536

Merged
merged 1 commit into from Oct 1, 2018

Conversation

bmwiedemann
Copy link
Contributor

@bmwiedemann bmwiedemann commented Aug 31, 2018

Make sure SOURCE_DATE_EPOCH is in the past,
otherwise, builds before noon will not have normalized mtimes
from %clamp_mtime_to_source_date_epoch

This also helps other programs like tar --clamp-mtime

Tested successfully on openSUSE.
To reproduce, create a changelog entry with only a date

* Fri Aug 31 2018 user@host
- dummy

and build it before 12:00 UTC
using macros

%source_date_epoch_from_changelog Y
%clamp_mtime_to_source_date_epoch Y
%use_source_date_epoch_as_buildtime Y
%_buildhost reproducible

rpm -qpvl showed file mtime values to not be normalized
and therefore build results were not bit-identical.

Edit: would be nice to avoid the modulo heuristic and find out if there was a time in the changelog or just a date. How?

otherwise, builds before noon will not have normalized mtimes
from %clamp_mtime_to_source_date_epoch

This also helps other programs like tar --clamp-mtime
@bmwiedemann
Copy link
Contributor Author

I'm already producing bit-identical RPMs using the 4 macros documented in
https://en.opensuse.org/openSUSE:Reproducible_Builds
So no changes on digests or signatures are needed atm.

Inaccuracy of $SOURCE_DATE_EPOCH does not matter, as long as it is in the past. Some people always set it to 1 (aka 1970-01-01 00:00:01) and are happy.

@ffesti ffesti merged commit c33b41b into rpm-software-management:master Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants