Bug#1093201: rsync: please make the build reproducible

Chris Lamb lamby at debian.org
Thu Jan 16 10:45:04 GMT 2025


Source: rsync
Version: 3.3.0+ds1-4
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed that
rsync could not be built reproducibly.

This is because the date in the manual page can vary depending on
whether there is a .git directory and the modification time of version.h
and Mafile, which might get modified when patching via quilt.

A patch is attached that makes this use SOURCE_DATE_EPOCH, which
will always be reliable.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
--- a/debian/patches/reproducible-build.patch	1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/reproducible-build.patch	2025-01-16 10:41:02.596776449 +0000
@@ -0,0 +1,16 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2025-01-16
+
+--- rsync-3.3.0+ds1.orig/md-convert
++++ rsync-3.3.0+ds1/md-convert
+@@ -247,6 +247,9 @@ def find_man_substitutions():
+ 
+     env_subs['date'] = time.strftime('%d %b %Y', time.gmtime(mtime + tz_offset)).lstrip('0')
+ 
++    if 'SOURCE_DATE_EPOCH' in os.environ:
++        env_subs['date'] = time.strftime('%d %b %Y', time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))))
++
+ 
+ def html_via_commonmark(txt):
+     return commonmark.HtmlRenderer().render(commonmark.Parser().parse(txt))
--- a/debian/patches/series	2025-01-16 10:26:37.500831179 +0000
--- b/debian/patches/series	2025-01-16 10:41:01.540777106 +0000
@@ -23,3 +23,4 @@
 # Regression from CVE-2024-12087 (#1093052)
 Fix-FLAG_GOT_DIR_FLIST-collission-with-FLAG_HLINKED.patch
 Fix_use-after-free_in_generator.patch
+reproducible-build.patch


More information about the Reproducible-bugs mailing list