Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

checklinks-rs

A faithful Rust port of upstream checklinks.awk — the IANA tzdb Zone/Link graph consistency checker. It verifies every Link resolves to a real Zone, names don't collide, links don't point at links (outside vanguard form), #= shortcut links agree with their targets, and (with backcheck) links live in the backward file. Diagnostics go to stdout with an exit status (0 = clean).

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

ziguard-rs    source-profile transform
zishrink-rs   compact-source emission
checktab-rs   table consistency checker
checklinks-rs Zone/Link graph consistency checker   <- this crate
zic-rs        compilation to TZif
zdump-rs      behaviour witness

checklinks-rs does not define tzdb policy or civil-time truth — it reproduces the upstream check.

Install / use

cargo install checklinks-rs
checklinks-rs --tzdb-dir .          # back.ck (source, backcheck=backward) + links.ck (tzdata.zi)
checklinks-rs --backcheck backward africa antarctica … backward
checklinks-rs tzdata.zi             # link-graph check of a compiled tzdata.zi

Correctness — how it's proven

The verdict (stdout + exit) matched against the real awk oracle:

  • Pinned 2026b (tests/oracle.rs): both back.ck and links.ck yield the pass verdict (exit 0, no output), byte-for-byte == awk -f checklinks.awk. Admitted source ffad46a0… + OpenPGP GOODSIG.
  • Negative fixtures (tests/cases.rs): 8 malformed-graph cases (link-to-nowhere, link-to-link, duplicate link/zone, link-same-name-as-zone, link-to-both, backcheck) — each reproduces awk's exact stdout and exit.
  • All IANA releases (reports/release-all/): across 48 signed bundles (2016g→2026b), checklinks-rs reproduces the 2026b-checklinks verdict set on every release tree (48/48, zero port bugs); 13 reproduce the release's own checklinks.awk byte-for-byte; 35 are check evolution.
  • Kani (reports/kani/): the field-index arithmetic is total. Fuzzing (reports/fuzz/): 399,849 runs, 0 crashes.
cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test

What this does and does not claim

It claims: to reproduce the 2026b checklinks.awk verdict (diagnostics + exit) for admitted releases, and byte-exact output where the upstream check is unchanged.

It does not claim: to define tzdb policy or civil-time truth, be a stricter checker, reproduce older releases' verdicts when the check differs, or that multi-issue END output matches gawk's hash order (the verdict set is identical; checklinks-rs sorts for determinism).

Zero runtime dependencies. #![forbid(unsafe_code)].

License

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

About

Faithful Rust port of IANA tzdb checklinks.awk — Zone/Link graph consistency checker (link-to-nowhere, link-to-link, name collisions, backward backcheck)

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages