Skip to content

Commit c5c5579

Browse files
Avoid touching files if not running under a processor
1 parent a2cc824 commit c5c5579

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

collector/src/execute.rs

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -317,26 +317,30 @@ impl<'a> CargoProcess<'a> {
317317
cmd.arg("--wrap-rustc-with");
318318
cmd.arg(profiler);
319319
cmd.args(&self.rustc_args);
320-
}
321320

322-
log::debug!("{:?}", cmd);
321+
// If we're not going to be in a processor, then there's no
322+
// point ensuring that we recompile anything -- that just wastes
323+
// time.
323324

324-
// Touch all the files under the Cargo.toml of the manifest we're
325-
// benchmarking, so as to not refresh dependencies, which may be
326-
// in-tree (e.g., in the case of the servo crates there are a lot of
327-
// other components).
328-
if let Some(file) = &self.touch_file {
329-
touch(&self.cwd, Path::new(&file))?;
330-
} else {
331-
touch_all(
332-
&self.cwd.join(
333-
Path::new(&self.manifest_path)
334-
.parent()
335-
.expect("manifest has parent"),
336-
),
337-
)?;
325+
// Touch all the files under the Cargo.toml of the manifest we're
326+
// benchmarking, so as to not refresh dependencies, which may be
327+
// in-tree (e.g., in the case of the servo crates there are a lot of
328+
// other components).
329+
if let Some(file) = &self.touch_file {
330+
touch(&self.cwd, Path::new(&file))?;
331+
} else {
332+
touch_all(
333+
&self.cwd.join(
334+
Path::new(&self.manifest_path)
335+
.parent()
336+
.expect("manifest has parent"),
337+
),
338+
)?;
339+
}
338340
}
339341

342+
log::debug!("{:?}", cmd);
343+
340344
let output = command_output(&mut cmd)?;
341345
if let Some((ref mut processor, run_kind, run_kind_str, patch)) = self.processor_etc {
342346
let data = ProcessOutputData {

0 commit comments

Comments
 (0)