reprotest fails with faketime on quilt patched files

[tl;dr faketime results on broken file timestamps for quilt patched files]

Since March 2022 I observe random broken reproducibilty in some of my Debian packages (xfig, igerman98, libsnmp-session-perl) in the weekly salsa CI runs.

I tracked this down to faketime being used in Salsa CI reprotest in combination with quilt modifying some file.

The problem occurs if there is a file in the package, that is modified by quilt using debian source format 3.0 (quilt).

I created a test repository at https://salsa.debian.org/roland/faketime-test . There we have a file "patched", that is modified by debian/patches/01-date.

When using reprotest --variations=-all,time.faketimes=2023-12-31 this file gets a timestamp that seems to be based on the time diff between now and the faketime in seconds used as a unixtime epoch. So this is between now (2022-04-30) and 2023-12-31: 1 year and 9 months, which results in a timestamp 1971-09-02 with a time shrinking with every run.

I now have added the following to debian/rules:

        date
        ls -l *patched

which gives me this output when faketime is active:

date
Sun Dec 31 00:00:01 GMT 2023
ls -l *patched
-rw-r--r-- 1 root root 20 Sep  2  1971 patched
-rw-r--r-- 1 root root 20 Dec 31  2020 unpatched

("unpatched" is a file, that gets its timestamp from orig.tar.gz).

Without faketime (or when the reprotest randomly decides not to use faketime) everything looks correct:

date
Sat Apr 30 01:26:24 GMT 2022
ls -l *patched
-rw-r--r-- 1 root root 20 Apr 30 01:26 patched
-rw-r--r-- 1 root root 20 Dec 31  2020 unpatched

(see https://salsa.debian.org/roland/faketime-test/-/jobs/2721939)

I reported this issue to the rb-general mailing list and Holger Levsen replied, that this is one of the reasons, why the archive reproducible build service does not use faketime for 8 years now.

So I'd suggest switching off faketime in salsa-ci reprotest until this issue is fixed, too.

I first observed the issue in igerman98 on 2022-03-11, in libsnmp-session-perl on 2022-03-23 and in xfig on 2022-04-09 using weekly schedules. But it's hard to give a concrete starting date, since the test often skips faketime with the message INFO:reprotest.build:FAKETIME variation: enabled but chosen randomly not to fake!

Greetings Roland

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information