I'd like to see a dependency graph of GHC's modules. Can I use GHC's Shake-based build system, Hadrian, to generate one?
Asked
Active
Viewed 185 times
1 Answers
2
You can use Shake to generate a dependency graph as part of the profiling reports. See https://shakebuild.com/profiling#html-profile-reports to generate reports, and the linked profile demo page 10 shows an example. However, those reports show the build system dependencies for GHC, which are significantly more numerous and complex than the module dependencies in the GHC source code.
To see just the dependencies I am sure it would be easier to generate them using something like graphmod, with the caveat that the GHC source is in multiple directories, so might be hard to get compiling outside the build system.

Neil Mitchell
- 9,090
- 1
- 27
- 85
-
In case anyone else was wondering: you can pass `--profile` directly to Hadrian (since it uses Shake's extensible command line argument functionality). – Alec Jan 08 '19 at 16:44
-
If you generate the profile, then go to the Rule Graph page and type the filter `name(/_build\/stage1\/compiler\/build\/([A-Za-z0-9_]+)\.hi$/)` that would give the dependencies. Unfortunately its 367 nodes, and Shake won't show beyond 250 (partly because a graph of that size is entirely unreadable). – Neil Mitchell Jan 10 '19 at 14:35