From f21217dfbca14cd379999f1f2164d071decc28f4 Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Mon, 6 Mar 2017 10:30:57 +0000 Subject: [PATCH] Improving errors when an alias is not found --- src/build_system.ml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/build_system.ml b/src/build_system.ml index c385ba11..2b318dd4 100644 --- a/src/build_system.ml +++ b/src/build_system.ml @@ -118,11 +118,18 @@ module Build_error = struct raise (E { backtrace; dep_path; exn }) end +let describe_target fn = + match Path.extract_build_context fn with + | Some (".aliases", dir) -> + sprintf "alias %s" (Path.to_string dir) + | _ -> + Path.to_string fn + let wait_for_file t fn ~targeting = match Hashtbl.find t.files fn with | None -> if Path.is_in_build_dir fn then - die "no rule found for %s" (Path.to_string fn) + die "no rule found for %s" (describe_target fn) else if Path.exists fn then return () else