gasche / manual-ocamlbuild

A new reference manual for the ocamlbuild tool
Other
67 stars 15 forks source link

how to use package during plugin compilation #23

Open agarwal opened 8 years ago

agarwal commented 8 years ago
$ cat myocamlbuild.ml 
let x = 42

$ ocamlbuild -just-plugin -plugin-tag "package(opam-lib)"
Warning: tag "package" does not expect a parameter, but is used with parameter "opam-lib"
Finished, 1 target (0 cached) in 00:00:00.

The package tag does take a parameter, so I'm confused.

gasche commented 8 years ago

You need -use-ocamlfind. The usability of the ocamlfind option is not good currently (we discussed making it the default, but there are a surprising number of users that insist on not using ocamlfind, and the transition at the time seemed too delicate to manage correctly). One very good first step would be to add a "Hint:" message when precisely this happens: package is used with a parameter. Feel free to add this to your list of issues :-)

agarwal commented 8 years ago

Thanks. IIUC the message isn't strictly incorrect because the parsing of tags is itself affected by the inclusion of -use-ocamlfind. Nonetheless since this option is so commonly used, an improved error message in this case would help. I'll report on the new ocamlbuild repo (I realize the repo already exists so could start reporting now, but maybe you'll end up needing to create a fresh repo when importing the code so not reporting yet).