Make variable rename errors more consistent

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
This commit is contained in:
Rudi Grinberg 2018-07-06 18:48:30 +07:00
parent c4545fce18
commit b8f11b1f04
2 changed files with 10 additions and 8 deletions

View File

@ -665,8 +665,8 @@ module Action = struct
| Pair ("findlib", s) when syntax_version >= (1, 0) ->
Loc.fail
loc
"The findlib special variable is not supported anymore, please use lib instead:\n\
%%{lib:%s}"
"The findlib special variable is not supported in jbuild files, \
please use lib instead:\n%%{lib:%s} in dune files"
s
| Pair ("findlib", s)
| Pair ("lib", s) -> begin
@ -822,13 +822,14 @@ module Action = struct
if syntax_version < (1, 0) then
first_dep ()
else
Loc.fail loc "Variable '<' is renamed to 'first-dep' in dune"
Loc.fail loc "Variable '<' is renamed to 'first-dep' in dune files"
| "first-dep" when syntax_version >= (1, 0) -> first_dep ()
| "^" ->
if syntax_version < (1, 0) then
Some (Value.L.paths deps_written_by_user)
else
Loc.fail loc "Variable %%{^} has been renamed to %%{deps}"
Loc.fail loc
"Variable %%{^} has been renamed to %%{deps} in dune files"
| "deps" when syntax_version >= (1, 0) ->
Some (Value.L.paths deps_written_by_user)
| _ -> None)
@ -842,7 +843,8 @@ module Action = struct
| [] -> ()
| x :: _ ->
let loc = String_with_vars.loc x in
Loc.warn loc "Aliases must not have targets, this target will be ignored.\n\
Loc.warn loc
"Aliases must not have targets, this target will be ignored.\n\
This will become an error in the future.";
end;
let t, forms =

View File

@ -3,8 +3,8 @@ We are dropping support for findlib in dune
$ dune build --root in-dune target.txt
Entering directory 'in-dune'
File "dune", line 2, characters 25-37:
Error: The findlib special variable is not supported anymore, please use lib instead:
%{lib:pkg}
Error: The findlib special variable is not supported in jbuild files, please use lib instead:
%{lib:pkg} in dune files
[1]
But it must still be available in jbuild files