Repository navigation
fix(base): ship the IANA timezone database in every box - #804
Conversation
Add a tzdata package that compiles the IANA tzdata release with zic into usr/share/zoneinfo, and add it to base's runtime_deps. Without it, TZ=Area/City silently falls back to UTC and Python's zoneinfo cannot resolve any zone. /etc/localtime stays unset, so the default remains UTC. Refs gominimal/inbox#844
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (5)
Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour. 📝 WalkthroughWalkthroughAdds a tzdata package that builds zoneinfo data. The base package depends on it. Tcl configuration enables tzdata, and a Python smoke test constructs a ChangesTimezone data support
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The timezone-data change is mergeable after normal checks; the remaining test suggestion does not establish a material risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Tcl's configure autodetects /usr/share/zoneinfo and skips installing its own zone data when it finds one. With tzdata in base, the tzdata output glob matched nothing and the build failed. Pass --with-tzdata so the output stays populated regardless of the build environment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AkfcXf7j7iRngh4dKjye3f
46dc9f3 to
f99bdf8
Compare
gominimal/pkgs#804 adds tzdata to base, so boxes resolve TZ=Area/City and Python's zoneinfo finds its zones.
…minimal#1962) * build: bump the pkgs locked_commit for the guest kernel's conntrack marks Picks up gominimal/pkgs#803, which enables CONFIG_NF_CONNTRACK_MARK in the virtio-linux guest kernel. The guest classifier table's ct mark rule needs it (T75, gominimal#1886). One pkgs commit; the only file it changes is packages/virtio-linux/build.sh. * build: bump the pkgs locked_commit for the timezone database in base gominimal/pkgs#804 adds tzdata to base, so boxes resolve TZ=Area/City and Python's zoneinfo finds its zones.
…inimal#815) pkgmgr flagged tzdata (new in gominimal#804) as a MONITORING GAP: no source_provenance and no curated CPE, so its 0/0/0 was indistinguishable from "cannot check". A CPE cannot fix it: NVD's CPE dictionary has no entry for the tz database under any vendor, and every tz-ish CPE in our vulndb is a false friend (SonicWall TZ firewalls, moment-timezone, ...). eggert/tz is the tz project's own repository; its tags match our version scheme (2026e). The download stays on data.iana.org; provenance only drives advisory and version lookups. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Problem
Boxes have no timezone database.
/usr/share/zoneinfodoes not exist, so:TZ=America/Vancouver datesilently prints UTC, labelledAmerica.zoneinfo.ZoneInfo("America/Vancouver")raisesZoneInfoNotFoundError.tzdatais not found by a package search either.Change
packages/tzdata. It fetches the IANAtzdata2026erelease, pinned by sha256, and compiles it with glibc'szic(-b slim) intousr/share/zoneinfo. It compiles the same sources that upstream's Makefile builds by default: the primary regions plusetceteraandbackward. It also installsiso3166.tab,zone.tabandzone1970.tab, the tables thattzselectand Python'szoneinforead. The license isLicenseRef-Public-Domain, the repo's existing convention for public-domain data.bash-bootstrap,coreutilsandglibc(forzic), notbase.basenow carries tzdata at runtime, so building tzdata againstbasewould create a cycle.data.iana.orgdirectly. Theminimal-staging-archivesmirror does not carry a tzdata tarball yet. If you prefer the mirror, uploadtzdata2026e.tar.gz(sha256b26882805f26aac59d5b222978e6580484b834ccdc98be89df2f05a6dc53a652) and swap the URL.baseruntime_depsgainstzdata, so every box resolvesTZ=Area/Cityand Python'szoneinfoworks without extra packages.tclconfigure gains--with-tzdata. Tcl's configure skips installing its bundled zone data when it finds/usr/share/zoneinfo/UTC, whichbasenow provides. Without the flag, thetzdataoutput glob (usr/lib/tcl*/tzdata/**) matched nothing and the build failed on both arches. The flag keeps tcl's outputs unchanged./etc/localtimestays unset, so the default is still UTC. Users opt in withTZ.tzdatastandalone test checks that/usr/share/zoneinfo/UTCexists, thatTZ=America/Vancouver date +%ZprintsPSTorPDT, and that Paris is UTC+1 at the epoch.pythonstandalone test (test_deps = [base]) checks thatzoneinfo.ZoneInfo('Europe/Paris')resolves.Size impact
The compiled tree is 600 files totalling 379 KiB of data (
du --apparent-size). On a 4 KiB-block filesystem it allocates about 2.5 MiB, because most zone files are around 1 KiB. Backward-compatibility names such asUS/Pacificare hard links to the canonical zone, not copies. The fetched tarball is 471 KiB.For scale, a default session's
/usrmeasures about 508 MiB withdu --apparent-sizeon the same VM. tzdata adds under 0.1% of that by apparent size, or about 0.5% allocated.Rebuild cost:
baseis a build dep of about 450 packages, so this change re-keys all of them.Test plan
Run on an arm64 Minimal VM (macOS host), in sessions synced from this branch:
min check --packages tzdata,base,python: every check passes. After the build, the output checks (enumerate bins,output types valid,missing runtime_deps) also pass for tzdata.min package patched-build tzdataandmin package patched-build basesucceed.main):TZ=America/Vancouver date +%ZprintsAmerica, and/usr/share/zoneinfois missing.TZ=America/Vancouver date +%ZprintsPDT,TZ=Europe/Paris date -d @0 +%Hprints01, and/usr/share/zoneinfo/UTCexists.pythonadded:zoneinfo.ZoneInfo("Europe/Paris")resolves (UTC offset2:00:00on 2026-07-01), andzoneinfo.available_timezones()returns 597 zones.testsblocks themselves (there's no in-session test runner), amd64, and a two-build byte-reproducibility diff.zicoutput has no timestamps, but CI is the first run of all three.tclwith--with-tzdata: not built locally; CI'sminimal buildpasses.Refs gominimal/inbox#844