Unable to use it in the preprocess stanza of dune
After installing bitstring and ppx_bitstring (both 4.1.0 version) whenever I try to build a project that depends on them I got the error "Unexpected list". This is how I set them on dune file:
(library
(name whatever)
(inline_tests (deps (glob_files %{project_root}/test/*.txt)))
(libraries bitstring)
(preprocess (pps ppx_inline_test (ppx_bitstring))))
also tried removing parenthesis and got a different error ("Fatal error: exception Invalid_argument("List.map2")"). When dune file set like:
(library
(name whatever)
(inline_tests (deps (glob_files %{project_root}/test/*.txt)))
(libraries bitstring)
(preprocess (pps ppx_inline_test ppx_bitstring)))
Is there any configuration I am missing?
Bitstring's own test use the dune pps notation so it's unlikely a problem with that. However, there could be an impedance mismatch between ppx_inline_tests and bitstring. Send me a minimal example that reproduces the problem and I'll take a look.
Ok, so there were two different issues:
- Using parentheses on the dune stanza gives you the list error. Checking the
testcode is seems that they are not used, but in the documentation and README they seem to be used (you can see a minimal example in the attached file). - The other (
Invalid_argument("List.map2")) error was due to using an invalid pattern ({| b1::8, b2::8 |}), so the error message is a little misleading but it was a bug in the code.
Yeah those parentheses are not needed. I'll update the documentation. Thanks for the example.