Skip to content

Commit 3e50d2d

Browse files
committed
Change a cp command.
The existing command used is `cp -r -T -- src_dir dst_dir`. But -T doesn't work on Mac. This commit changes it to `cp -r src_dir/. dst_dir`. - Appending the `.` has the same effect as -T: copy the contents of `src_dir` without copy `src_dir` itself. - Also, -R is POSIX but -r is not.
1 parent 5de3228 commit 3e50d2d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,12 +577,14 @@ impl Benchmark {
577577
}
578578

579579
fn make_temp_dir(&self, base: &Path) -> Result<TempDir, Error> {
580+
// Appending `.` means we copy just the contents of `base` into
581+
// `tmp_dir`, rather than `base` itself.
582+
let mut base_dot = base.to_path_buf();
583+
base_dot.push(".");
580584
let tmp_dir = TempDir::new()?;
581585
let mut cmd = Command::new("cp");
582-
cmd.arg("-r")
583-
.arg("-T")
584-
.arg("--")
585-
.arg(base)
586+
cmd.arg("-R")
587+
.arg(base_dot)
586588
.arg(tmp_dir.path());
587589
command_output(&mut cmd).with_context(|_| format!("copying {} to tmp dir", self.name))?;
588590
Ok(tmp_dir)

0 commit comments

Comments
 (0)