solvuu-build
solvuu-build copied to clipboard
Project.build_lib: rule to build pack doesn't force all cmo's to exist
In the rule for converting a list of .cmo files to a packed .cmo, we assume that all ml_files previously exist. This seemed reasonable since we list these as the deps of the rule. However, ocamlbuild doesn't actually verify that a rules prods end up existing after it is run. Thus, could well end up in a situation where you think all the ml_files have been created but they haven't, and thus the call to ocamldep discards the non-existen ml_files from our list, and finally the pack gets created. There is no error but your pack doesn't include everything you wanted it to.
Not sure what the fix should be. We could:
- Within this rule we could check that all the
ml_filestruly exist, but this only solves the problem here. - Somehow create rules that always check that their
prodsreally got created. This isn't obvious because you have to do something after a rule is run, but ocamlbuild doesn't expose such a feature AFAIK.