Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
ocamldep should error out if a rewriter returns an error #6795
Original bug ID: 6795
Currently, if a rewriter returns an error, ocamldep blindly processes the [%%ocaml.error] node instead, and returns no dependency information at all, which causes the rest of compilation to fail in unexpected and confusing ways (no module found) if it does in fact depend on dependencies being present.
This happens with my package ppx_import.
Comment author: @gasche
I agree on principle on the idea of adding code to ocamldep to detect the specific error-return convention of -ppx. It's just that I don't know how robust or how fragile ocamldep is when dealing with camlp4 preprocessing errors, and I suggest to make it exactly as robust (and fragile) with ppx errors (recognized as such).
Comment author: @diml
When camlp4 fails, ocamldep fails as well but still prints deps:
let a = Foo.a
let a = 42
ocamldep -pp camlp4o test.ml
File "test.ml", line 1, characters 8-9:
ocamldep -allow-approx -pp camlp4o test.ml
File "test.ml", line 2, characters 8-9:
test.cmo : foo.cmo
I'm writing a patch to do the same with -ppx errors.