You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you compile using ocamlbuild (ocamlbuild -use-ocamlfind calc.{byte|native}) everything works out fine. But compiling with obuild causes it to throw the error:
File "_none_", line 1:
Error: Files dist/build/calc/Parser.cmx
and ~/.opam/4.02.3/lib/ocaml/compiler-libs/ocamlcommon.cmxa
both define a module named Parser
Which shows it attempting to link the compiler-libs into the final compilation product.
The text was updated successfully, but these errors were encountered:
Thank you, I will investigate.
From a first look, though, obuild doesn't link with compiler-libs, it adds the directory to -I, so the linker is confused by your Parser and the one already there.
compiler-libs is a dependency of ppx_tools, that is a dependency of ppx_conv.
So, I need to understand how ocamlfind (through ocamlbuild) deals with that.
As far as I understand from https://whitequark.org/blog/2014/04/16/a-guide-to-extension-points-in-ocaml/ and https://blogs.janestreet.com/extension-points-or-how-ocaml-is-becoming-more-like-lisp/, ppx is a pre-processing step in the compilation process. As such, once pre-processing is complete, the ppx libraries should no longer be needed.
However, obuild attempts to link in the ppx library and their dependencies into the final product. This should be unnecessary.
Edit:
I've created a repo that shows the problem: https://github.com/benedictleejh/obuild-issue-161
If you compile using ocamlbuild (
ocamlbuild -use-ocamlfind calc.{byte|native}
) everything works out fine. But compiling with obuild causes it to throw the error:Which shows it attempting to link the compiler-libs into the final compilation product.
The text was updated successfully, but these errors were encountered: