Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 751984 - Use UTC timezone when displaying QDateTimes parsed from SOURCE_DATE_EPOCH #477

Merged
merged 1 commit into from May 16, 2016

Conversation

infinity0
Copy link
Contributor

According to the SOURCE_DATE_EPOCH spec [1], "Formatting MUST be deferred until runtime if an end user should observe the value in their own locale or timezone."

However setTime_t uses localtime, so the output is in the timezone of the build machine running doxygen, and not the timezone of the reader consuming the final output.

To adhere to the spec, the easiest option is to add a setTimeUtc_t function that is the same as setTime_t, but only uses gmtime instead of first trying localtime.

[1] https://reproducible-builds.org/specs/source-date-epoch/

…SOURCE_DATE_EPOCH

According to the SOURCE_DATE_EPOCH spec [1], "Formatting MUST be deferred until runtime if an end user should observe the value in their own locale or timezone."

However setTime_t uses localtime, so the output is in the timezone of the build machine running doxygen, and not the timezone of the reader consuming the final output.

To adhere to the spec, the easiest option is to add a setTimeUtc_t function that is the same as setTime_t, but only uses gmtime instead of first trying localtime.

[1] https://reproducible-builds.org/specs/source-date-epoch/
@doxygen
Copy link
Owner

doxygen commented May 16, 2016

I don't understand the change. When doxygen produces output, it should use local time right? i.e. the time is put into the generated output, so how else can users ever observe the time in their own locale?

@infinity0
Copy link
Contributor Author

infinity0 commented May 16, 2016

If the user-doing-the-building sets SOURCE_DATE_EPOCH it means they want reproducible builds, so the build-user can't (and doesn't even want to) output this time in their locale. (Reproducible builds by definition means that the build should be independent of the build-user.)

A more complex alternative (to this PR, that still preserves locale) is to allow reader-users to observe SOURCE_DATE_EPOCH in their own locale, which means adding some javascript to parse this timestamp into the reader's locale. This would allow builders to produce the same reproducible output.

@doxygen doxygen merged commit 9a2c7bb into doxygen:master May 16, 2016
@doxygen
Copy link
Owner

doxygen commented May 16, 2016

Thanks for the clarification. Indeed I agree that viewing the timestamp in the user's local could better be facilitated by javascript.

@infinity0
Copy link
Contributor Author

Great, thanks!

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.

None yet

2 participants