-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
date, touch: fix parse_datetime 0.13.0 compatibility (#8754) #8843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e1d88e3 to
4340913
Compare
|
GNU testsuite comparison: |
3371f17 to
3e1d11c
Compare
|
GNU testsuite comparison: |
3e1d11c to
da6ede1
Compare
|
GNU testsuite comparison: |
da6ede1 to
d55a0ee
Compare
|
GNU testsuite comparison: |
|
@naoNao89 ping ? :) |
Fixes uutils#8754 parse_datetime 0.13.0 fixes the bug where parsing large second values like "12345.123456789 seconds ago" would fail with "invalid date". However, parse_datetime 0.13.0 introduced a breaking API change: - Old (0.11.0): Returns chrono::DateTime - New (0.13.0): Returns jiff::Zoned This commit adapts both date and touch utilities to work with the new API: date.rs changes: - Simplified parse_date() to directly return jiff::Zoned - Removed unnecessary chrono -> jiff conversion code - parse_datetime now returns the exact type date utility uses - Added detailed comments explaining the API change and issue uutils#8754 touch.rs changes: - Added jiff::Zoned -> chrono::DateTime conversion in parse_date() - Changed from parse_datetime_at_date to parse_datetime - Marked ref_time parameter as unused (preserved for future use) - Added detailed comments about API change and future migration path Note: 3 integration tests fail due to timezone handling changes in parse_datetime 0.13. These are separate issues that will be addressed in follow-up commits.
…ates The previous implementation incorrectly used parse_datetime() instead of parse_datetime_at_date(), causing relative date strings like 'yesterday' or '2 days ago' to be calculated from the current system time instead of the caller-specified reference time. This fix: - Uses parse_datetime_at_date() with proper chrono->jiff->chrono conversions - Restores deterministic behavior for relative date parsing - Adds jiff 0.2.15 as direct dependency (not workspace) to avoid feature conflicts - Ensures tests/touch/relative passes in CI Note on jiff dependency: parse_datetime 0.13 depends on jiff ^0.2.15 with specific features. Adding jiff via workspace dependency causes feature unification conflicts across platforms. Using a direct dependency with version 0.2.15 resolves this while maintaining compatibility with parse_datetime's requirements.
d55a0ee to
980fc7f
Compare
CodSpeed Performance ReportMerging #8843 will degrade performances by 3.01%Comparing Summary
Benchmarks breakdown
Footnotes
|
a93985d to
149c7a6
Compare
|
GNU testsuite comparison: |
Fixes #8754
Problem
The
datecommand fails with "invalid date" when parsing large second values with nanoseconds: