Improving errors when an alias is not found
This commit is contained in:
parent
35ac2e84ed
commit
f21217dfbc
|
@ -118,11 +118,18 @@ module Build_error = struct
|
||||||
raise (E { backtrace; dep_path; exn })
|
raise (E { backtrace; dep_path; exn })
|
||||||
end
|
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 =
|
let wait_for_file t fn ~targeting =
|
||||||
match Hashtbl.find t.files fn with
|
match Hashtbl.find t.files fn with
|
||||||
| None ->
|
| None ->
|
||||||
if Path.is_in_build_dir fn then
|
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
|
else if Path.exists fn then
|
||||||
return ()
|
return ()
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue