Dependency tracking between modules in dune

19 views
Skip to first unread message

Romain Beauxis

unread,
Mar 17, 2021, 10:47:16 AM3/17/21
to ocaml...@googlegroups.com, Samuel Mimram
Hi!

How are dependencies computed between modules in dune?

I am trying to convert a large codebase to dune (liquidsoap) and dune is reporting a dependency cycle that I cannot see in the code.

I'm wondering if that could be a bug with dune but I'm not sure how to go about debugging it.

Thanks for your help!
Romain

Yaron Minsky

unread,
Mar 17, 2021, 10:30:29 PM3/17/21
to ocaml...@googlegroups.com, Samuel Mimram
This list is pretty much dead. I think you'll have better luck with
this question on discuss.ocaml.org.

y
> --
> You received this message because you are subscribed to the Google Groups "ocaml-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ocaml-core+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ocaml-core/CABWZ6ORrhgVchDguZNE0QcW1JWok4O55hjrnyf9WdeEDaeZTRA%40mail.gmail.com.

Romain Beauxis

unread,
Mar 17, 2021, 10:40:16 PM3/17/21
to ocaml...@googlegroups.com, Samuel Mimram
Thanks for the answer. The issue was with us so we're unblocked now :-)

Jeremie Dimino

unread,
Mar 18, 2021, 7:16:14 AM3/18/21
to ocaml...@googlegroups.com, Samuel Mimram
FTR, there is a known issue with such cycles reporting in Dune: Dune observes the cycle in the graph where each module has its transitive list of dependencies listed as dependencies, rather than just its first step ones as reported by ocamldep. As a result, Dune report cycle that might not be obvious in the code. Such as A->B->A where in fact A depends on C and C depends on B but A doesn't mention B.



--
Jeremie

Romain Beauxis

unread,
Mar 18, 2021, 9:28:08 AM3/18/21
to ocaml...@googlegroups.com, Samuel Mimram
That is exactly what happened in our case.

As a side note, we were able to build using a plain Makefile with pre-filled file order so there's also the possibility that some reported cycles are not necessarily preventing a proper compilation?

Romain

Jeremie Dimino

unread,
Mar 18, 2021, 10:20:57 AM3/18/21
to ocaml...@googlegroups.com, Samuel Mimram
Yes, it can happen. A possible reason is ocamldep reporting a dependency that is not a real one.



--
Jeremie
Reply all
Reply to author
Forward
0 new messages