Skip to content

Commit 65edbd8

Browse files
committed
Don't touch rust files generated by build scripts
This confuses rustc-fake, which expects to only be run when profiled (on the code being timed, not on dependencies).
1 parent c3fb46f commit 65edbd8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

collector/src/execute.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ fn touch(root: &Path, path: &Path) -> anyhow::Result<()> {
5252

5353
fn touch_all(path: &Path) -> anyhow::Result<()> {
5454
let mut cmd = Command::new("bash");
55+
// Don't touch files in `target/`, since they're likely generated by build scripts and might be from a dependency.
5556
cmd.current_dir(path)
56-
.args(&["-c", "find . -name '*.rs' | xargs touch"]);
57+
.args(&["-c", "find . -path ./target -prune -false -o -name '*.rs' | xargs touch"]);
5758
command_output(&mut cmd).with_context(|| format!("touching all .rs in {:?}", path))?;
5859
// We also delete the cmake caches to avoid errors when moving directories around.
5960
// This might be a bit slower but at least things build

0 commit comments

Comments
 (0)