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.
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.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With