Skip to content

Commit

Permalink
generate: catch expression error in rule expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspar030 committed Dec 15, 2023
1 parent 192c9d8 commit 97f290b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,9 @@ fn configure_build(

let expanded =
nested_env::expand_eval(&rule.cmd, &flattened_env, IfMissing::Empty)
.unwrap();
.with_context(|| format!("while expanding cmd \"{}\"", rule.cmd))
.with_context(|| format!("rule \"{}\"", rule.name))
.with_context(|| format!("module \"{}\"", module.name))?;

let rule = rule.to_ninja().command(expanded).build().unwrap().named();
ninja_entries.insert(format!("{rule}"));
Expand Down

0 comments on commit 97f290b

Please sign in to comment.