Skip to content

Avoid busting caches on path dependencies #679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
171 changes: 144 additions & 27 deletions collector/benchmarks/script-servo-2/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions collector/src/bin/rustc-perf-collector/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ fn touch_all(path: &Path) -> anyhow::Result<()> {
let mut cmd = Command::new("bash");
cmd.current_dir(path)
.args(&["-c", "find . -name '*.rs' | xargs touch"]);
command_output(&mut cmd)?;
command_output(&mut cmd).with_context(|| format!("touching all .rs in {:?}", path))?;
// We also delete the cmake caches to avoid errors when moving directories around.
// This might be a bit slower but at least things build
let mut cmd = Command::new("bash");
cmd.current_dir(path)
.args(&["-c", "find . -name 'CMakeCache.txt' -delete"]);
command_output(&mut cmd)?;
command_output(&mut cmd).with_context(|| format!("deleting cmake caches in {:?}", path))?;
Ok(())
}

Expand Down Expand Up @@ -308,7 +308,17 @@ impl<'a> CargoProcess<'a> {

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

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

let output = command_output(&mut cmd)?;
if let Some((ref mut processor, run_kind, run_kind_str, patch)) = self.processor_etc {
Expand Down Expand Up @@ -886,7 +896,7 @@ impl Benchmark {
base_dot.push(".");
let tmp_dir = TempDir::new()?;
let mut cmd = Command::new("cp");
cmd.arg("-LR").arg(base_dot).arg(tmp_dir.path());
cmd.arg("-pLR").arg(base_dot).arg(tmp_dir.path());
command_output(&mut cmd).with_context(|| format!("copying {} to tmp dir", self.name))?;
Ok(tmp_dir)
}
Expand Down
6 changes: 6 additions & 0 deletions collector/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,12 @@ pub fn command_output(cmd: &mut Command) -> anyhow::Result<process::Output> {
String::from_utf8_lossy(&output.stderr),
String::from_utf8_lossy(&output.stdout)
));
} else {
// log::trace!(
// "stderr={}\n\nstdout={}",
// String::from_utf8_lossy(&output.stderr),
// String::from_utf8_lossy(&output.stdout),
// );
}
Ok(output)
}