I’m writing a library with ppx_inline_test and I want to link this library to my ppx and camlp5 rewriters. For historical reasons I was compiling PPX and camlp5 rewriters using custom dune (rule ...)
stanza. When I added PPX inline tests to my library I realized that my manual linking to %{project_root}/lib/lib1.cmxa
is wrong: by some reason this library is preprocessed for running inline tests, so it depends on Ppx_inline_test_lib__Runtime
. Where is the version of my library without inline tests? I don’t know. The solution I found is to use default executable
stanza and it looks like it is indeed a proper solution (no troubles with absence of linkall
flag, etc.)
But things are more complicated with Camlp5. It is required to use a custom executable mkcamlp5.opt
to link rewriter properly (a Dynlink-related module is generated under the hood and being compiled to my rewriter). That’s why I can’t manage to get the same result while using dune’s executable
stanza. Could you help with that?
Questions:
- Can I find in
_build
two versions of my library at the same time: one for tests and one without? I believe specifying right one will lead to the shortest fix. - Will abandoning of
mkcamlp5.top
be a better solution? @Chet_Murthy
demo: GitHub - Kakadu/ppx_inline_test_and_camp5
12 posts - 3 participants