From 0cab6ce1ecdf1cb500016973374d3ecb5693b199 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Mon, 16 Nov 2026 15:10:36 +0100 Subject: [PATCH 1/2] Bump jiff from 0.2.46 to 1.0.0 --- Cargo.lock | 74 ++++++++++++++++++++++++++++++++++++++++++++++-------- Cargo.toml | 2 +- 2 files changed, 64 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a73a3c5f..9abfc670 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -946,9 +946,25 @@ version = "0.2.46" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "175dc66334db3b9ab9985bf8b61cfed50dc16d20964bb47f9e479adcae984a7f" dependencies = [ - "jiff-core", - "jiff-static", - "jiff-tzdb-platform", + "jiff-core 0.1.8", + "jiff-static 0.2.46", + "jiff-tzdb-platform 0.1.3", + "log", + "portable-atomic", + "portable-atomic-util", + "serde_core", + "windows-link", +] + +[[package]] +name = "jiff" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cc767b5763de45e810109520123bb2829a653f3a7ed9be40b2bc4f81158f595" +dependencies = [ + "jiff-core 1.0.0", + "jiff-static 1.0.0", + "jiff-tzdb-platform 1.0.0", "log", "portable-atomic", "portable-atomic-util", @@ -965,31 +981,67 @@ dependencies = [ "log", ] +[[package]] +name = "jiff-core" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "894f7ac42105f584100691b3bf6e6b92dd12fcfa225f6c397f95c8a94b47b68f" +dependencies = [ + "log", +] + [[package]] name = "jiff-static" version = "0.2.46" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7b1af7547d47354bc438d797e3854601bde8f8d185780c5ba4ab27afa54f1ba" dependencies = [ - "jiff-core", + "jiff-core 0.1.8", "proc-macro2", "quote", "syn 2.0.119", ] +[[package]] +name = "jiff-static" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955491488dc99b572ea6d67b172dcd98787d00744b1fb44a5689b4e6413695a6" +dependencies = [ + "jiff-core 1.0.0", + "proc-macro2", + "quote", + "syn 3.0.3", +] + [[package]] name = "jiff-tzdb" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "142bd39932ad231f10513df9ab62661fead8719872150b7ad02a2df79f4e141e" +[[package]] +name = "jiff-tzdb" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12e71a1b68a875a44a33bb7a1dd84392cb77145a3367a552a3cfe6a4f5cf3afc" + [[package]] name = "jiff-tzdb-platform" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "875a5a69ac2bab1a891711cf5eccbec1ce0341ea805560dcd90b7a2e925132e8" dependencies = [ - "jiff-tzdb", + "jiff-tzdb 0.1.8", +] + +[[package]] +name = "jiff-tzdb-platform" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc65b284afcfa8f6cf189c7274c805505314a7ab975c60e1f548bff56525420e" +dependencies = [ + "jiff-tzdb 1.0.0", ] [[package]] @@ -1589,7 +1641,7 @@ dependencies = [ "clap_complete", "clap_mangen", "ctor", - "jiff", + "jiff 1.0.0", "phf 0.14.0", "phf_codegen 0.14.0", "pretty_assertions", @@ -2119,7 +2171,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.3.4", + "getrandom 0.4.3", "once_cell", "rustix", "windows-sys", @@ -2443,7 +2495,7 @@ name = "uu_hugetop" version = "0.0.1" dependencies = [ "clap", - "jiff", + "jiff 1.0.0", "tempfile", "uucore", ] @@ -2597,7 +2649,7 @@ version = "0.0.1" dependencies = [ "bytesize", "clap", - "jiff", + "jiff 1.0.0", "terminal_size", "uu_slabtop", "uucore", @@ -2608,7 +2660,7 @@ name = "uu_w" version = "0.0.1" dependencies = [ "clap", - "jiff", + "jiff 1.0.0", "uucore", ] @@ -2630,7 +2682,7 @@ dependencies = [ "dns-lookup", "fluent", "fluent-syntax", - "jiff", + "jiff 0.2.46", "libc", "nix 0.31.3", "os_display", diff --git a/Cargo.toml b/Cargo.toml index 2b5d57b1..46f7aa40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,7 +64,7 @@ clap_mangen = "0.3.0" crossterm = "0.29.0" ctor = "1.0.0" dirs = "7.0.0" -jiff = "0.2.15" +jiff = "1.0.0" nix = { version = "0.31", default-features = false, features = ["process"] } phf = "0.14.0" phf_codegen = "0.14.0" From e6546b38fa5dd6ad3fa28a899b99aaf51f628f36 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Mon, 16 Nov 2026 15:18:09 +0100 Subject: [PATCH 2/2] vmstat,w: adapt to API change in jiff --- src/uu/vmstat/src/picker.rs | 9 +++++++-- src/uu/w/src/w.rs | 12 ++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/uu/vmstat/src/picker.rs b/src/uu/vmstat/src/picker.rs index 6131e065..d75b624f 100644 --- a/src/uu/vmstat/src/picker.rs +++ b/src/uu/vmstat/src/picker.rs @@ -69,7 +69,10 @@ pub fn get_pickers(matches: &ArgMatches) -> Vec { pickers.push(concat_helper( ( "-----timestamp-----".into(), - format!("{:>19}", jiff::Zoned::now().strftime("%Z").to_string()), + format!( + "{:>19}", + jiff::ZonedDateTime::now().strftime("%Z").to_string() + ), ), get_timestamp, )); @@ -522,6 +525,8 @@ fn get_timestamp( ) -> Vec<(usize, String)> { vec![( 10, - jiff::Zoned::now().strftime("%Y-%m-%d %H:%M:%S").to_string(), + jiff::ZonedDateTime::now() + .strftime("%Y-%m-%d %H:%M:%S") + .to_string(), )] } diff --git a/src/uu/w/src/w.rs b/src/uu/w/src/w.rs index ddf3a40c..d2e21b1b 100644 --- a/src/uu/w/src/w.rs +++ b/src/uu/w/src/w.rs @@ -6,7 +6,7 @@ use clap::crate_version; use clap::{Arg, ArgAction, Command}; #[cfg(target_os = "linux")] -use jiff::Zoned; +use jiff::ZonedDateTime; #[cfg(target_os = "linux")] use std::{collections::HashMap, fs, path::Path, time::SystemTime}; use std::{process, time::Duration}; @@ -128,8 +128,8 @@ fn format_time(time: String) -> Result { t = t.drain(..time_offset).collect(); } // If login time day is not current day, format like Sat16, or Fri06 - let current_dt = Zoned::now(); - let dt = Zoned::strptime("%Y-%m-%d %H:%M:%S%.f %:z", &t)?; + let current_dt = ZonedDateTime::now(); + let dt = ZonedDateTime::strptime("%Y-%m-%d %H:%M:%S%.f %:z", &t)?; if current_dt.day() == dt.day() { Ok(dt.strftime("%H:%M").to_string()) } else { @@ -412,18 +412,18 @@ mod tests { fetch_cmdline, fetch_pcpu_time, fetch_terminal_number, format_time, format_time_elapsed, format_uptime_procps, get_clock_tick, }; - use jiff::{SignedDuration, Zoned}; + use jiff::{SignedDuration, ZonedDateTime}; use std::{fs, path::Path, process, time::Duration}; #[test] fn test_format_time() { - let unix_epoc = Zoned::now() + let unix_epoc = ZonedDateTime::now() .strftime("%Y-%m-%d %H:%M:%S%.6f %::z") .to_string(); let unix_formatted = format_time(unix_epoc).unwrap(); assert!(unix_formatted.contains(':') && unix_formatted.chars().count() == 5); // Test a date that is 5 days ago - let td = Zoned::now() - SignedDuration::from_secs(60 * 60 * 24 * 5); + let td = ZonedDateTime::now() - SignedDuration::from_secs(60 * 60 * 24 * 5); // Pre-format time, so it's similar to how utmpx returns it let pre_formatted = format!("{}", td.strftime("%Y-%m-%d %H:%M:%S%.6f %::z"));