🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.debian.bugs.dist
4 messages
4 total messages Started by Vagrant Cascadian Sun, 01 Nov 2026 01:10
Bug#1152747: fop: reproducible builds: Improve use of SOURCE_DATE_EPOCH for timestamps in PDF files
#2849
Author: Vagrant Cascadian
Date: Sun, 01 Nov 2026 01:10
69 lines
4382 bytes
--=-=-=
Content-Type: text/plain

Package: fop
Severity: normal
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps toolchain
X-Debbugs-Cc: reproducible-bugs@lists.alioth.debian.org, tony mancill <tmancill@debian.org>

I think I found one of the remaining places where timestamps were
sneaking into CreateDate when using fop to generate PDFs.

If this sounds familiar, that is because this is a follow-up to the
original bug which partially fixed the issues:

  https://bugs.debian.org/978499

It has been nagging at me in the 5 or so years since; I think I finally
identified where in the code needs to be adjusted!

This patch is more of a proof-of-concept than a real patch, although it
did appear to fix the one remaining issue for the pam and treeview
packages.

diff --git a/fop-core/src/main/java/org/apache/fop/render/intermediate/IFRenderer.java b/fop-core/src/main/java/org/apache/fop/render/intermediate/IFRenderer.java
index 84e4e3a..a4d8d7c 100644
--- a/fop-core/src/main/java/org/apache/fop/render/intermediate/IFRenderer.java
+++ b/fop-core/src/main/java/org/apache/fop/render/intermediate/IFRenderer.java
@@ -544,7 +544,8 @@ public class IFRenderer extends AbstractPathOrientedRenderer {
         } else {
             xmpBasic.setCreatorTool(Version.getVersion());
         }
-        xmpBasic.setMetadataDate(new java.util.Date());
+        final Long sourcedate = (1000 * Long.parseLong("1793491658"));
+        xmpBasic.setMetadataDate(new java.util.Date(sourcedate));
         if (getUserAgent().getCreationDate() != null) {
             xmpBasic.setCreateDate(getUserAgent().getCreationDate());
         } else {


Obviously hard-coding this is the wrong way to fix this (well, it is
reproducible!), but adjusting it to use SOURCE_DATE_EPOCH like in the
earlier
debian/patches/0001-PDFInfo.java-Support-SOURCE_DATE_EPOCH-environment-v.patch
should hopefully do the trick? I struggle a bit with the Java code
necessary to pull this off myself, but at least identified *where* in
the code it needed to be fixed.

Other packages using fop to generate PDFs seem to mostly be working even
without this:

  https://tests.reproducible-builds.org/debian/issues/unstable/timestamps_in_pdf_generated_by_apache_fop_issue.html


live well,
  vagrant

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCauaPyQAKCRDcUY/If5cW
qm04APsE9PviXSHURwBO9JTWhCNGFeRx9etEGHBu2FuYjEn2dgEAgF1Ga4nThesu
rFKhym+3iKHEnNDx2+S2bnX/FaLKqAA=
=Sy6t
-----END PGP SIGNATURE-----
--=-=-=--
Bug#1152747: fop: reproducible builds: Improve use of SOURCE_DATE_EPOCH for timestamps in PDF files
#2999
Author: Juan Manuel Méndez Rey
Date: Mon, 02 Nov 2026 19:30
12 lines
2284 bytes
Hi Vagrant,

Thanks for finding the exact spot, I have prepared a fix based on that:
https://salsa.debian.org/java-team/fop/-/merge_requests/3

It reads SOURCE_DATE_EPOCH there, like the rest of the existing patch.
With it, two runs at different times give identical PDFs.

Could you check pam and treeview with it?

Regards,
Juan
Bug#1152747: fop: reproducible builds: Improve use of SOURCE_DATE_EPOCH for timestamps in PDF files
#3054
Author: Vagrant Cascadian
Date: Mon, 02 Nov 2026 20:20
35 lines
3029 bytes
--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 2026-11-02, Juan Manuel M=C3=A9ndez Rey wrote:
> Thanks for finding the exact spot, I have prepared a fix based on that:
> https://salsa.debian.org/java-team/fop/-/merge_requests/3
>
> It reads SOURCE_DATE_EPOCH there, like the rest of the existing patch.
> With it, two runs at different times give identical PDFs.
>
> Could you check pam and treeview with it?

With your fop patch applied, building both pam and treeview come out
bit-for-bit reproducibly, thanks!

This one has been nagging at me for literally 5 years! :)

Would be ideal if someone could take these patches upstream; does anyone
have experience with contributing to fop upstream? :)

live well,
  vagrant

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCaujvWAAKCRDcUY/If5cW
qruhAQDmrMfiKFxNPRq0kDposOrajL4vWZuoRXjKlMfBjlH8RwEAn+LPccAlm7jV
ZNBUNvC47BGd7Cp/8R+2gonoljvOugo=
=/LOp
-----END PGP SIGNATURE-----
--=-=-=--
Bug#1152747: fop: reproducible builds: Improve use of SOURCE_DATE_EPOCH for timestamps in PDF files
#3127
Author: Juan Manuel Méndez Rey
Date: Tue, 03 Nov 2026 10:10
16 lines
2734 bytes
Hi Vagrant,

Thanks for checking pam and treeview. I have sent the fix upstream:

https://issues.apache.org/jira/browse/FOP-3367
https://github.com/apache/xmlgraphics-fop/pull/132

Upstream has refused environment variables before, in
https://issues.apache.org/jira/browse/FOP-2854, so the
upstream patch does not read SOURCE_DATE_EPOCH. Instead it makes FOP use
the creation date set through its API for every date in the PDF,
including xmp:MetadataDate and the file /ID. The Debian patch stays until
upstream has something that covers SOURCE_DATE_EPOCH.

Regards,
Juan
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads