Skip to content

Conversation

@baszalmstra
Copy link
Collaborator

Migrate from chrono to jiff which seems to be taking over.

The current opendal version still depends on chrono

This migration replaces the chrono crate with jiff for most datetime
operations across the rattler codebase. Key changes include:

- TimestampMs now wraps jiff::Timestamp instead of chrono::DateTime<Utc>
- ExcludeNewer uses jiff::Timestamp and jiff::civil::Date for parsing
- rattler_repodata_gateway Expiring struct uses jiff::Span for durations
- rattler_package_streaming uses jiff for zip DateTime creation
- py-rattler uses PyO3's jiff-02 feature for Python datetime interop
- js-rattler converts to/from js_sys::Date via milliseconds

Note: rattler_index still uses chrono for opendal compatibility since
opendal's Metadata API requires chrono::DateTime<Utc>.

Benefits of jiff:
- More ergonomic API (Span parsing from strings like "1 week")
- Better timezone handling
- Native ISO 8601 format (T separator, Z suffix)
- PyO3 integration via jiff-02 feature
- WASM/JS support via js feature
Resolved merge conflicts to maintain jiff usage while incorporating
main's new MinimumAgeConfig functionality:

- Updated MinimumAgeConfig to use jiff::Timestamp instead of chrono
- Replaced humantime::format_duration with jiff::Span::to_string()
- Added min_age parameter to solve functions alongside exclude_newer
Change RepodataFileMetadata and cache types to use jiff::Timestamp
instead of chrono::DateTime<Utc>. Chrono is now only used at the
opendal boundary for conversion, as opendal's Metadata API still
requires chrono types.
@baszalmstra baszalmstra requested a review from wolfv December 3, 2025 13:53
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.

3 participants