Today a user handled me a rar archive (from a windows machine) with a Cargo package. When I extracted it on my linux machine, I've noticed that cargo build always rebuilds the project, instead of doing zero builds. Looks like the problem is that extracted files miss mtimes, so we always rebulid in here:
|
let should_rebuild = match (*on_disk_mtime, *previously_built_mtime) { |
|
(None, None) => false, |
|
(Some(_), None) | (None, Some(_)) => true, |
Seems like a niche use case, and I am not sure how to fix it properly (touching files seems inappropriate?), but lets log the issue anyways!
Today a user handled me a
rararchive (from a windows machine) with a Cargo package. When I extracted it on my linux machine, I've noticed thatcargo buildalways rebuilds the project, instead of doing zero builds. Looks like the problem is that extracted files missmtimes, so we always rebulid in here:cargo/src/cargo/ops/cargo_rustc/fingerprint.rs
Lines 250 to 252 in f46d485
Seems like a niche use case, and I am not sure how to fix it properly (touching files seems inappropriate?), but lets log the issue anyways!