[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ps2pdf: why differences in different instances using unchanged PS source file



On 2020-12-13 at 12:03, The Wanderer wrote:

> ps2pdf appears to be part of ghostscript. Neither its man page nor the
> one for 'gs' (which it references) seem to contain any options for
> setting these timestamps, preventing their creation, or doing similarly
> with that UUID.
> 
> 
> The Debian reproducible-builds project has a page on eliminating this
> type of "multiple runs on the same input don't produce identical output"
> issue more generally[1], which links to a page on doing so with PDFs
> generated by Ghostscript specifically[2].
> 
> I'm not enough of an expert to follow that much further, but at a
> glance, it looks like the solution is to patch Ghostscript; the patch
> doesn't seem to have been accepted upstream, and it's not clear whether
> or not it's (going to be) distributed in the Debian package.
> 
> If you're not OK with handling that on your own end, then you may be out
> of luck with this.
> 
> [1] https://wiki.debian.org/ReproducibleBuilds/Howto
> [2] https://wiki.debian.org/ReproducibleBuilds/PdfGeneratedByGhostscript

On closer examination of that latter link, apparently it's possible to
bypass the timestamps issue by using a command called 'faketime' (from a
package of the same name), to tell the program that the system-clock
time is set to something other than what it actually is.

The UUID is generated based on time, but apparently it's done in a way
that isn't affected by faketime, and that is what needs to be patched.

So you can probably eliminate three of the five differences by just
prepending 'faketime ' to your ps2pdf command. The other two will still
probably need patching of ghostscript to fix, however, and the link to
the patch from the above page seems to be dead.

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: