Skip to content
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

Replace unmaintained humantime crate with jiff #15290

Merged
merged 1 commit into from
Mar 10, 2025
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
38 changes: 28 additions & 10 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 @@ -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"
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/bin/cargo/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn setup_logger() -> Option<ChromeFlushGuard> {
.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
}

Expand Down
7 changes: 2 additions & 5 deletions src/cargo/core/compiler/fingerprint/dirty_reason.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/core/compiler/timings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down Expand Up @@ -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() {
Expand Down