Better error when plugins don't call the send function

This commit is contained in:
Jeremie Dimino 2017-03-21 14:03:33 +00:00
parent a84e338436
commit a1e898af5b
2 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,11 @@
* 1.0+beta5
- When =ocamlfind= is present in the =PATH=, do not attempt to call
=opam config var lib=
- Better error message when a jbuild file in OCaml syntax forgets to
call =Jbuild_plugin.V*.send=
* 1.0+beta4 (20/03/2017)
- Improve error messages about invalid/missing pkg.opam files

View File

@ -118,6 +118,10 @@ end
(Path.to_string context.ocaml)
args
>>= fun () ->
if not (Path.exists generated_jbuild) then
die "@{<error>Error:@} %s failed to produce a valid jbuild file.\n\
Did you forgot to call [Jbuild_plugin.V*.send]?"
(Path.to_string file);
let sexps = Sexp_load.many (Path.to_string generated_jbuild) in
return (dir, Stanzas.parse sexps ~dir ~visible_packages ~closest_packages))
|> Future.all