Improving errors when an alias is not found

This commit is contained in:
Jeremie Dimino 2017-03-06 10:30:57 +00:00
parent 35ac2e84ed
commit f21217dfbc
1 changed files with 8 additions and 1 deletions

View File

@ -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