On Thu, Dec 08, 2022 at 11:18:56AM -0800, Vagrant Cascadian wrote:
> 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?

Um, not exactly - I haven't had time for this, other packages had
higher priority and working on this bug report kept sinking down in
my TODO list, to the point I forgot about this.

> 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!

It works OK, I have uploaded the package with your patch. Thanks!

-- 
Best,
Nilesh

Attachment: signature.asc
Description: PGP signature

Reply via email to