The packunused package

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

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 depencencies seem redundant:

  - criterion-0.6.2.0-9dd4d764629a47662168743b2dfda9bc

Properties

Versions0.1.0.0, 0.1.0.1, 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 logNone available
Dependenciesbase (>=4.5 && <4.7), Cabal (>=1.14 && <1.17), cmdargs (==0.10.*), directory (>=1.1 && <1.3), filepath (==1.3.*), haskell-src-exts (>=1.13 && <1.15) [details]
LicenseBSD3
AuthorHerbert Valerio Riedel <hvr@gnu.org>
MaintainerHerbert Valerio Riedel <hvr@gnu.org>
CategoryDistribution
Home pagehttps://github.com/hvr/packunused
Source repositoryhead: git clone https://github.com/hvr/packunused.git
Executablespackunused
UploadedSun Oct 13 12:48:30 UTC 2013 by HerbertValerioRiedel

Downloads

Maintainers' corner

For package maintainers and hackage trustees