cabal-plan
Library and utility for processing cabal's plan.json file
| LTS Haskell 24.18: | 0.7.6.1 | 
| Stackage Nightly 2025-11-04: | 0.7.6.1 | 
| Latest on Hackage: | 0.7.6.1 | 
cabal-plan-0.7.6.1@sha256:3d7c8095c15525b071c578a126e37788b81f73dfcc87201f25e2598dab26ce5b,5302Module documentation for 0.7.6.1
- Cabal
 
This package provides a library (see Cabal.Plan) for decoding plan.json files as
well as the simple tool cabal-plan for extracting and pretty printing
the information contained in the plan.json file.
plan.json files are generated by cabal's Nix-style local builds and contain detailed information about the build/install plan computed by the cabal solver.
cabal-plan utility
The cabal-plan executable (enabled via the exe cabal flag) provides various operations:
- info
 - Show basic report of dependency tree
 - show
 - Dump 
PlanJsondata-structure viaShowinstance - tred
 - Show dependency tree as a graph
 - diff
 - Diff two install plans
 - list-bins
 - List all binaries
 - list-bin
 - List single binary (useful for scripting, e.g. 
cabal list-bin exe:cabal-plan) - fingerprint
 - Print SHA256 sums of dependencies' source tarballs and cabal files
 - dot
 - Generate graph of dependencies in 
.dotformat - topo
 - Print plan topologically sorted
 - license-report
 - Generate license report for a component (only available when built with 
license-reportflag enabled); see report example for cabal-plan (Pandoc rendered HTML) 
See also "New things in Haskell package QA" Blogpost for a description of the topo and dot operations as well as how to enable tab-completion.
Changes
Revision history for cabal-plan
0.7.6.0
- Use Cabal-syntax-3.12
 - Support GHC-8.8.4…9.12.2
 
0.7.5.0
- No changes in the library
 - Add 
-ffilter flag totredcommand to only show parts of the graph to given package(s). This essentially answers “why that package” is in the build plan. 
0.7.4.0
- Use Cabal-syntax-3.12
 - Support GHC-8.6.5…9.10.1
 
0.7.3.0
- Use Cabal-syntax-3.10
 
0.7.2.3
- Fix issue in previous release (license generation didn’t work at all)
 
0.7.2.2
- Use Cabal-syntax-3.8.1.0
 
0.7.2.1
- Support Cabal-3.6
 - Support aeson-2.0.0.0
 - Drop support for GHC prior 8.2
 
0.7.2.0
exe:cabal-plan Executable
- Use 
cabal-install-parsersto find and parse~/cabal/config - Fix ascii/unicode output in 
tred - Add flags to hide setup and executable components in dot command
 - Update dependencies (support 
base16-bytestring-1.0.0.0) 
Library
- Update dependencies (support 
base16-bytestring-1.0.0.0) 
0.7.1.0
exe:cabal-plan Executable
- Add 
--ascii/--unicodeflags to control output character set - Add 
dot-pngcommand as a version ofdotcommand with different defaults - Use 
cabal-install-parsers, this makeslicense-reportwork with non-default configurations 
0.7.0.0
lib:cabal-plan Library
- Support 
local+noindexstyle repositories: NewRepoconstructor:RepoLocalNoIndex. - Support newer versions of dependencies (GHC-8.10, aeson-1.5, optics-core-0.3)
 
exe:cabal-plan Executable
- Support 
Cabal-3.2 
0.6.2.0
lib:cabal-plan Library
- Add 
findPlanJsonfunction 
exe:cabal-plan Executable
- Drop 
process-extrasdependency 
0.6.1.0
lib:cabal-plan Library
No changes
exe:cabal-plan Executable
- 
dotcommand got new options--rootto limit graph to specific roots--outputto write directly to some file--run-dot-pngand--run-dot-pdfto rundotfor you
 - 
cabal-planexecutable depends onoptics-coreinstead oflens. Therefore is buildable only with GHC-8.0+ 
0.6.0.0
lib:cabal-plan Library
ExactPathconstructor to skipfindinfindAndDecodePlanJson. (Note: see alsodecodePlanJson)
exe:cabal-plan Executable
--plan-jsonfor exactplan.jsonlocation--relativesearch for project root relative to that directory--colors=auto|never|alwaysflagtredcommand to print transtive reduction of dependency graphdiffcommand to compare two planslist-binsprints full selector “pkg:type:name”, i.e. includes package name
0.5.0.0
lib:cabal-plan Library
- New 
dispCompNameTargetfunction for pretty-printingCompNames in cabal’s target-selector syntax. - Add support for cabal 2.4’s 
pkg-srcpackage provenience metadata. - Add support for cabal 2.4.1’s 
pkg-cabal-sha256package description checksum field. 
exe:cabal-plan Executable
- Add support for including package description checksums in 
fingerprintoutput - Add support for printing flag selection in 
topooutput - Fail gracefully in 
license-reportwhen metadata cannot be found in index 
0.4.0.0
lib:cabal-plan Library
- New 
SearchPlanJsontype to specify strategy for locatingplan.json - Add 
SearchPlanJsonparameter tofindAndDecodePlanJsonfunction and change return type - Expose separate 
findProjectRootoperation 
exe:cabal-plan Executable
- New command 
license-report(requires Cabal flaglicense-reportto be active) 
0.3.0.0
lib:cabal-plan Library
- Add support for foreign-lib components.
 - Add support for 
dist-dirplan.jsonfield. - Make 
Sha256type abstract and add newsha256{To,From}ByteStringconversion functions, as well as the newparseSha256function. - Introduce 
FlagNamenewtype. - Add 
FromJSONKey/ToJSONKeyinstances forUnitId,PackageName, andPkgId. 
exe:cabal-plan Executable
- smart completer for list-bin/list-bins pattern
 - new command 
topo(printing out topographic sorting of install-plan) dotprints component dependency graph. New options:--tredtransitive reduction--tred-weightsAdjust edge thickness during transitive reduction--path-from pkgA --path-from pkgBHighlight dependency paths from pkgA to pkgB--revdep pkghighlight reverse dependencies of pkg in the install plan
0.2.0.0
- Add an optional 
--builddirargument to all commands and tofindAndDecodePlanJsonfunction. - Add experimental support for underlining.
 - Reimplement CLI with 
optparse-applicative. - Add new sub-command 
list-binsand change semantics of existinglist-binsub-cmd. 
0.1.1.0
- Add 
cabal-plan fingerprintcommand for printing sha256 sums of source tarballs. 
0.1.0.0
- First version. Released on an unsuspecting world.