I’ve grown used to tools like ppx_inline_test
and ppx_show
in my OCaml code built by Dune; and I’m currently headed down the road of integrating them into my BuckleScript-to-JavaScript pipeline. (Lord, how I miss Dune!)
However, at the moment, I can’t even get a simple hand-built ppx driver working! Can anybody walk this newbie thru what he’s doing wrong?
$ cat test.ml
type foo = A of int | B of float
[@@deriving show]
$ ocamlfind opt -predicates ppx_driver -linkpkg -linkall -o ppx_driver \
-package ppx_deriving.show -package ppx_deriving
findlib: [WARNING] Interface topdirs.cmi occurs in several directories: /Users/ec/Documents/Code/Source/ppx_deriving/_opam/lib/ocaml/compiler-libs, /Users/ec/Documents/Code/Source/ppx_deriving/_opam/lib/ocaml
$ ocamlc -c -ppx "./ppx_driver -as-ppx" test.ml
File "test.ml", line 1:
Error: External preprocessor does not produce a valid file
Command line: ./ppx_driver -as-ppx '/var/folders/xt/wm01x2h50nv993t_csb1t5qm0000gn/T/camlppx7ee45a' '/var/folders/xt/wm01x2h50nv993t_csb1t5qm0000gn/T/camlppx3eb5cb'
Trying ./ppx_driver -help
produces no output, nor any errors … in fact, no input, files, or stdin seems to cause it to do anything whatsoever.
Please help me learn how ppx-drivers work! D: