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

Codefix: [CMake] use the UTC0 date for our ISODATE #12470

Merged
merged 1 commit into from Apr 10, 2024

Conversation

TrueBrain
Copy link
Member

Motivation / Problem

When doing benchmarks on OpenTTD, I asked git: give me the last commit of 2023-12-31, and it told me: sure, that is f56a2d0. But after building OpenTTD it told me it was based on a commit in 2024-01-01.

This confused me, and this PR addresses that issue.

Description

Turns out, we use the TZ of the commit, instead of UTC, when determining the date we show in our _openttd_revision. This is because git is very unclear in what it does when/what/where when it comes to timezones.

But with this fix, we force the TZ to be UTC, and to output the date in our local timezone, as an ISO date. This is what we assumed %ci would do, but clearly doesn't.

Limitations

In theory this could mean we served a nightly build on date X, but has an internal reference of being on date X-1 or X+1. But given most of us work in EU times, this is not all that likely. But in theory it was possible!

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR touches english.txt or translations? Check the guidelines
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, game_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

@TrueBrain TrueBrain enabled auto-merge (squash) April 10, 2024 08:19
@TrueBrain TrueBrain changed the title Codefix: [CMake] use the UTC date for our ISODATE Codefix: [CMake] use the UTC0 date for our ISODATE Apr 10, 2024
@TrueBrain TrueBrain disabled auto-merge April 10, 2024 08:30
@TrueBrain TrueBrain enabled auto-merge (squash) April 10, 2024 08:30
@TrueBrain TrueBrain merged commit 1b4bb1d into OpenTTD:master Apr 10, 2024
15 checks passed
ladysadie pushed a commit to ladysadie/OpenTTD_WIP that referenced this pull request Apr 10, 2024
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