From: Richard W.M. Jones Date: Thu, 27 Feb 2020 08:20:31 +0000 (+0000) Subject: run: Improve error message if a predicate script fails. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=7fed0375c4c22c9ad355a31926d86f689cba898c;p=goals.git run: Improve error message if a predicate script fails. In particular always print the fully resolved parameters of the predicate. --- diff --git a/src/run.ml b/src/run.ml index 5aad484..3a04256 100644 --- a/src/run.ml +++ b/src/run.ml @@ -122,9 +122,12 @@ and needs_rebuild ?(final_check = false) env loc deps extra_deps pattern = let r = Eval.run_code env loc code in if r = 99 (* means "needs rebuild" *) then true else if r = 0 (* means "doesn't need rebuild" *) then false - else - failwithf "%a: predicate ‘%s’ failed with exit code %d" - Ast.string_loc loc pred r + else ( + let targs = List.map (Ast.string_expr ()) targs in + let targs = String.concat ", " targs in + failwithf "%a: predicate ‘%s (%s)’ failed with exit code %d" + Ast.string_loc loc pred targs r + ) and exists_runner env loc p debug_pred = Cmdline.debug "%a: running implicit existence rule for predicate %s"