Repository navigation
Conversation
A Docker box that mounts the host's /etc/localtime ran on the host's rules but told clients it was on Etc/UTC: Debian links /etc/localtime to Etc/UTC, so the mount overwrites that file, and /etc/timezone keeps the image's name. Clients then read the household clock (a car's ready time, a goal's days) an hour or two off. Every name candidate must now have time.Local's rules from 1970 to 2038, and a UTC name needs a clock that is UTC. A copied /etc/localtime is named by the zoneinfo file with the same bytes, else the first with the same rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A tester set a car's goal to 100 % by 17:00 on Sunday. The iPhone app showed "100 % by 17:00 on Sun" and, under it, "Next: tomorrow 18:00".
The box plans a goal's clock (
ready_by_min,time_of_day_min) intime.Local. Whentime.Localis UTC, 17:00 is 17:00 UTC, which is 18:00 in Stockholm in winter. Core's DST handling is correct. The app hid the gap: it read a box zone of "UTC" as "the box names no zone" and showed the goal on the phone's clock. It did that because Core also says UTC when it is not:/etc/localtimetoEtc/UTC. A container that mounts the host's file (-v /etc/localtime:/etc/localtime:ro) overwritesEtc/UTCitself, so the link,/etc/timezoneand the file all sayEtc/UTCwhile Go runs on the host's rules. This is the open P2 on fix(core): name the box's time zone instead of "Local" #1585./etc/localtimewith no link and no/etc/timezonefell back toUTC.So clients cannot trust "UTC" today, and the app's guess is right only by luck.
Change
localzone.Name()returns a name only when that zone hastime.Local's rules:/etc/timezone) must show the same UTC offset astime.Localat every instant from 1970 to 2038.Etc/UTC./etc/localtimeis named by the regular Area/City file under the zoneinfo tree with the same bytes, else the first with the same rules. Links and posix/right are skipped.TZnow gives UTC, because Go runs on UTC then. Before, it named the host link's zone.Paired with srcfl/ftw-app#136. That PR makes the app trust "UTC" from the box and say the goal's time is UTC.
Evidence
New tests in
go/internal/localzone.TestAMountOverTheEtcUTCLinkIsNotUTCfails without the UTC check (zone = "Etc/UTC", want Europe/Stockholm). The copied-file tests fail without the zoneinfo match (zone = "UTC").A real run in
debian:trixie-slimwith tzdata (linux/arm64 under Docker Desktop), printing the name and 16:00Z on the local clock:Etc/UTC, 16:00 UTCEtc/UTC, 16:00 UTCEtc/UTC, 17:00 CETEurope/Berlin, 17:00 CETTZ=Europe/StockholmEurope/StockholmEurope/StockholmUTC, 17:00 CETEurope/Stockholm, 17:00 CETThe mounted file came from macOS's tzdata, so its bytes differ; it is named by rules, and Berlin is the first zone with Stockholm's rules since 1980. The tree walk took about 20 ms, once per process.
make verifypasses locally.Not in this PR
TZfor goals on their own clock.🤖 Generated with Claude Code