Bad error message from Cabal

Simon Peyton-Jones simonpj at microsoft.com
Wed Jun 9 08:31:46 EDT 2010


Duncan et al

A few times recently I've tripped badly over this:

* Cabal complains of missing dependencies
* But the "missing" package is definitely installed

Example below.

The reason is: the "missing" package is installed for this user, but I didn't say "--user" when saying "setup configure".  

Confusingly, saying "cabal configure" works fine.  But "cabal configure --global " fails with the missing dependency.

So there are two infelicities, which combined to leave me stumped:

1. "setup configure" and "cabal configure" use different defaults.  The former defaults to "--global" while the latter defaults to "--user".  I suggest both default to --user.

2. The missing-package error message does not mention that it's looking only in the global packages.  When (but only when) looking in the global packages only, the error should say:

	Setup: At least the following dependencies are missing:
	primitive ==0.3.*
	NB: setup is looking only in the globally-installed packages.
	If you want to include your per-user installed packages, use --user

As a refinement, only suggest --user if that would actually resolve the problem.


Simon

=============

bash-3.2$ ./Setup configure --with-ghc=$head2
Configuring vector-0.6...
Setup: At least the following dependencies are missing:
primitive ==0.3.*

bash-3.2$ ghc-pkg list
...blah...

/home/simonpj/.ghc/x86_64-linux-6.13/package.conf.d:
    monads-tf-0.1.0.0
    {parsec-3.0.0}
    primitive-0.3
    transformers-0.2.1.0
    vector-0.6

bash-3.2$



More information about the cabal-devel mailing list