time: add IANA zoneinfo support#27832
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e432a0d57c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 04eca23fa0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 31662fb86c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Time.in, Time.location, and Time.zone
fallback loaders
of included by every time user
selected location
Review follow-ups
correctly: instant formats render UTC instants, while strftime renders the zoned wall clock.
unsupported errors for actual IANA location loading.
still has broader existing time/string/backend limitations, so IANA zone loading remains
unsupported there.
EST5EDT,M3.2.0,M11.1.0, instead of treatingevery non-Local TZ value as an IANA name.
local transitions are not limited to the precomputed year window.
and correct
M*.5.*last-weekday transitions.so host OS tzdata differences do not change assertions.
Time layout / checker note
Time.locas?Location, not?&Location.?&Locationwould maketime.Timea pointer-containing type. That triggers the existingchecker warning that map values containing pointers require
or {}outsideunsafe; CI runsseveral tool checks with
-W, so that warning becomes a broad unrelated failure in tools thatindirectly store
time.Timein map values.Timerepresentation should be handled separately, likely with a non-pointer locationhandle/intern table design, instead of changing checker semantics in this zoneinfo PR.
Windows notes and current limitations
rules.
Windows does not normally provide /usr/share/zoneinfo-style IANA files.
internal abbreviation table. Unlike Go, it does not yet scan the Windows time zone registry to
map localized names back to English Windows time zone keys, so Zone.name may be less precise on
non-English Windows installations. Offsets and local calendar conversion are derived from the
Windows API data.
environment. I did run a Windows frontend/type check for the Windows-specific code path.
Backend and API limitations
load_location support is currently limited to the C backend.
because embedded file and full time support are not available there yet.
./vnew -b native -check ...currently reports "The native backend hasbeen removed." I did not add a native-only zoneinfo stub because the backend is unavailable, and
the attempted native-suffix stubs are included by active backends and conflict with JS/C types.
hook. It currently does not provide synchronization for registering loaders concurrently with
load_location calls.
Validation
cmd/tools/vbuild-tools.v, cmd/tools/vtest-self.v
"The native backend has been removed."
WASM backend limitations such as string.runes, []u8.bytestr, error(), and strings.new_builder.
VFLAGS='-gc none -cc gcc': ./v -g -keepc -o ./vnew cmd/v
cmd/tools/vbuild-tools.v, cmd/tools/vtest-self.v