cabal beginner issues (other-modules, build-depends)

Simon Marlow simonmar at microsoft.com
Fri Sep 23 04:52:05 EDT 2005


On 22 September 2005 23:02, Andrew Pimlott wrote:

> 2.  Similar comments apply to build-depends.  I wrote a module Foo.hs:
> 
>         module Foo (foo) where
>         import Control.Monad.Identity
>         foo = runIdentity (return ())
> 
>     and a cabal file (working from an example obviously):
> 
>         Name:           foo
>         Version:        1.1
>         License:        BSD3
>         Build-Depends:  base
>         Exposed-modules:
>                 Foo
> 
>     This built and installed without error, but when I created another
>     module that imports Foo and tried to compile it with "ghc
>     --make", I got undefined references to Control.Monad.Identity. 
>     Eventually, I found that I need to add mtl to build-depends. 
>     Again it would have been better to get an error during package
>     creation, and this was particulary tricky to figure out because
>     "build-depends" sounds like it should only affect package at
> build-time. 

This is fixed in newer versions of Cabal when used with newer versions
of GHC (6.4.1).  Missing dependencies are now reported as build errors,
because GHC is invoked with the -hide-all-packages option.

Cheers,
	Simon


More information about the Libraries mailing list