How can we run ocamlc -i on a module that is supposed to be compiled with dune (with local and non-local libraries and possibly other things that make manual compilation outside dune non-trivial)?
Ideally, I would like to run the same command that dune uses to compile the module, but with the option -i. (I could copy-paste the output of dune --verbose and add the option manually, but there is probably a more convenient way!)
Yes, it can work, thanks for the suggestion! If no one proposes a more direct solution (for instance, a solution that does not require to go manually in _build/default/*/*.objs/byte/), I will accept yours!
It’s a bit of a shame we haven’t solved this in dune yet. There are problems in dune that make adding this feature not entirely trivial, but we should really fix the engine to accommodate features like this.
Thank you all for your suggestions and pointers! Since cmitomli is the state of the art, I accept @octachron’s solution, but, yes, that would be great if dune could do this more conveniently!