On 2021-07-06, Nilesh Patra wrote:
> On Mon, 01 Mar 2021 13:08:03 -0000 "Chris Lamb" <la...@debian.org> wrote:
>> > Thanks again, but unfortunately this patch breaks the autopkgtests :/
>> > The only way to make it reproducible and allow testing migration would
>> > be to disable the tests.
>> 
>> As I understand the problem:
>> 
>> * The data underneath /testdata/ has non-deterministic data (PDFs)
>> 
>> * The patch prevents /testdata/ from being installed in the binary
>>   package.
>> 
>> * The autopkgtests fail as they require this test data.
>
> Yes, that is exactly what is happening
>
>> > What do you think would be better? Please let me know.
>> 
>> Interesting choice of trade-off. Would it be possible for the
>> autopkgtests to build the test data at "autopkgtest time"?
>
> Probably, however this will need a few workarounds
> Autopkgtests are triggered with the default autodep8 thing for
> dh-make-golang,
> So this will likely need a script followed by the normal autopkgtesting stuff
>

>> Alternatively, do we need these PDFs? We could ship the testdata
>> directory but not ship the .pdf files?
>
> Probably not.
> The build time tests are run as autopkgtests as well, so if you remove
> these tests, or patch these out, the effect will be same on both.
> One of the things I'm not very fond of about the golang system :)
>
> Several packages keep on shipping these data just for testing purposes
> -- nothing wrong, but lack of choice for customisation
>
>> The other, nicer solution could be to patch fpdf to use the
>> SOURCE_DATE_EPOCH environment variable if it exists. This would seem
>> quite straightforward to do, actually -- this is fpdf.go from the
>> "golang-github-jung-kurt-gofpdf" source package:
>> 
>>   // returns Now() if tm is zero
>>   func timeOrNow(tm time.Time) time.Time {
>>     if tm.IsZero() {
>>       return time.Now()
>>     }
>>     return tm
>>   }
>
> Indeed, I'll give this a shot, and see how this goes, thanks for
> pointing this out!

I am guessing that did not turn out to be as easy as hoped?

I have tested an alternate patch patch which works around the issue by
removing only the files that embed timestamps from the testdata
directory.

I am not sure if removing these files will affect autopkgtest or not,
but it is worth a try!


live well,
  vagrant
From 6265aebc1c16999233704c2938fca3e2c09fa461 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@debian.org>
Date: Thu, 8 Dec 2022 19:10:56 +0000
Subject: [PATCH] Remove .pdf and .eps files that embed timestamps (Closes:
 #968045)

https://reproducible-builds.org/docs/timestamps/
---
 debian/rules | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/debian/rules b/debian/rules
index 65710b2..37ded0d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,3 +9,11 @@ override_dh_auto_test:
 	-dh_auto_test
 endif
 
+override_dh_install:
+	dh_install
+	# Remove files that embed timestamps, breaking reproducible builds
+	rm -vf debian/golang-gonum-v1-plot-dev/usr/share/gocode/src/gonum.org/v1/plot/vg/vgpdf/testdata/multipage.pdf \
+	    debian/golang-gonum-v1-plot-dev/usr/share/gocode/src/gonum.org/v1/plot/vg/vgpdf/testdata/issue540.pdf \
+	    debian/golang-gonum-v1-plot-dev/usr/share/gocode/src/gonum.org/v1/plot/vg/vgpdf/testdata/arc.pdf \
+	    debian/golang-gonum-v1-plot-dev/usr/share/gocode/src/gonum.org/v1/plot/plotter/testdata/polygon_holes.pdf \
+	    debian/golang-gonum-v1-plot-dev/usr/share/gocode/src/gonum.org/v1/plot/plotter/testdata/polygon_holes.eps \
-- 
2.38.1

Attachment: signature.asc
Description: PGP signature

Reply via email to