Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I show dependency tree for a cabal project

Tags:

haskell

cabal

I am using cabal v2-build to build a project and it keeps failing on a package that I do not directly depend on. Is there a way with cabal to list all of a package's dependencies (ideally in tree format) so I can see what I'm relying on that's calling the build fail and (hopefully) get rid of it.

like image 431
Mike Avatar asked May 08 '20 06:05

Mike


1 Answers

Try cabal-plan: https://hackage.haskell.org/package/cabal-plan

In particular cabal-plan info will display copious information on dependencies in a tree format.

Note that cabal-plan requires that you've run cabal first, but the build need not complete successfully. It just needs to get past the build-plan stage. cabal-plan will then read the meta-info cabal created and display it in a readable format for you in detail.

(Aside: cabal-plan can also create transitive license info, quite useful as well. See the license-report option, which does require a separate flag during build time.)

like image 75
alias Avatar answered Oct 27 '22 01:10

alias