Skip to content
Merged
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
9 changes: 8 additions & 1 deletion src/cargo/util/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::sync::Mutex;

use anyhow::Context as _;
use cargo_util::{paths, ProcessBuilder, ProcessError};
use filetime::FileTime;
use serde::{Deserialize, Serialize};
use tracing::{debug, info, warn};

Expand Down Expand Up @@ -329,7 +330,13 @@ fn rustc_fingerprint(
let path = paths::resolve_executable(path)?;
path.hash(hasher);

paths::mtime(&path)?.hash(hasher);
let meta = paths::metadata(&path)?;
meta.len().hash(hasher);

// Often created and modified are the same, but not all filesystems support the former,
// and distro reproducible builds may clamp the latter, so we try to use both.
FileTime::from_creation_time(&meta).hash(hasher);
FileTime::from_last_modification_time(&meta).hash(hasher);
Ok(())
};

Expand Down