Skip to content

refactor!: migrate from chrono to jiff (RUSTSEC-2026-0543) - #483

Merged
matrosov merged 2 commits into
mainfrom
refactor/migrate-chrono-to-jiff
Dec 2, 2026
Merged

matrosov merged 2 commits into
mainfrom
refactor/migrate-chrono-to-jiff

Conversation

@matrosov

@matrosov matrosov commented Dec 2, 2026

Copy link
Copy Markdown
Member

chrono is flagged unmaintained by RUSTSEC-2026-0543, filed by its own maintainer, with no fixed version. The advisory recommends jiff or time; this moves the crate to jiff 1.x, which clears the cargo-deny (advisories) failure.

Stacked on #482 (the url advisory fix); its commit is included here. Merge #482 first, or merge this one alone.

What changed

  • DateTime<Utc> → jiff::Timestamp, NaiveDate → jiff::civil::Date, across about 120 files (roughly half are tests).
  • New utils::time module with the few helpers needed on top of jiff: RFC 3339 text in the exact shapes existing output uses, UTC date access, and whole-day arithmetic. It has its own unit tests pinning those formats.
  • chrono removed from Cargo.toml and from the root and fuzz lockfiles. Nothing else in the tree depended on it.
  • Two day-offset additions on caller-supplied instants (CertificateProperties::is_expiring_soon_at, the EUCC expiry window) now saturate instead of panicking, because jiff's range ends at year 9999.

Breaking changes (need an Upgrade note in the next release)

  • Public API: 36 public fields and 10 public function signatures that exposed chrono types now expose jiff types. Callers construct values with jiff::Timestamp / jiff::civil::Date, or the helpers in sbom_tools::utils::time.
  • Serialized fractional seconds: timestamps serialized through serde keep the Z suffix, but the fraction is written with the shortest exact digits (.5Z) where chrono padded to 3, 6 or 9 (.500Z). Whole-second values are unchanged. Text produced through to_rfc3339* (emitted SBOMs, diff and report fields) is byte-identical to before.

Behaviour differences to be aware of

  • RFC 3339 parsing is jiff's: slightly more lenient than chrono (for example a space instead of T), and a leap second :60 is clamped to :59.
  • Supported range is years -9999 to 9999.

Verification

  • cargo test --locked --all-features: 3264 passed, 0 failed. cargo test --locked: 3224 passed, 0 failed. Snapshot and golden-report tests pass unchanged.
  • cargo clippy -- -D warnings and cargo clippy --all-features -- -D warnings clean; cargo fmt --check clean; cargo check --no-default-features --features ffi clean.
  • Not run locally: cargo-deny, cargo audit, the fuzz targets, the bindings jobs and non-macOS platforms. CI covers these.

🤖 Generated with Claude Code

Alex Matrosov and others added 2 commits December 1, 2026 23:31
url 2.5.8 overflows the stack in Url::origin() on deeply nested blob:
URLs. 2.5.9 requires form_urlencoded 1.2.3, so that moves with it.
Applied to the root and dagger/rust-sdk lockfiles.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
chrono is flagged unmaintained (RUSTSEC-2026-0543) with no fixed
version; its maintainer recommends jiff. Replace it throughout:

- DateTime<Utc> becomes jiff::Timestamp and NaiveDate becomes
  jiff::civil::Date, including in public model fields and signatures.
- New utils::time module holds the few helpers the crate needs on top
  of jiff: RFC 3339 text in the shapes existing output uses, UTC date
  access, and whole-day arithmetic.
- chrono is removed from Cargo.toml and from the root and fuzz
  lockfiles.

BREAKING CHANGE: public fields and functions that exposed chrono types
now expose jiff types. Serialized timestamps keep the Z suffix, but
fractional seconds are written with the shortest exact digits (.5Z)
where chrono padded to 3, 6 or 9 (.500Z).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@matrosov
matrosov merged commit fedaf3a into main Dec 2, 2026
49 of 50 checks passed
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.

1 participant