[Rpm-maint] [rpm-software-management/rpm] support reproducible automatic rebuilds (PR #2880)

Jan Zerebecki notifications at github.com
Tue Jan 30 22:51:01 UTC 2024


Normally automatic rebuilds work, but together with reproducible builds an undesirable situation may occur. If a build e.g. embeds SOURCE_DATE_EPOCH in the output, then the output changes every time such a rebuild happens, which can be very often. This is to be avoided as updating packages without necessity is too expensive.

To avoid this, in addition to the settings already needed for reproducible builds, set the here introduced macro use_old_source_date_epoch to Y and set the environment variable OLD_SOURCE_DATE_EPOCH to the date of the first build (e.g. from the changelog or git commit) and put it incremented by the build count into SOURCE_DATE_EPOCH.

This makes rpm use the old SOURCE_DATE_EPOCH for build scripts, but still use the new incremented one itself.

As source files may have the mtime of commit, if
set_mtime_to_source_date_epoch is Y, then set the mtime in the rpm. Using this instead of clamping with clamp_mtime_to_source_date_epoch avoids problems when build scripts use the old SOURCE_DATE_EPOCH for mtime. This is not common, but it would otherwise be difficult to debug when such a problem happens.

Also instead of only warning, error out on a missing changelog date for SOURCE_DATE_EPOCH.

For debugging if the macro warn_on_mtime_lower_than_source_date_epoch is Y log if any mtime is lower than the new incremented SOURCE_DATE_EPOCH.
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/2880

-- Commit Summary --

  * support reproducible automatic rebuilds

-- File Changes --

    M build/build.c (39)
    M build/files.c (30)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/2880.patch
https://github.com/rpm-software-management/rpm/pull/2880.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2880
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/2880 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240130/4d09ad63/attachment.html>


More information about the Rpm-maint mailing list