darcs

Message5199

Author daveroundy
Recipients beschmi, dagit, daveroundy, duncan, tommy
Date 2008-07-08.21:26:32
Issue Issue941 Checking for modules provided by packages fails with multiple providers
Content
On Wed, Jul 2, 2008 at 6:51 AM, Duncan <bugs@darcs.net> wrote:
>
> Duncan <duncan@haskell.org> added the comment:
>
> The key bit is:
>
> configure:5165: checking for module Control.Monad.Error
> configure:5186: ghc  -threaded -package regex-compat -package HTTP -package
> QuickCheck  -o conftest conftest.hs
>
> conftest.hs:1:0:
>    Failed to load interface for `Control.Monad.Error':
>      it was found in multiple packages: mtl-tf-0.1 mtl-1.1.0.0
> configure:5189: $? = 1
> configure: failed program was:
> import Control.Monad.Error
> main = seq (strMsg "foo" :: String) (putStr "Hello world.\n")
>
> -- this file generated by TRY-COMPILE-GHC
> end of failed program.
> configure:5222: ghc  -threaded -package regex-compat -package HTTP -package
> QuickCheck -package mtl  -o conftest conftest.hs
>
> conftest.hs:1:0:
>    Failed to load interface for `Control.Monad.Error':
>      it was found in multiple packages: mtl-tf-0.1 mtl-1.1.0.0
> configure:5225: $? = 1
> configure: failed program was:
> import Control.Monad.Error
> main = seq (strMsg "foo" :: String) (putStr "Hello world.\n")
>
> -- this file generated by TRY-COMPILE-GHC
> end of failed program.
> configure:5238: result: no; and neither in package mtl
> configure:5240: error: Cannot find Control.Monad.Error; try installing package mtl?
>
> So when ghc/ghci finds the module in multiple packages then it complains. The
> solution is to look in a specific package and not in all packages. This can be
> done by hiding all the packages you're not interested in with the
> -hide-all-packages ghc flag. eg:

I'm confused.  We did specify that we wanted to use the package mtl,
why do we also have to tell ghc not to use any packages at all? Is the
real problem that both packages start with mtl? To me, that sounds
more reasonable than adding --hide-all-packages, but I'm not really
clear as to what the effect of --hide-all-packages is.  ghc doesn't
normally look in any packages that aren't specified on the
command-line (although ghci does).

David
History
Date User Action Args
2008-07-08 21:26:32daveroundycreate
2008-07-08 21:26:36daveroundylinkissue941 messages
2008-07-08 21:26:36daveroundysetrecipients: + daveroundy, tommy, beschmi, dagit, duncan