Closed jordwalke closed 7 years ago
ocamlbuild is notorious for having this issue as well. We can solve it in rebel!
@jordwalke I have solved this just recently. master doesn't have this bug.
:D Excellent. What was the solution?
We apply this nifty optimization for ocamlc where if the cmi doesn't change we don't recompile entire the file. But that doesn't apply in the case of ocamlopt due to some inter module optimizations. So , in the case of ocamlopt we just trigger the recompile of file and everything works.
Great!
Actually, I recall there's a new flag for ocamlopt (maybe only in 4.03?) that allows the same behavior for ocamlopt
. We should look into that.
I changed one file, then tried to rebuild, and I got the following:
I think this happens when an interface file is automatically generated for files that don't have actual interface files (and it produces a
.cmi
artifact which is untracked by the build system). I think the solution may be to have the build system explicitly create the interface file as an artifact for any implementation file that does not already include an interface file. Then the build system knows to compile everything against that interface, although we understand it is automatically generated.