packunused: Tool for detecting redundant Cabal package dependencies
This simple CLI tool allows to find out which of the packages listed as
build-depends
in a Cabal package description file are redundant.
packunused
works by taking advantage of GHC's
-ddump-minimal-imports
feature which creates .import
files for
each compiled module containing a minimal set of explicit import
declarations. These .import
files together with Cabal's generated
package configuration meta-data is analyzed by packunused
to
detect potentially redundant package dependencies.
In order to use packunused
you have to configure the package as
usual. See the example session below:
cabal clean rm *.imports cabal configure -O0 --disable-library-profiling cabal build --ghc-option=-ddump-minimal-imports packunused
The -O0 --disable-library-profiling
options are just to speed up
compilation. In some cases you might want to pass additional options
to the configure
step, such as --enable-benchmark
or
--enable-tests
.
When run, packunused
prints a report to standard output listing
its findings for each component built. The following is an example
for the packunused
package itself, with a redundant dependency
added for demonstration on purpose:
detected package components ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - executable(s): packunused (component names suffixed with '*' are not configured to be built) executable(packunused) ~~~~~~~~~~~~~~~~~~~~~~ The following package dependencies seem redundant: - criterion-0.6.2.0-9dd4d764629a47662168743b2dfda9bc
Downloads
- packunused-0.1.1.4.tar.gz [browse] (Cabal source package)
- Package description (revised from the package)
Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
Versions [RSS] | 0.1.0.0, 0.1.0.1, 0.1.1.0, 0.1.1.1, 0.1.1.2, 0.1.1.3, 0.1.1.4, 0.1.2 |
---|---|
Change log | changelog.md |
Dependencies | base (>=4.5 && <4.9), Cabal (>=1.14 && <1.23), directory (>=1.1 && <1.3), filepath (>=1.3 && <1.5), haskell-src-exts (>=1.13 && <1.17), optparse-applicative (>=0.8 && <0.12), split (>=0.2 && <0.3) [details] |
License | BSD-3-Clause |
Copyright | © 2014 Herbert Valerio Riedel |
Author | Herbert Valerio Riedel |
Maintainer | Herbert Valerio Riedel <hvr@gnu.org> |
Revised | Revision 1 made by HerbertValerioRiedel at 2015-03-28T18:18:00Z |
Category | Distribution |
Home page | https://github.com/hvr/packunused |
Bug tracker | https://github.com/hvr/packunused/issues |
Source repo | head: git clone https://github.com/hvr/packunused.git |
Uploaded | by HerbertValerioRiedel at 2015-01-27T08:53:03Z |
Distributions | |
Reverse Dependencies | 1 direct, 0 indirect [details] |
Executables | packunused |
Downloads | 8581 total (34 in the last 30 days) |
Rating | 2.0 (votes: 1) [estimated by Bayesian average] |
Your Rating | |
Status | Docs not available [build log] Last success reported on 2015-11-13 [all 7 reports] |