voodoos / ocaml-index

MIT License
4 stars 0 forks source link

Dump partial results in the presence of build-failures #4

Open ELLIOTTCABLE opened 1 year ago

ELLIOTTCABLE commented 1 year ago

At the moment, the dune-patch doesn't seem to aggregate a final, top-level ./_build/default/project.uideps in the presence of any failures.

For instance, I've managed to get your Dune building against our monorepo, for the most part; but there's plenty of Not_found errors during the build of the entire thing — e.x.

File "megaindex/api/.main.eobjs/_unknown_", line 1, characters 0-0:
[error] Failed to load cmt(i): Extprot.cmti in load_path: [:
/home/me/code/monorepo/_opam/lib/base:
...
/home/me/code/monorepo/_opam/lib/extprot:
...
/home/me/code/monorepo/_opam/lib/ocaml/threads:
/home/me/code/monorepo/_opam/lib/ocaml]
Fatal error: exception Not_found

I'd like to figure out why that's happening, as well (is it possible to instruct it to ignore external references, for instance those defined in _opam? I guess that's a bit of a chicken-and-egg problem, isn't it ...); but a more pressing issue is that the aggregation step(s) don't seem to proceed in that case.

(I do get intermediate xyz.cmt.uideps files for our modules; just not the final aggregation, I think.)

voodoos commented 1 year ago

Again, this is still a fast moving wip and there is much to be done in error handling.

Packages without installed cmt are an issue and I agree that such errors should be ignored. Meanwhile ou can try to manually aggregate files by doing something like:

(cd _build/default && ocaml-uideps aggregate -o project.uideps file1.uideps lib/file2.uideps)