On 06 April 2005 00:06, Duncan Coutts wrote:

> On Tue, 2005-04-05 at 23:34 +0100, Simon Marlow wrote:
>>> 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. 
> 
> But it's not part of the program. In our test program we do not import
> any module from the dummy package (which is the exposed package that
> depends on util).
> 
> Our example was compiling happy. happy does not import anything from
> cabal-0.5 and yet it was hit by this problem. Unless we consider 'part
> of the program' to be all modules in all exposed packages (and all
> modules in 'efectively exposed' packages like util via the cabal-0.5
> dep).

You're asking GHC to decide which modules the program depends on, in
order to figure out which packages are part of the program, rather than
just starting from the list of exposed packages.

Hmm, that might be possible... we could eagerly report module clashes in
the exposed packages, but only report module clashes in the hidden
packages when we know which ones are required.

> If this is not a bug, the only thing we can do is make sure we never
> create an ebuild for anything that installs an exposed package that
> depends on one of the old hslibs packages. Otherwise several other
> unrelated programs will fail to build.
> 
>> 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.
> 
> So is it all modules provided by exposed packages or all modules
> included (directly or indirectly) in the program?

It is: modules in the program (or current package) + modules from
exposed packages + modules from all packages transitively reachable from
the dependencies of the exposed packages.

>> It would be nice if the error message said something like "util-1.0
>> is included because it is a dependency of ...".
> 
> That would help. We were left wondering how on earth util was getting
> included into the program.
> 
>> 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?
> 
> Yes indeed. Until recently we compiled happy with -ignore-package util
> to work around this issue. Our new solution is to declare cabal-0.5 to
> be incompatible with GHC 6.4.

Ah, I remember now: -ignore-package also magically ignores all packages
that depend on the ignored package.  It was done this way so that you
could recompile a package down at the bottom of the dependency graph
(eg. base) without having to know all the packages that currently depend
on it.

Cheers,
        Simon
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to