Can not put multiple ocaml files in bin directory because of actors_ppx
Situation
When using actors_ppx
, bin
directory can't contain multiple .ml
files, even only one of them is executable and others are modules.
Reproduction
in the bin
directory, there are 3 files, main.ml
, message.ml
and dune
main.ml
let () = print_endline "Hello, World!"; Message.hello_world ()
message.ml
let hello_world () = print_endline "another hello world"
dune
(executable
(public_name main)
(name main)
(preprocess
(staged_pps actors_ppx)))
these will produce an error Error: Unbound module Message
Removing actors_ppx
will make the error away.
See full project code here: https://gitlab.inria.fr/wendu/actors_ppx-module-error-reproduction
Workaround
Move message.ml
to the lib
directory