Repository navigation
Add SystemDateTimeZoneSource: time zones from the platform's own database - #63
jeremy-morren wants to merge 3 commits into
Conversation
22db59d to
4178823
Compare
|
@cursor review |
| @@ -0,0 +1,2 @@ | |||
| # Apps that only CI uses (see their READMEs); not part of the published package. | |||
| * | |||
There was a problem hiding this comment.
Nested pubignore does not exclude test apps
Medium Severity
A .pubignore under test_apps/ does not affect dart pub publish. Pub only reads .pubignore at the package root, so the CI-only Flutter app (Android/iOS projects included) can still ship in the published package.
Reviewed by Cursor Bugbot for commit 4178823. Configure here.
There was a problem hiding this comment.
Not a bug. Pub reads .pubignore (and .gitignore) in every directory, not only at the package root. dart pub publish --dry-run lists no files under test_apps/.
| case "$(readlink /etc/localtime)" in | ||
| */zoneinfo/"$TIME_ZONE") ;; | ||
| *) echo "::error::/etc/localtime doesn't point at $TIME_ZONE"; exit 1 ;; | ||
| esac |
There was a problem hiding this comment.
iOS tests set host timezone only
Medium Severity
The iOS job rewrites the Mac's /etc/localtime and then expects the Simulator app to report Australia/Sydney. That app reads timezone files inside the Simulator, and readUnixTimeZoneId never special-cases iOS, so the host symlink does not drive systemDefaultId.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 4178823. Configure here.
There was a problem hiding this comment.
Not a bug. Simulator apps read the Mac's /etc/localtime. In our Azure Pipelines run of this job, the Mac was set to Australia/Sydney the same way, and "systemDefaultId is the configured system time zone" passed with TIME_MACHINE_EXPECT_SYSTEM_TIME_ZONE=Australia/Sydney.
4178823 to
b1401df
Compare
|
@cursor review |
| # Push runs would otherwise also comment on the branch's pull request. | ||
| comment_mode: ${{ github.event_name == 'pull_request' && 'always' || 'off' }} | ||
| # Show a failure on each platform, not only on the first one. | ||
| report_individual_runs: true |
There was a problem hiding this comment.
Fork PRs fail the Report job
Medium Severity
The Report job's Test Results publish step always creates a check run and, on pull requests, a comment. Fork PRs still receive a read-only token, so those API calls fail and the Report job fails even when tests passed. The iOS publish step and the coverage comment already skip forks; this step does not, despite the nearby comment saying forks only get the job summary.
Reviewed by Cursor Bugbot for commit b1401df. Configure here.
There was a problem hiding this comment.
Not a bug. EnricoMi/publish-unit-test-result-action detects pull_request events from forks and skips the check run and PR comment itself ("Pull request comments and check runs cannot be created, so disabling these features"). It writes only the job summary, as the workflow comment says.
…luding non-English) On Windows, DateTimeZone.local was UTC on most systems: detection matched DateTime.timeZoneName (a Windows display name, localized on non-English Windows) against a hard-coded table of English names, and fell back to UTC. Six tests failed on Windows machines outside UTC as a result. Local zone detection now follows Noda Time, which maps .NET's TimeZoneInfo.Local.Id: - Windows: the Windows zone ID from GetDynamicTimeZoneInformation (via dart:ffi), mapped with CLDR data embedded in tzdb.bin. The ID is the same in every display language. With automatic DST adjustment turned off, the guess below is used instead. - Linux/macOS: the IANA ID found as .NET finds it: TZ (empty means UTC, ':' prefix ignored, absolute paths are zoneinfo files), else the /etc/localtime symlink target, else the zoneinfo file with the same contents. Android: persist.sys.timezone. - TZ on Windows follows Python's tzlocal and Node.js (.NET and Noda Time ignore it): an IANA ID, a Windows zone ID (mapped with CLDR) or a path to a zone file is used; empty or unrecognised values (e.g. POSIX rules) leave Windows' own zone. - Otherwise: a port of Noda Time's guess by transitions, then a fixed zone at the current offset (no longer UTC). On Windows with automatic DST adjustment off, the guess uses the zone's standard offset as Windows reports it, not Dart's DateTime (whose C runtime applies TZ). The abbreviation heuristic and its hard-coded name table are removed. Embedded CLDR Windows mapping (enabling the existing compiler port): - Check in CLDR windowsZones.xml for every version Noda Time has (21 to 49), from unicode-org/cldr release tags; the compiler picks the newest suitable file and validates it against the TZDB data. - Fix the ported CLDR parser (root element, otherVersion, splitting IDs, version from the file name) and MergeWindowsZones (identity-keyed map). - NameIdMappingSupport: Russia TZ 3/10/11 and Türkiye. Public API matching Noda Time's TzdbDateTimeZoneSource: defaultSource, tzdbVersion, canonicalIdMap, aliases, windowsMapping, windowsToTzdbIds, tzdbToWindowsIds and validate(); MapZone and WindowsZones are exported. Tests: ports of Noda Time's TzdbDateTimeZoneSourceTest, MapZoneTest, WindowsZonesTest, CldrWindowsZonesParserTest, NameIdMappingSupportTest and ProgramTest; Windows registry and local zone tests; Unix and TZ behaviour tests (including child processes with TZ set). Also: version 0.15.0 (0.14.0 is already published), with a CHANGELOG entry; require archive ^4.6.0 (XZDecoder); NOTICE references Noda Time 3.3.0, copyright to 2026. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b1401df to
e2b76db
Compare
|
@cursor review |
e2b76db to
94ad757
Compare
|
@cursor review |
6732881 to
94ad757
Compare
…ndows; publish test results and coverage CI only ran on Ubuntu in UTC, so it never saw platform-specific local time zone problems (such as Windows detecting UTC). Matrix legs: - Ubuntu: the /etc/localtime symlink. - Ubuntu with TZ=Australia/Sydney: the TZ environment variable, with DST. - Windows (English): the Windows zone ID mapped with CLDR, in AUS Eastern Standard Time (with DST). - Windows (non-English): W. Europe Standard Time with German display names, as on German Windows. GitHub has no non-English runners and language packs can't be installed on them in reasonable time, so the zone's display names are set with SetDynamicTimeZoneInformation; the zone ID stays English, exactly as on localized Windows. A guard test (TIME_MACHINE_EXPECT_LOCALIZED_WINDOWS=1) fails the leg if Dart doesn't report the localized names. - macOS is paused: GitHub's macOS arm64 runners are at capacity. Also runs the TZDB compiler's tests and validates the package on every leg, and publishes results with existing actions: - Each leg collects LCOV coverage (lib/ only) and JSON test results, writes a coverage summary to its job summary (ReportGenerator) and uploads them as an artifact. - A final job combines all legs: EnricoMi/publish-unit-test-result-action publishes a job summary, a "Test Results" check run and one PR comment for all platforms; ReportGenerator merges coverage into a job summary and an HTML artifact, posted as one PR comment (marocchino/sticky-pull-request-comment). Both comments are updated in place. Fork PRs get the job summaries only (read-only token). - Runs on pull requests as well as pushes. A pana job checks pub.dev platform support: it fails if pana stops reporting any of the tags for everywhere Dart runs (the six platforms, native AOT/JIT and web runtimes, WebAssembly, Dart and Flutter SDKs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
94ad757 to
f5a0ba2
Compare
|
@cursor review |
…base The equivalent of Noda Time's BclDateTimeZoneSource (.NET's TimeZoneInfo), exposed as DateTimeZoneProviders.system. It never falls back to the embedded TZDB data: on a platform without time zone data it throws UnsupportedError, and unknown IDs throw DateTimeZoneNotFoundError. Use DateTimeZoneProviders.tzdb for data on every platform. Backends, chosen by conditional import: - Windows (dart:ffi): zone IDs from EnumDynamicTimeZoneInformation, rules for each year from GetTimeZoneInformationForYear, converted the way Noda Time converts adjustment rules (with fixes for rule boundaries at New Year and Windows' start-of-year marker transitions). Matches SystemTimeToTzSpecificLocalTimeEx for all 144 zones at ~1M instants. forId and the provider also accept IANA IDs, as .NET 6+ does: mapped to a Windows zone with Windows' own ICU (icu.dll), with the requested ID. getIds lists only Windows IDs. - Linux, macOS, iOS: TZif v1-v4 files in $TZDIR or /usr/share/zoneinfo, including the POSIX TZ footer. Matches zdump for every zone. - Android: the system tzdata bundle (APEX or /system), reusing the TZif parser. The system default follows TZ as DateTimeZone.local does, so both pick the same zone: on Linux and macOS by .NET's rules; on Windows (as Python's tzlocal and Node.js) a Windows zone ID, or an IANA ID mapped to a Windows zone with Windows' own ICU (icu.dll, as .NET does), with empty or unrecognised values leaving Windows' own zone. - Web (JS and WASM, dart:js_interop): the browser's Intl data; offsets from Intl.DateTimeFormat, transitions from Temporal when available or else by search; the standard/daylight split is inferred. Tests: unit tests for the Windows rule conversion, TZif, the POSIX footer and the Android bundle, comparisons against the OS (Windows) and zdump (Linux), and shared checks (test/system_source) that run on the VM, in Chrome (dart2js and dart2wasm), in Node, and on Android and iOS through a Flutter integration test app (test_apps/system_source_flutter). CI: web legs (Chrome JS, Chrome WASM, Node), Android emulators (API 35 with the APEX tzdata, API 28 with /system tzdata) and an iOS Simulator job; web and Android results are included in the combined report. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f5a0ba2 to
8207100
Compare
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
3 issues from previous reviews remain unresolved.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 8207100. Configure here.


Add SystemDateTimeZoneSource: time zones from the platform's own database
DateTimeZoneProviders.systemis the equivalent of Noda Time'sBclDateTimeZoneSource:/usr/share/zoneinfo)IntlUnsupportedError, and unknown IDs throwDateTimeZoneNotFoundError.TZasDateTimeZone.localdoes. On Windows, IANA IDs are mapped with Windows' ICU.provider['Australia/Sydney']maps toAUS Eastern Standard Timethrough Windows' ICU and keeps the requested ID.idslists only Windows IDs.Verified:
zdumpfor every Linux zone.🤖 Generated with Claude Code