ocaml / ocamlbuild

The legacy OCamlbuild build manager
Other
122 stars 81 forks source link

MPR#5101: Feature wish: ocamlbuild should track digests of external dependencies #221

Open damiendoligez opened 7 years ago

damiendoligez commented 7 years ago

PR transferred from https://caml.inria.fr/mantis/view.php?id=5101 [original reporter: @ygrek]

Consider: the main program gets built and linked with external library version 1, then library is upgraded to version 2, program gets bult again but as no source changes occured (all digests are the same) ocamlbuild will not relink the final executable with the new library version. The same applies to all external dependencies : cmi, cmo, etc..

gasche commented 7 years ago

This is hard, and related to #147, and we should try to solve both issues.

whitequark commented 7 years ago

This is in direct conflict with #211 isn't it?

gasche commented 7 years ago

Did you mean to comment on the use-ocamlfind-by-default issue?

whitequark commented 7 years ago

No, the link is right.

ygrek commented 7 years ago

If anything, this issue is an inconvenience, but #211 looks like a necessity (though it would be curious to see a project where calling ocamlfind query once for every dependency causes a huge slowdown)

DieracDelta commented 4 years ago

Is there a flag or something that I can set to get ocamlbuild to relink every time I invoke the build command (even if there is no change to the source)? I'm running into this exact issue

gasche commented 4 years ago

If you just want to redo the linking step, removing the linked binary before building should be enough. In the general case where an external dependency changed under your feet, you need to redo some recompilation as well because the interfaces may have changed, etc. Then I don't know of a better solution than just running clean; hopefully you do upgrade the rest of the world infrequently enough that this is not a big deal. (Hopefully because, given the fact that ocamlbuild is merely on life support these days, I don't think it is going to get new features or big implementation changes on this front.)