diff --git a/Cargo.lock b/Cargo.lock index 525a3e8e5a5..8219f61ef14 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -332,11 +332,11 @@ dependencies = [ "hmac", "home 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", "http-auth", - "humantime", "ignore", "im-rc", "indexmap", "itertools 0.14.0", + "jiff 0.2.3", "jobserver", "lazycell", "libc", @@ -1438,7 +1438,7 @@ checksum = "c57c477b645ee248b173bb1176b52dd528872f12c50375801a58aaf5ae91113f" dependencies = [ "bstr", "itoa 1.0.14", - "jiff", + "jiff 0.1.29", "thiserror 2.0.11", ] @@ -2174,12 +2174,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - [[package]] name = "icu_collections" version = "1.5.0" @@ -2435,6 +2429,30 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "jiff" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c163c633eb184a4ad2a5e7a5dacf12a58c830d717a7963563d4eceb4ced079f" +dependencies = [ + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde", +] + +[[package]] +name = "jiff-static" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc3e0019b0f5f43038cf46471b1312136f29e36f54436c6042c8f155fec8789" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + [[package]] name = "jiff-tzdb" version = "0.1.2" @@ -2533,7 +2551,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -4443,7 +4461,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index a105e28a0ec..4e342568aa2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,11 +55,11 @@ hex = "0.4.3" hmac = "0.12.1" home = "0.5.11" http-auth = { version = "0.1.10", default-features = false } -humantime = "2.1.0" ignore = "0.4.23" im-rc = "15.1.0" indexmap = "2.7.1" itertools = "0.14.0" +jiff = { version = "0.2.3", default-features = false, features = [ "std" ] } jobserver = "0.1.32" lazycell = "1.3.0" libc = "0.2.169" @@ -176,11 +176,11 @@ hex.workspace = true hmac.workspace = true home.workspace = true http-auth.workspace = true -humantime.workspace = true ignore.workspace = true im-rc.workspace = true indexmap.workspace = true itertools.workspace = true +jiff.workspace = true jobserver.workspace = true lazycell.workspace = true libgit2-sys.workspace = true diff --git a/src/bin/cargo/main.rs b/src/bin/cargo/main.rs index f103dffa45d..5af0bf013c3 100644 --- a/src/bin/cargo/main.rs +++ b/src/bin/cargo/main.rs @@ -79,7 +79,7 @@ fn setup_logger() -> Option { .with(fmt_layer) .with(profile_layer); registry.init(); - tracing::trace!(start = humantime::format_rfc3339(std::time::SystemTime::now()).to_string()); + tracing::trace!(start = jiff::Timestamp::now().to_string()); profile_guard } diff --git a/src/cargo/core/compiler/fingerprint/dirty_reason.rs b/src/cargo/core/compiler/fingerprint/dirty_reason.rs index 6881f72a837..4ea3a1a6edb 100644 --- a/src/cargo/core/compiler/fingerprint/dirty_reason.rs +++ b/src/cargo/core/compiler/fingerprint/dirty_reason.rs @@ -102,12 +102,9 @@ impl fmt::Display for FileTimeDiff { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let s_diff = self.new_time.seconds() - self.old_time.seconds(); if s_diff >= 1 { - fmt::Display::fmt( - &humantime::Duration::from(std::time::Duration::from_secs(s_diff as u64)), - f, - ) + write!(f, "{:#}", jiff::SignedDuration::from_secs(s_diff)) } else { - // format nanoseconds as it is, humantime would display ms, us and ns + // format nanoseconds as it is, jiff would display ms, us and ns let ns_diff = self.new_time.nanoseconds() - self.old_time.nanoseconds(); write!(f, "{ns_diff}ns") } diff --git a/src/cargo/core/compiler/timings.rs b/src/cargo/core/compiler/timings.rs index ec6e7741e31..53b3fedd608 100644 --- a/src/cargo/core/compiler/timings.rs +++ b/src/cargo/core/compiler/timings.rs @@ -15,7 +15,7 @@ use cargo_util::paths; use std::collections::HashMap; use std::io::{BufWriter, Write}; use std::thread::available_parallelism; -use std::time::{Duration, Instant, SystemTime}; +use std::time::{Duration, Instant}; /// Tracking information for the entire build. /// @@ -117,7 +117,7 @@ impl<'gctx> Timings<'gctx> { (pkg_desc, targets) }) .collect(); - let start_str = humantime::format_rfc3339_seconds(SystemTime::now()).to_string(); + let start_str = jiff::Timestamp::now().to_string(); let profile = bcx.build_config.requested_profile.to_string(); let last_cpu_state = if enabled { match State::current() {