solvuu-build icon indicating copy to clipboard operation
solvuu-build copied to clipboard

cmx -> cmxa compilation lacks .o dependency

Open pveber opened this issue 9 years ago • 9 comments

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 avatar Jul 26 '16 17:07 pveber

Stable links are:

agarwal avatar Nov 03 '16 14:11 agarwal

@pveber Is this blocking you? Let me know if I should prioritize this.

agarwal avatar Nov 03 '16 14:11 agarwal

Not at the moment. Thanks for considering!

pveber avatar Nov 03 '16 14:11 pveber

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.

pveber avatar Jan 09 '17 14:01 pveber

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.

agarwal avatar Feb 28 '17 02:02 agarwal

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.

agarwal avatar Feb 28 '17 02:02 agarwal

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?

pveber avatar Feb 28 '17 18:02 pveber

😞 Sure, a minimal example could help, but feel free to just describe what is still wrong if you know.

agarwal avatar Feb 28 '17 18:02 agarwal

Also, maybe one of the demos already serves as an example. Just let me know how to exhibit the problem.

agarwal avatar Feb 28 '17 18:02 agarwal