Skip to content

Commit 387dc06

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 1aee38b commit 387dc06

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

collector/src/execute.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ fn touch(root: &Path, path: &Path) -> anyhow::Result<()> {
5353

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

0 commit comments

Comments
 (0)