diff --git a/xtask/src/build/cargo.rs b/xtask/src/build/cargo.rs index 9e12c0c2..869e1268 100644 --- a/xtask/src/build/cargo.rs +++ b/xtask/src/build/cargo.rs @@ -36,7 +36,11 @@ pub enum CargoBuilder<'e> { } impl<'e> CargoBuilder<'e> { - pub fn run, S: AsRef>(self, dir: P, arg: S) -> Result<(), Error> { + fn make_command, S: AsRef>( + self, + dir: P, + arg: S, + ) -> Result { let arg = arg.as_ref(); let mut command = Command::new("cargo"); @@ -239,6 +243,12 @@ impl<'e> CargoBuilder<'e> { // } } + Ok(command) + } + + pub fn run, S: AsRef>(self, dir: P, arg: S) -> Result<(), Error> { + let mut command = self.make_command(dir, arg)?; + log::trace!("Run cargo: {:?}", command); let status = command.status()?;