Skip to content

Comments

Improve support for SOURCE_DATE_EPOCH by forcing UTC timezone; fix TrueType epoch timezone#70

Open
gioele wants to merge 2 commits intokreativekorp:masterfrom
gioele:reproducible-fix-timezone
Open

Improve support for SOURCE_DATE_EPOCH by forcing UTC timezone; fix TrueType epoch timezone#70
gioele wants to merge 2 commits intokreativekorp:masterfrom
gioele:reproducible-fix-timezone

Conversation

@gioele
Copy link
Contributor

@gioele gioele commented Feb 20, 2026

The patch in PR #69 and its extension in commit 39936be did not address the reproducibility issues that arise when different timezones are used.

The Reproducible Builds project suggests forcing the use of the UTC timezone whenever SOURCE_DATE_EPOCH is used.

In order to be fully timezone-independent, the code that deals with the TrueType epoch must be fixed as well.

The TrueType epoch is supposed to be understood as an UTC date. Instantiating GregorianCalendar with a date implicitly sets its timezone to the local timezone.

Because it is not possible to pass both a date and a timezone to the constructor of GregorianCalendar, let's store the offset as a precalculated number (date --date="1904-01-01 00:00:00 UTC" +%s).

While we are at it, let's also switch from negative- to positive-offset calculations.

The patch in PR kreativekorp#69 and its extension in commit 39936be did not address
the reproducibility issues that arise when different timezones are used.

The Reproducible Builds project suggests forcing the use of the UTC timezone
whenever `SOURCE_DATE_EPOCH` is used.
@gioele gioele marked this pull request as draft February 20, 2026 21:50
@gioele gioele changed the title Improve support for SOURCE_DATE_EPOCH by forcing UTC timezone Improve support for SOURCE_DATE_EPOCH by forcing UTC timezone; fix TrueType epoch timezone Feb 20, 2026
The TrueType epoch is supposed to be understood as an UTC date.
Instantiating `GregorianCalendar` with a date implicitly sets its
timezone to the local timezone.

Because it is not possible to pass both a date and a timezone to the
constructor of `GregorianCalendar`, let's store the offset as a
precalculated number (`date --date="1904-01-01 00:00:00 UTC" +%s`).

While we are at it, let's also switch from negative- to
positive-offset calculations.
@gioele gioele force-pushed the reproducible-fix-timezone branch from f7569d1 to 7e0f2cf Compare February 20, 2026 23:38
@gioele gioele marked this pull request as ready for review February 20, 2026 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant