Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating a file describing the dependencies between ML files ? #3425

Closed
fblanqui opened this issue Apr 25, 2020 · 5 comments
Closed

Generating a file describing the dependencies between ML files ? #3425

fblanqui opened this issue Apr 25, 2020 · 5 comments

Comments

@fblanqui
Copy link

Desired Behavior

Hello. I was wondering if it's possible to generate a file like ocamldep does. From such a file, one can generate a graph. It is quite useful for someone joining a project to get a graphical idea of how the files depend on each other. Thank you.

Example

@ejgallego
Copy link
Collaborator

I think this may be a duplicate of ocaml/odoc#225

@esope
Copy link
Collaborator

esope commented Jan 14, 2022

Hello, I have a similar need : given a whole dune project, have a command that gives you the dependencies between the .ml files that live in the project, and also between the .ml files of the project and .ml files used in external libraries (and the standard library).
Currently, the dune describe command only gives you dependencies at the granularity of dune libraries or executables. Moreover, the dependencies to external libraries that are given by dune describe are not very useful, because dune describe only refers to the UIDs of the external libraries, without giving any detail about which UID corresponds to which library.
It is true that I can manually find part of the fine-grained dependencies I need, by looking at the .ml.d files that are generated by dune (using ocamldep -modules), but not every source file has a corresponding .ml.d file, unfortunately.
My use case for the need of fine-grained dependencies between .ml files is a tool to analyze the complete source tree of a dune project.
Could the dune describe command be updated to dump the fine grained dependencies ?

@esope
Copy link
Collaborator

esope commented Feb 5, 2022

PR#5412 hopefully provides a solution to the current issue.

@esope
Copy link
Collaborator

esope commented Feb 15, 2022

@fblanqui : PR#5412 has been merged.
Do you think it solves the current bug report ?
EDIT: this is now merged in the main branch.

@esope
Copy link
Collaborator

esope commented Jan 7, 2023

FYI, the following project produces that kind of graph you want: https://github.com/sim642/ocaml-depgraph/ based on dune's output.
I am thus closing the issue.
Please reopen it if you feel this is needed.

@esope esope closed this as completed Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants