Improve error message for undefined aliases
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
This commit is contained in:
parent
30db63ef71
commit
0a970aba35
|
@ -675,9 +675,9 @@ let no_rule_found =
|
||||||
die "No rule found for %s" (Utils.describe_target fn)
|
die "No rule found for %s" (Utils.describe_target fn)
|
||||||
in
|
in
|
||||||
fun t fn ->
|
fun t fn ->
|
||||||
match Path.extract_build_context fn with
|
match Utils.analyse_target fn with
|
||||||
| None -> fail fn
|
| Other _ -> fail fn
|
||||||
| Some (ctx, _) ->
|
| Regular (ctx, _) ->
|
||||||
if String.Map.mem t.contexts ctx then
|
if String.Map.mem t.contexts ctx then
|
||||||
fail fn
|
fail fn
|
||||||
else
|
else
|
||||||
|
@ -685,6 +685,15 @@ let no_rule_found =
|
||||||
(Path.to_string_maybe_quoted fn)
|
(Path.to_string_maybe_quoted fn)
|
||||||
ctx
|
ctx
|
||||||
(hint ctx (String.Map.keys t.contexts))
|
(hint ctx (String.Map.keys t.contexts))
|
||||||
|
| Alias (ctx, fn') ->
|
||||||
|
if String.Map.mem t.contexts ctx then
|
||||||
|
fail fn
|
||||||
|
else
|
||||||
|
let fn = Path.append (Path.relative Path.build_dir ctx) fn' in
|
||||||
|
die "Trying to build alias %s but build context %s doesn't exist.%s"
|
||||||
|
(Path.to_string_maybe_quoted fn)
|
||||||
|
ctx
|
||||||
|
(hint ctx (String.Map.keys t.contexts))
|
||||||
|
|
||||||
let rec compile_rule t ?(copy_source=false) pre_rule =
|
let rec compile_rule t ?(copy_source=false) pre_rule =
|
||||||
let { Pre_rule.
|
let { Pre_rule.
|
||||||
|
|
Loading…
Reference in New Issue