https://bugs.documentfoundation.org/show_bug.cgi?id=174246

            Bug ID: 174246
           Summary: Support SOURCE_DATE_EPOCH for reproducible PDF export
           Product: LibreOffice
           Version: 27.2.0.0 alpha0+ master
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: medium
         Component: Printing and PDF export
          Assignee: [email protected]
          Reporter: [email protected]

Description:
PDF export currently embeds the current time in the exported file: the
info-dictionary CreationDate (and modification date), the XMP metadata
dates, and the trailer /ID all derive from the wall clock, so two
exports of the same document seconds apart differ byte for byte. That
breaks reproducible-build verification and content-addressed archiving
of exported documents.
The reproducible-builds convention is the SOURCE_DATE_EPOCH environment
variable (a Unix timestamp). When it is set, exporters use it in place
of the current time.
A patch implementing this for the PDF writer is in review:
https://gerrit.libreoffice.org/c/core/+/213278
With SOURCE_DATE_EPOCH set, two exports of the same document are
byte-identical; unset or invalid values keep the current behaviour.

Steps to Reproduce:
1. Export any document to PDF.
2. Wait a few seconds and export the same unchanged document again to a second
file.
3. Compare the two files byte for byte (for example with sha256sum).

Actual Results:
The two files differ. The info-dictionary CreationDate and modification date,
the XMP metadata dates, and the trailer /ID all derive from the wall clock at
export time, so two exports of the same document seconds apart are never
byte-identical. That breaks reproducible-build verification and
content-addressed archiving of exported documents.

Expected Results:
The PDF exporter should honour the SOURCE_DATE_EPOCH environment variable (the
reproducible-builds convention, a Unix timestamp): when it is set, use it in
place of the current time for those fields, so two exports of the same document
are byte-identical. Unset or invalid values keep the current behaviour.



Reproducible: Always


User Profile Reset: No

Additional Info:
Filed at the request of Ilmari Lauhakangas on Gerrit change 213278.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to