Skip to content

fix: local time comes from jiff; chrono is unmaintained (D566) - #120

Merged
lnorton89 merged 2 commits into
masterfrom
ccr-e60b5dc8-4b1ibl
Nov 26, 2026
Merged

lnorton89 merged 2 commits into
masterfrom
ccr-e60b5dc8-4b1ibl

Conversation

@lnorton89

Copy link
Copy Markdown
Owner

Summary

RUSTSEC-2026-0543 marks chrono unmaintained, every version, with no fixed release. Since then cargo-deny fails on every branch, master included, which is why #118 and #110 are red. Only our own code used chrono: the strobe_Date UTC offset (strobe-app/src/localtime.rs, D112) and the projector log's timestamps (strobe-projector/src/audit.rs). Both now use jiff, one of the replacements the advisory names. There's a maintained crate to move to, so I didn't add a deny.toml ignore (D530 keeps those for crates with no alternative).

  • Offset: TimeZone::system().to_offset(now).seconds(). now comes from Timestamp::try_from(SystemTime), so a clock jiff can't represent reads as offset 0 rather than panicking. It still runs only in LocalDate::refresh, never on the frame path.
  • Projector log: same %Y-%m-%dT%H:%M:%S%z format, so existing commands.log files keep one line shape.
  • Cost: Windows has no IANA database, so tzdb-bundle-platform embeds one in strobe.exe on Windows only, a few hundred KB. Without it every Windows machine would read as UTC. time, already in the tree through rosc, was ruled out because its local-offset call refuses in multithreaded processes on Unix. The reasoning is in D566.
  • THIRD_PARTY.md and DECISIONS_BY_AREA.md are regenerated. The projector README is updated. The workspace Cargo.toml comment cited D111 for chrono; it now cites D112, which is the right decision.

Test plan

Run in a Linux cloud container (no GPU, no real Windows machine):

  • cargo deny --all-features check: advisories ok, bans ok, licenses ok, sources ok.
  • cargo test -p strobe-app localtime: 4 passed, including the_system_offset_is_a_real_zone_offset_and_now_is_a_valid_date.
  • cargo test -p strobe-projector: all pass, including audit::tests::lines_are_one_record_each_and_rotate.
  • cargo clippy -p strobe-app -p strobe-projector --all-targets --all-features -- -D warnings: clean.
  • cargo clippy -p strobe-projector --all-targets --all-features --target x86_64-pc-windows-msvc -- -D warnings: clean. This compiles jiff's bundled database for Windows.
  • cargo test -p strobe-conventions: 59 passed.
  • cargo xtask decisions --check and cargo xtask credits --check: pass.
  • cargo fmt --all -- --check: clean.

Not run: the full cargo test --workspace and workspace-wide clippy (only the two crates that changed), and the Windows app build. QuickJS keeps strobe-app out of the cross-check, so CI's windows job is the first build of the app with jiff on Windows. Nobody has watched a Windows machine read its real zone through jiff yet.

Checklist

  • cargo fmt --all -- --check passes
  • cargo clippy … -D warnings passes (for the changed crates; CI runs the workspace)
  • cargo test passes (for the changed crates and the conventions tests; CI runs the workspace)
  • Windows cross-check for strobe-projector
  • No new unwrap / expect / panic!
  • No new files without the header banner (no new source files)
  • No new unsafe
  • No per-frame path changed (the lookup stays in refresh)
  • No visual or UI change
  • docs/ROADMAP.md not updated: this is a dependency swap, not a roadmap item. The decision is logged as D566.
  • Commit message uses fix:
  • CHANGELOG.md not hand-edited

Generated by Claude Code

RUSTSEC-2026-0543 marks chrono unmaintained with no fixed release, so
cargo-deny failed on every branch, master included. The strobe_Date
offset and the projector log's timestamps now come from jiff, which
bundles the zone database on Windows only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W2BaQir6MZbp4JBpp3CZyT
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @lnorton89's task in 12s —— View job


Review of PR #120

I read the diff against origin/master and found nothing to fix. I didn't build or run anything.

  • localtime.rs: Timestamp::try_from(SystemTime) falls back to offset 0 instead of panicking. The lookup stays inside LocalDate::refresh, so the per-frame path is unchanged. There is no unwrap, expect or unsafe.
  • audit.rs: %Y-%m-%dT%H:%M:%S%z renders in jiff as +0100, which matches chrono's old output, so existing commands.log lines keep their shape. If the clock can't be represented, the timestamp is empty but the line is still written. That is reasonable for an audit log.
  • Docs and conventions: D566 is added with a context, decision, cost and reopen condition. THIRD_PARTY.md and DECISIONS_BY_AREA.md were regenerated. CHANGELOG.md wasn't touched. The ROADMAP exemption makes sense for a dependency swap.
  • Features: tzdb-bundle-platform is Windows-only and tzdb-zoneinfo covers Unix, which matches the stated rationale.

The one thing the PR itself flags as open is the Windows app build. Check that CI's windows job passes. Then, on a real Windows machine, check that strobe_Date shows the local offset and not UTC.
· branch ccr-e60b5dc8-4b1ibl

@lnorton89
lnorton89 merged commit 901156c into master Nov 26, 2026
10 checks passed
@lnorton89
lnorton89 deleted the ccr-e60b5dc8-4b1ibl branch November 26, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants