cabal usage

Duncan Coutts duncan.coutts at
Thu Jan 8 07:30:19 EST 2009

On Thu, 2009-01-08 at 11:14 +0100, Johannes Waldmann wrote:
> what is the recommended way (fewest keystrokes) for:
> * cabal install foo (download from hackage)
> * build failure => edit sources => repeat install on modified sources
> Is it really "cabal fetch foo"
> then "tar xvfz ~/.cabal/some/very/long/pathname.tgz" ?

The darcs version of cabal-install supports an 'unpack' command which
fetches a package and unpacks it into a subdir of the current dir. So
the workflow would be:

$ cabal unpack foo
$ cd foo-x.y/
$ vi blah.hs
$ cabal install

> or - is this a workflow that should not happen
> (e.g. it might lead to confusing error messages later
> because "ghc-pkg list" shows the original version number
> if I forget to bump it while patching the sources)

Cabal can get somewhat confused when the installed version of a package
is rather different from the version on hackage. In partthe
packageicular if the dependencies are different. The darcs version of
cabal-install handles this slightly better.

So it's not essential to bump the version number, but with the current
cabal-install it's wise to do so if you change the dependencies in
the .cabal file. In future that may be less important.

Of course making changes without bumping version numbers can cause
confusion for people too, not just for the automatic tools. Version
numbers are after all a label we use to communicate the identity of some
chunk of code.


More information about the Libraries mailing list