Skip to content

Commit 8df842f

Browse files
committed
Purge mtime information from Fingerprint
This has proven to be a very unreliable piece of information to hash, so let's not! Instead we track what files are supposed to be relative to, and we check both mtimes when necessary.
1 parent e9428cb commit 8df842f

File tree

7 files changed

+269
-171
lines changed

7 files changed

+269
-171
lines changed

src/cargo/core/compiler/context/compilation_files.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,13 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
166166
}
167167
}
168168

169-
/// Returns the root of the build output tree.
169+
/// Returns the root of the build output tree for the target
170170
pub fn target_root(&self) -> &Path {
171+
self.target.as_ref().unwrap_or(&self.host).dest()
172+
}
173+
174+
/// Returns the root of the build output tree for the host
175+
pub fn host_root(&self) -> &Path {
171176
self.host.dest()
172177
}
173178

src/cargo/core/compiler/custom_build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ fn build_work<'a, 'cfg>(cx: &mut Context<'a, 'cfg>, unit: &Unit<'a>) -> CargoRes
235235
let output_file = script_run_dir.join("output");
236236
let err_file = script_run_dir.join("stderr");
237237
let root_output_file = script_run_dir.join("root-output");
238-
let host_target_root = cx.files().target_root().to_path_buf();
238+
let host_target_root = cx.files().host_root().to_path_buf();
239239
let all = (
240240
id,
241241
pkg_name.clone(),

0 commit comments

Comments
 (0)