Skip to content

Commit 39d79c2

Browse files
committed
Fix unix build
1 parent 652b257 commit 39d79c2

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

collector/src/execute.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use crate::{BuildKind, Compiler, RunKind};
44
use anyhow::{anyhow, bail, Context};
5-
use collector::{command_output, robocopy};
5+
use collector::command_output;
66
use database::{PatchName, QueryLabel};
77
use futures::stream::FuturesUnordered;
88
use futures::stream::StreamExt;
@@ -33,7 +33,7 @@ fn rename<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> anyhow::Result<()>
3333
return Ok(fs::rename(from, to).with_context(|| ctx.clone())?);
3434
}
3535

36-
robocopy(from, to, &[&"/move"]).with_context(|| ctx.clone())
36+
collector::robocopy(from, to, &[&"/move"]).with_context(|| ctx.clone())
3737
}
3838

3939
#[cfg(unix)]
@@ -1135,14 +1135,15 @@ impl Benchmark {
11351135

11361136
#[cfg(windows)]
11371137
fn copy(from: &Path, to: &Path) -> anyhow::Result<()> {
1138-
robocopy(from, to, &[])
1138+
collector::robocopy(from, to, &[])
11391139
}
11401140

11411141
#[cfg(unix)]
11421142
fn copy(from: &Path, to: &Path) -> anyhow::Result<()> {
11431143
let mut cmd = Command::new("cp");
11441144
cmd.arg("-pLR").arg(from).arg(to);
1145-
command_output(&mut cmd)
1145+
command_output(&mut cmd)?;
1146+
Ok(())
11461147
}
11471148

11481149
fn make_temp_dir(&self, base: &Path) -> anyhow::Result<TempDir> {

collector/src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use chrono::NaiveDate;
22
pub use database::{Commit, PatchName, QueryLabel};
33
use serde::Deserialize;
4-
use std::{cmp::PartialOrd, ffi::OsStr, path::Path};
4+
use std::cmp::PartialOrd;
55
use std::fmt;
66
use std::process::{self, Command};
77

@@ -145,7 +145,11 @@ pub fn run_command(cmd: &mut Command) -> anyhow::Result<()> {
145145
}
146146

147147
#[cfg(windows)]
148-
pub fn robocopy(from: &Path, to: &Path, extra_args: &[&dyn AsRef<OsStr>]) -> anyhow::Result<()> {
148+
pub fn robocopy(
149+
from: &std::path::Path,
150+
to: &std::path::Path,
151+
extra_args: &[&dyn AsRef<std::ffi::OsStr>]
152+
) -> anyhow::Result<()> {
149153
let mut cmd = Command::new("robocopy");
150154
cmd.arg(from).arg(to).arg("/s").arg("/e");
151155

0 commit comments

Comments
 (0)