[Haskell-beginners] Cabal dependencies are per target or global?

Karl Voelker karl at karlv.net
Sat Jul 18 01:29:23 UTC 2015


On Fri, Jul 17, 2015, at 04:08 PM, Dimitri DeFigueiredo wrote:
> Is this a bug? Or am I missing something?

The dependencies are not global. You can see this by trying to import a
module in Mpm.hs that is in one of the unique dependencies of "agent" -
the import fails. [1]

However, in order to build, you must first configure. And the
"configure" step cannot be done for a single executable - it's done for
the whole package. Since package dependencies are checked during the
configure step, you have to have all the dependencies in place for all
targets.

I think this is probably a good thing, because otherwise, you could end
up installing some packages that satisfy the dependencies of one target,
only to find out that the particular package versions which were chosen
make it impossible to satisfy the dependencies of the other target.

-Karl

1. https://gist.github.com/ktvoelker/d561889ac4bd56cadc2d


More information about the Beginners mailing list