Skip to content

Commit feab6f0

Browse files
committed
add more error messaging
1 parent 28bfc4e commit feab6f0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

crates/xtask/src/main.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,10 +1217,10 @@ impl Xtasks {
12171217
fn bench(app_settings: GlobalArgs) -> Result<()> {
12181218
// first of all figure out which branch we're on
12191219
// run // git rev-parse --abbrev-ref HEAD
1220-
1220+
let workspace_dir = Self::workspace_dir(&app_settings).unwrap();
12211221
let command = Command::new("git")
12221222
.args(["rev-parse", "--abbrev-ref", "HEAD"])
1223-
.current_dir(Self::workspace_dir(&app_settings).unwrap())
1223+
.current_dir(workspace_dir)
12241224
.output()
12251225
.with_context(|| "Trying to figure out which branch we're on in benchmarking")?;
12261226
let branch = String::from_utf8(command.stdout)?;
@@ -1251,7 +1251,7 @@ impl Xtasks {
12511251
bencher_cmd
12521252
.stdout(std::process::Stdio::inherit())
12531253
.stderr(std::process::Stdio::inherit())
1254-
.current_dir(Self::workspace_dir(&app_settings).unwrap())
1254+
.current_dir(workspace_dir)
12551255
.arg("run")
12561256
.args(["--project", "bms"])
12571257
.args(["--branch", &format!("\"{branch}\"")])
@@ -1277,7 +1277,9 @@ impl Xtasks {
12771277
.args(["--adapter", "rust_criterion"])
12781278
.arg("cargo bench --features=lua54");
12791279

1280-
let out = bencher_cmd.output()?;
1280+
let out = bencher_cmd
1281+
.output()
1282+
.with_context(|| "Could not trigger bencher command")?;
12811283
if !out.status.success() {
12821284
bail!("Failed to run bencher: {:?}", out);
12831285
}

0 commit comments

Comments
 (0)