From 255c59cf9890a69922920882607600710ecc6195 Mon Sep 17 00:00:00 2001 From: Dmitry Savintsev Date: Thu, 26 Jan 2023 11:59:23 +0100 Subject: [PATCH] Remove unix-specific executor in xtask Change unix-specific executor to generic one to enable xtask working on Windows and eventually be able to cross-compile on Windows. Fixes #76. Signed-off-by: Dmitry Savintsev --- xtask/src/run.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/xtask/src/run.rs b/xtask/src/run.rs index 55a9806..12b4d38 100644 --- a/xtask/src/run.rs +++ b/xtask/src/run.rs @@ -1,4 +1,4 @@ -use std::{os::unix::process::CommandExt, process::Command}; +use std::process::Command; use anyhow::Context as _; use clap::Parser; @@ -57,11 +57,12 @@ pub fn run(opts: Options) -> Result<(), anyhow::Error> { args.push(bin_path.as_str()); args.append(&mut run_args); - // spawn the command - let err = Command::new(args.first().expect("No first argument")) + // run the command + let status = Command::new(args.first().expect("No first argument")) .args(args.iter().skip(1)) - .exec(); + .status() + .expect("failed to run the command"); - // we shouldn't get here unless the command failed to spawn - Err(anyhow::Error::from(err).context(format!("Failed to run `{}`", args.join(" ")))) + assert!(status.success()); + Ok(()) }