cmx -> cmxa compilation lacks .o dependency
Judging by an ocamlbuild -documentation invocation, the compilation of cmxa files from (typically packed) cmx file does not declare the corresponding o file as a dependency. However I have an example where modifying a module leaves the cmx file unchanged while the o file is modified. Not taking this dependency into account leads ocamlbuild to think it can avoid recompiling the cmxa file.
I think this code is at fault, as it should add a dep to the C object file for native compilation. Maybe this line should be fixed too.
@pveber Is this blocking you? Let me know if I should prioritize this.
Not at the moment. Thanks for considering!
I've just been bitten again by this one. Note that it affects any project compiling an executable from an internal lib in native mode. When you modify a module from the library, the executable is left unchanged.
Fixed in d6f7dafe5651f74a74b2ab4933b40851579bbaf8. I recompiled my projects and looked at the output of ocamlbuild -documentation, and I think I got it all right. However, @pveber your validation is welcome since the fixes were a bit a tedious. If all looks good to you, please close this issue.
Note we have the analogous issue with .a files, which are companions to .cma files. However, I won't bother fixing that unless we actually hit a problem. So far the omission of .a handling hasn't affected anything.
Thanks for looking into that! Unfortunately it is not working in my hands yet. Maybe I can prepare a minimal (counter-)example if you think this might help you?
😞 Sure, a minimal example could help, but feel free to just describe what is still wrong if you know.
Also, maybe one of the demos already serves as an example. Just let me know how to exhibit the problem.