Announcing dune-deps: produces a project-centric dependency graph

Since the original announcement, I received some good feedback from users working on large projects. Thank you!

The latest version released today is 1.2.0. It is already available on opam-repository (thank you @kit-ty-kate). The changes since the original release, besides bug fixes, include:

  • Ability to select or ignore dune files and folders to scan. For example, dune-deps foo bar -x bar/test uses all the dune files found in folders foo and bar but will ignore bar/test. This is useful for ignoring uninteresting parts of the project and for ignoring parse errors (see bug #4).
  • Executable name disambiguation. For example, private executables of the same name like foo/main and bar/baz/main are now rendered as main<foo> and main<baz> respectively instead of just main.
  • Optional exclusion of all executables or all external libraries with --no-exe and --no-ext.
  • Ability to show only the dependencies and/or the reverse dependencies of selected libraries. See below.

Whole-project graphs for large projects tend to be unreadable. To deal with that, I added support for an “hourglass view” (:hourglass:) option for showing only the dependencies and reverse dependencies of a component of interest.

The following is obtained with -h opam-client on the opam project:

Please let us know if this works for your favorite projects! The source code of dune-deps makes it somewhat easier now to experiment with new strategies for eliminating nodes. See the Filter and Filterable modules.

Check out dune-deps --help for detailed documentation on the options.

3 Likes