Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ uucore = "0.13"
thiserror = "2"

# Dates
parse_datetime = "0.17"
jiff = { version = "0.2", default-features = false, features = ["std"] }
parse_datetime = "0.18"
jiff = { version = "1", default-features = false, features = ["std"] }

# Unix/Linux
rustix = { version = "1", features = ["event", "fs", "param", "process", "pty", "rand", "termios"] }
Expand Down
8 changes: 8 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
".github/workflows/release.yml"
],
"enabled": false
},
{
"description": "parse_datetime's public API takes and returns jiff types, so each parse_datetime release requires one jiff major. Updated apart, each pull request fails: the new parse_datetime cannot build against the old jiff, and the new jiff alone leaves two jiff majors, which deny.toml forbids.",
"matchPackageNames": [
"jiff",
"parse_datetime"
],
"groupName": "jiff and parse_datetime"
}
],
"customManagers": [
Expand Down
7 changes: 4 additions & 3 deletions src/shadow-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ path = "src/lib.rs"

[dependencies]
clap = { workspace = true }
# `Zoned::now()` reads the local zone: `tz-system` reads TZ and /etc/localtime,
# and `tzdb-zoneinfo` resolves a zone name such as TZ=Europe/Paris against
# /usr/share/zoneinfo. Without them the zone silently behaves as UTC.
# `ZonedDateTime::now()` reads the local zone: `tz-system` reads TZ and
# /etc/localtime, and `tzdb-zoneinfo` resolves a zone name such as
# TZ=Europe/Paris against /usr/share/zoneinfo. Without them the zone silently
# behaves as UTC.
jiff = { workspace = true, features = ["tz-system", "tzdb-zoneinfo"] }
libc = { workspace = true }
parse_datetime = { workspace = true }
Expand Down
6 changes: 3 additions & 3 deletions src/shadow-core/src/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub fn parse_expire_date(s: &str) -> Result<Option<i64>, ShadowError> {
.bytes()
.all(|b| b.is_ascii_digit() || b == b'-' || b == b'+')
{
return parse_free_form_date(s, jiff::Zoned::now());
return parse_free_form_date(s, jiff::ZonedDateTime::now());
}

// A bare integer is already days since the epoch.
Expand Down Expand Up @@ -122,7 +122,7 @@ pub fn parse_expire_date(s: &str) -> Result<Option<i64>, ShadowError> {
/// and return its day number. The time of day is dropped: the field holds a
/// day. Relative forms such as `tomorrow` count from `now`, which the caller
/// reads once so that every relative form is resolved against one instant.
fn parse_free_form_date(s: &str, now: jiff::Zoned) -> Result<Option<i64>, ShadowError> {
fn parse_free_form_date(s: &str, now: jiff::ZonedDateTime) -> Result<Option<i64>, ShadowError> {
let invalid = || ShadowError::Validation(format!("invalid date '{s}'").into());

let zoned = parse_datetime::parse_datetime_at_date(now, s)
Expand Down Expand Up @@ -287,7 +287,7 @@ mod tests {
// the clock again, or kept the time of day, land on the wrong day.
let now = jiff::civil::date(2030, 1, 2)
.at(23, 59, 59, 0)
.to_zoned(jiff::tz::TimeZone::UTC)
.to_zoned_datetime(jiff::tz::TimeZone::UTC)
.unwrap();
// 2030-01-02 is day 21916.
for (form, day) in [
Expand Down