From fee06f0a3246a6cf33857e5fb8e9aa4aed1a0c0c Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Wed, 24 Sep 2025 21:22:00 -0400 Subject: [PATCH] xtask: exit after printing help Causes the xtask build to print an error and exit if it doesn't recognize the task argument. Just ran into this as a result of the cramsoc -> bao1x rename in 1255bf1 -- the build wasn't recognizing `baremetal-cramsoc` anymore but was proceeding with the compile anyway, without setting the target or loader features. --- xtask/src/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 6d534572c..fd2264efe 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -709,7 +709,14 @@ fn main() -> Result<(), Box> { Some("generate-locales") => generate_locales()?, Some("wycheproof-import") => wycheproof_import()?, Some("dummy-template") => generate_app_menus(&Vec::new()), - _ => print_help(), + task => { + if let Some(task) = task { + eprintln!("error: task {task:?} not recognized"); + } + + print_help(); + std::process::exit(1); + } } builder.build()?;