Skip to content

Commit c37c144

Browse files
Merge pull request #718 from Mark-Simulacrum/skip-double-touch
Avoid touching files if not running under a processor
2 parents 1d9288b + 86b07dc commit c37c144

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
@@ -313,26 +313,30 @@ impl<'a> CargoProcess<'a> {
313313
cmd.arg("--wrap-rustc-with");
314314
cmd.arg(profiler);
315315
cmd.args(&self.rustc_args);
316-
}
317316

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

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

338+
log::debug!("{:?}", cmd);
339+
336340
let output = command_output(&mut cmd)?;
337341
if let Some((ref mut processor, run_kind, run_kind_str, patch)) = self.processor_etc {
338342
let data = ProcessOutputData {

0 commit comments

Comments
 (0)