Skip to content

infinityabundance/checktab-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

checktab-rs

A faithful Rust port of upstream checktab.awk — the IANA tzdb table consistency checker. It reads iso3166.tab and a zone table (zone.tab / zone1970.tab / zonenow.tab) plus the source files and emits diagnostics (to stdout / stderr) with an exit status (0 = clean, 1 = problems found).

It is the source-QA layer of the Rust tzdb toolchain:

ziguard-rs    source-profile transform   (-> main.zi)
zishrink-rs   compact-source emission     (-> tzdata.zi)
checktab-rs   table consistency checker   (source QA)        <- this crate
zic-rs        compilation to TZif
zdump-rs      behaviour witness

checktab-rs does not define timezone truth or replace IANA table policy — it reproduces the upstream check behaviour.

Install / use

cargo install checktab-rs

Tree-oriented (like the Makefile's tables.ck), or a single check:

checktab-rs --tzdb-dir .          # checks zone.tab + zone1970.tab + zonenow.tab in a tzdb tree
checktab-rs --zone-table zone1970.tab --iso3166 iso3166.tab africa antarctica asia … etcetera

Exit status is 1 if any problem was found, else 0; diagnostics go to stdout/stderr exactly as checktab.awk emits them.

Correctness — how it's proven

Not asserted from the code; it is the verdict (diagnostics + exit status) matched against the real awk oracle.

  • Pinned 2026b (tests/oracle.rs): every zone table yields the pass verdict (exit 0, no diagnostics), byte-for-byte == awk -f checktab.awk. Admitted source ffad46a0… + OpenPGP GOODSIG; checktab.awk e7d73e14….
  • Negative fixtures (tests/cases.rs): 9 malformed-table cases (unknown country code, bad coordinate, duplicate Zone, invalid/out-of-order/wrong-columns iso, no-data, tricky month + unused rule) — each reproduces the awk oracle's exact stdout, stderr, and exit.
  • All IANA releases (reports/release-all/): across 48 signed bundles (2016g→2026b), checktab-rs reproduces the 2026b-checktab verdict set on every release tree (48/48, zero port bugs); 21 reproduce the release's own checktab.awk byte-for-byte; 17 are check-set evolution; 10 differ only in END-loop line order (sorted vs gawk hash — same verdict set).
  • Kani (reports/kani/): the Link path-stripping loop terminates in bounds.
  • Fuzzing (reports/fuzz/): the checker over arbitrary table/source bytes, 0 crashes.
cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test   # the gate

What this does and does not claim

It claims: to reproduce the 2026b checktab.awk verdict (diagnostics + exit) for admitted releases, and the byte-exact output of each release's own checktab.awk where the check set is unchanged.

It does not claim: to define timezone truth, replace IANA table policy, or be a stricter checker; to reproduce older releases' verdicts when their check set differs; that multi-issue END-loop output matches gawk's hash order (the verdict set is identical, but checktab-rs sorts for determinism).

Single dependency: regex. The crate's own code is #![forbid(unsafe_code)].

License

Apache-2.0. Upstream checktab.awk is in the public domain (Paul Eggert); this is an independent Rust reimplementation.

About

Faithful Rust port of IANA tzdb checktab.awk — zone.tab / zone1970.tab / zonenow.tab consistency checker

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors