unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#49640] [PATCH core-updates] gnu: ghostscript: Improve reproducibility of PDF document generation
@ 2021-07-19 11:45 Guillaume Le Vaillant
  2021-07-19 14:35 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Guillaume Le Vaillant @ 2021-07-19 11:45 UTC (permalink / raw)
  To: 49640


[-- Attachment #1.1: Type: text/plain, Size: 731 bytes --]

Hi,

When trying to solve a reproducibility issue when generating the
PDF documentation of the txr software (see [1]), Paul Patience noticed
that ghostscript writes a creation date in the PDF even when the
GS_GENERATE_UUIDS environment variable is set to "0".

The attached patch updates 'ghostscript-no-header-creationdate.patch' to
fix this issue.

Given the amount of rebuilds caused by modifying ghostscript, this
should go to core-updates, but is core-updates in freeze state already,
or can I push this patch right now?

Note: Even with this patch, there are still some cases where PDF
generation by ghostscript is not reproducible (for reasons not related
to creation date), like groff-doc.

[1]: https://bugs.gnu.org/49517

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-ghostscript-Improve-reproducibility-of-PDF-docum.patch --]
[-- Type: text/x-patch, Size: 2038 bytes --]

From db5962c68099f835350c24c8a3f889b9fa1f8a8e Mon Sep 17 00:00:00 2001
From: Guillaume Le Vaillant <glv@posteo.net>
Date: Mon, 19 Jul 2021 11:48:12 +0200
Subject: [PATCH] gnu: ghostscript: Improve reproducibility of PDF document
 generation

* gnu/packages/patches/ghostscript-no-header-creationdate.patch: Disable
  writing "xmp:ModifyDate" and "xmp:CreateDate" if GS_GENERATE_UUIDS is set to
  "0" or "no".
---
 .../ghostscript-no-header-creationdate.patch  | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/patches/ghostscript-no-header-creationdate.patch b/gnu/packages/patches/ghostscript-no-header-creationdate.patch
index 92ddbdade0..b19f3ab5d9 100644
--- a/gnu/packages/patches/ghostscript-no-header-creationdate.patch
+++ b/gnu/packages/patches/ghostscript-no-header-creationdate.patch
@@ -20,3 +20,25 @@ index 0fb067e..b342e2c 100644
      {
          struct tm tms;
          time_t t;
+--- orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c
++++ gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c
+@@ -692,6 +692,9 @@
+             pdf_xml_attribute_name(s, "xmlns:xmp");
+             pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/");
+             pdf_xml_tag_end(s);
++            if (!getenv("GS_GENERATE_UUIDS") ||
++                (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 &&
++                 strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))
+             {
+                 pdf_xml_tag_open_beg(s, "xmp:ModifyDate");
+                 pdf_xml_tag_end(s);
+@@ -700,6 +701,9 @@
+                 pdf_xml_tag_close(s, "xmp:ModifyDate");
+                 pdf_xml_newline(s);
+             }
++            if (!getenv("GS_GENERATE_UUIDS") ||
++                (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 &&
++                 strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))
+             {
+                 pdf_xml_tag_open_beg(s, "xmp:CreateDate");
+                 pdf_xml_tag_end(s);
-- 
2.32.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#49640] [PATCH core-updates] gnu: ghostscript: Improve reproducibility of PDF document generation
  2021-07-19 11:45 [bug#49640] [PATCH core-updates] gnu: ghostscript: Improve reproducibility of PDF document generation Guillaume Le Vaillant
@ 2021-07-19 14:35 ` Ludovic Courtès
  2021-07-19 15:23   ` bug#49640: " Guillaume Le Vaillant
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2021-07-19 14:35 UTC (permalink / raw)
  To: Guillaume Le Vaillant; +Cc: 49640

Hi Guillaume,

Guillaume Le Vaillant <glv@posteo.net> skribis:

> When trying to solve a reproducibility issue when generating the
> PDF documentation of the txr software (see [1]), Paul Patience noticed
> that ghostscript writes a creation date in the PDF even when the
> GS_GENERATE_UUIDS environment variable is set to "0".
>
> The attached patch updates 'ghostscript-no-header-creationdate.patch' to
> fix this issue.
>
> Given the amount of rebuilds caused by modifying ghostscript, this
> should go to core-updates, but is core-updates in freeze state already,
> or can I push this patch right now?

[...]

> From db5962c68099f835350c24c8a3f889b9fa1f8a8e Mon Sep 17 00:00:00 2001
> From: Guillaume Le Vaillant <glv@posteo.net>
> Date: Mon, 19 Jul 2021 11:48:12 +0200
> Subject: [PATCH] gnu: ghostscript: Improve reproducibility of PDF document
>  generation
>
> * gnu/packages/patches/ghostscript-no-header-creationdate.patch: Disable
>   writing "xmp:ModifyDate" and "xmp:CreateDate" if GS_GENERATE_UUIDS is set to
>   "0" or "no".

LGTM, you can push to ‘core-updates’.  Was this submitted upstream?

Note: when ‘core-updates’ is frozen, we’ll fork ‘core-updates-frozen’ so
that people can happily keeping messing up on ‘core-updates’.  This was
suggested some months ago during the Guix Days and I think it can make
things smoother!

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#49640: [PATCH core-updates] gnu: ghostscript: Improve reproducibility of PDF document generation
  2021-07-19 14:35 ` Ludovic Courtès
@ 2021-07-19 15:23   ` Guillaume Le Vaillant
  0 siblings, 0 replies; 3+ messages in thread
From: Guillaume Le Vaillant @ 2021-07-19 15:23 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 49640-done

Ludovic Courtès <ludo@gnu.org> skribis:

> LGTM, you can push to ‘core-updates’.

Done in db5962c68099f835350c24c8a3f889b9fa1f8a8e.
Thanks for the review.

> Was this submitted upstream?

No, in [1] upstream indicates explicitly that they don't want to
implement reproducible builds.

[1] https://bugs.ghostscript.com/show_bug.cgi?id=698208




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-19 15:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-19 11:45 [bug#49640] [PATCH core-updates] gnu: ghostscript: Improve reproducibility of PDF document generation Guillaume Le Vaillant
2021-07-19 14:35 ` Ludovic Courtès
2021-07-19 15:23   ` bug#49640: " Guillaume Le Vaillant

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).