On 05 April 2005 21:33, Duncan Coutts wrote:
> Over in Gentoo Haskell packaging land, while trying to get all our
> progs and libs to work with GHC 6.4, we came across a couple programs
> that were failing to compile with this error message:
>
> GetOpt.lhs:1:0:
> Module `GetOpt' is a member of package util-1.0.
> To compile this module, please use -ignore-package util-1.0.
>
> Indeed applying the fix suggested in the error message works but I
> don't think it is right.
>
> $ ghc-pkg field util exposed
> reports as we know that the old util package is not exposed by default
> (since it does not use hierarchical module names)
>
> So how could the GetOpt module we're trying to compile possibly clash
> with the GetOpt module from the util package since the util package is
> not exposed (and we're not compiling with -package util)?
>
> Well it turns out that we had another package installed that depends
> on the util package (cabal-0.5 as it happens) and that package is
> exposed by default. It seems that this implicitly exposes the util
> package.
This is the right behaviour, although I agree it's a little confusing.
The util package has not been exposed as a result of being depended on
by cabal-0.5, but GHC has correctly inferred that it is part of the
program, and so its modules cannot clash with any others in the program.
The documentation does describe this (section 4.8.1):
There must be no overlaps in the modules provided by all of the
exposed packages, and the packages they depend on, and so on.
it doesn't mention the modules of the program though. Perhaps it
should, I'm open to suggestions for better wording.
It would be nice if the error message said something like "util-1.0 is
included because it is a dependency of ...".
I'm surprised that you could use -ignore-package util, I would have
expected that to cause an error due to the dependency from cabal to
util. That might be a bug - can you confirm?
Cheers,
Simon
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs