Skip to content

Commit f90c823

Browse files
Merge pull request #679 from Mark-Simulacrum/better-caches
Avoid busting caches on path dependencies and fix CI
2 parents 8cce85a + 2bef3b0 commit f90c823

File tree

3 files changed

+164
-31
lines changed

3 files changed

+164
-31
lines changed

collector/benchmarks/script-servo-2/Cargo.lock

Lines changed: 144 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

collector/src/bin/rustc-perf-collector/execute.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ fn touch_all(path: &Path) -> anyhow::Result<()> {
2424
let mut cmd = Command::new("bash");
2525
cmd.current_dir(path)
2626
.args(&["-c", "find . -name '*.rs' | xargs touch"]);
27-
command_output(&mut cmd)?;
27+
command_output(&mut cmd).with_context(|| format!("touching all .rs in {:?}", path))?;
2828
// We also delete the cmake caches to avoid errors when moving directories around.
2929
// This might be a bit slower but at least things build
3030
let mut cmd = Command::new("bash");
3131
cmd.current_dir(path)
3232
.args(&["-c", "find . -name 'CMakeCache.txt' -delete"]);
33-
command_output(&mut cmd)?;
33+
command_output(&mut cmd).with_context(|| format!("deleting cmake caches in {:?}", path))?;
3434
Ok(())
3535
}
3636

@@ -308,7 +308,17 @@ impl<'a> CargoProcess<'a> {
308308

309309
log::debug!("{:?}", cmd);
310310

311-
touch_all(&self.cwd)?;
311+
// Touch all the files under the Cargo.toml of the manifest we're
312+
// benchmarking, so as to not refresh dependencies, which may be
313+
// in-tree (e.g., in the case of the servo crates there are a lot of
314+
// other components).
315+
touch_all(
316+
&self.cwd.join(
317+
Path::new(&self.manifest_path)
318+
.parent()
319+
.expect("manifest has parent"),
320+
),
321+
)?;
312322

313323
let output = command_output(&mut cmd)?;
314324
if let Some((ref mut processor, run_kind, run_kind_str, patch)) = self.processor_etc {
@@ -886,7 +896,7 @@ impl Benchmark {
886896
base_dot.push(".");
887897
let tmp_dir = TempDir::new()?;
888898
let mut cmd = Command::new("cp");
889-
cmd.arg("-LR").arg(base_dot).arg(tmp_dir.path());
899+
cmd.arg("-pLR").arg(base_dot).arg(tmp_dir.path());
890900
command_output(&mut cmd).with_context(|| format!("copying {} to tmp dir", self.name))?;
891901
Ok(tmp_dir)
892902
}

collector/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,12 @@ pub fn command_output(cmd: &mut Command) -> anyhow::Result<process::Output> {
489489
String::from_utf8_lossy(&output.stderr),
490490
String::from_utf8_lossy(&output.stdout)
491491
));
492+
} else {
493+
// log::trace!(
494+
// "stderr={}\n\nstdout={}",
495+
// String::from_utf8_lossy(&output.stderr),
496+
// String::from_utf8_lossy(&output.stdout),
497+
// );
492498
}
493499
Ok(output)
494500
}

0 commit comments

Comments
 (0)