Let Report_error print the location for Private_deps_not_allowed
This commit is contained in:
parent
178e26cfd9
commit
7e361d596e
|
@ -1147,11 +1147,10 @@ let report_lib_error ppf (e : Error.t) =
|
||||||
Format.fprintf ppf "-> %S in %s"
|
Format.fprintf ppf "-> %S in %s"
|
||||||
name (Path.to_string_maybe_quoted path)))
|
name (Path.to_string_maybe_quoted path)))
|
||||||
cycle
|
cycle
|
||||||
| Private_deps_not_allowed (t : private_deps_not_allowed) ->
|
| Private_deps_not_allowed t ->
|
||||||
Format.fprintf ppf
|
Format.fprintf ppf
|
||||||
"%a@{<error>Error@}: Library %S is private, it cannot be a dependency of\
|
"@{<error>Error@}: Library %S is private, it cannot be a dependency of \
|
||||||
a public library.\nYou need to give %S a public name.\n"
|
a public library.\nYou need to give %S a public name.\n"
|
||||||
Loc.print t.pd_loc
|
|
||||||
t.private_dep.name
|
t.private_dep.name
|
||||||
t.private_dep.name
|
t.private_dep.name
|
||||||
|
|
||||||
|
@ -1167,6 +1166,8 @@ let () =
|
||||||
| [] -> (* during bootstrap *) None
|
| [] -> (* during bootstrap *) None
|
||||||
| l ->
|
| l ->
|
||||||
Some (List.map l ~f:quote_for_shell |> String.concat ~sep:" "))
|
Some (List.map l ~f:quote_for_shell |> String.concat ~sep:" "))
|
||||||
|
| Private_deps_not_allowed t ->
|
||||||
|
(Some t.pd_loc, None)
|
||||||
| _ -> (None, None)
|
| _ -> (None, None)
|
||||||
in
|
in
|
||||||
Some
|
Some
|
||||||
|
|
|
@ -2,8 +2,8 @@ public libraries may not have private dependencies
|
||||||
|
|
||||||
$ $JBUILDER build -j1 --display short --root private-dep 2>&1 | grep -v Entering
|
$ $JBUILDER build -j1 --display short --root private-dep 2>&1 | grep -v Entering
|
||||||
File "jbuild", line 1, characters 0-155:
|
File "jbuild", line 1, characters 0-155:
|
||||||
Error: Library "privatelib" is private, it cannot be a dependency ofa public library. You need to give "privatelib" a public name
|
Error: Library "privatelib" is private, it cannot be a dependency of a public library.
|
||||||
-> required by library "publiclib" in _build/default
|
You need to give "privatelib" a public name.
|
||||||
ocamldep publiclib.ml.d
|
ocamldep publiclib.ml.d
|
||||||
|
|
||||||
On the other hand, public libraries may have private preprocessors
|
On the other hand, public libraries may have private preprocessors
|
||||||
|
@ -23,8 +23,8 @@ On the other hand, public libraries may have private preprocessors
|
||||||
Unless they introduce private runtime dependencies:
|
Unless they introduce private runtime dependencies:
|
||||||
$ $JBUILDER build -j1 --display short --root private-runtime-deps 2>&1 | grep -v Entering
|
$ $JBUILDER build -j1 --display short --root private-runtime-deps 2>&1 | grep -v Entering
|
||||||
File "jbuild", line 8, characters 1-143:
|
File "jbuild", line 8, characters 1-143:
|
||||||
Error: Library "private_runtime_dep" is private, it cannot be a dependency ofa public library. You need to give "private_runtime_dep" a public name
|
Error: Library "private_runtime_dep" is private, it cannot be a dependency of a public library.
|
||||||
-> required by library "mylib" in _build/default
|
You need to give "private_runtime_dep" a public name.
|
||||||
ocamlc .private_ppx.objs/private_ppx.{cmi,cmo,cmt}
|
ocamlc .private_ppx.objs/private_ppx.{cmi,cmo,cmt}
|
||||||
ocamlopt .private_ppx.objs/private_ppx.{cmx,o}
|
ocamlopt .private_ppx.objs/private_ppx.{cmx,o}
|
||||||
ocamlopt private_ppx.{a,cmxa}
|
ocamlopt private_ppx.{a,cmxa}
|
||||||
|
|
Loading…
Reference in New Issue