[jhc] Re: [Haskell] ANNOUNCE: jhc 0.6.0 Haskell Compiler
Duncan Coutts
duncan.coutts at worc.ox.ac.uk
Mon Mar 23 06:42:29 EDT 2009
On Sun, 2009-03-22 at 19:12 -0700, John Meacham wrote:
> Util/Gen.hs:6:7:
> > Could not find module `Control.Monad.Identity':
> > it was found in multiple packages: transformers-0.1.1.0 mtl-1.1.0.2
> > make[1]: *** [jhc] Error 1
> >
> >
> > I *think* you have to -hide-all-packages then enable the ones you
> want one-by-one (check whatever commandline cabal emits here).
>
> Hmm... what version of ghc are you using? I tested against ghc 6.8 since
> that is all I have available on my machines so it is possible the bugs
> are because you are using ghc 6.10.
This could happen with any version of ghc since 6.4. It's because Don
has got a whole lot of packages installed. Testing with a vanilla
install of ghc-6.8 or 6.10 will not catch this problem. Don has got the
transformers package installed in addition to mtl. The transformers
package is essentially an alternative implementation of mtl, it exports
most of the same module names. So in all the packages he's got
registered, there is overlap in the module name space. That's why it's
important for packages to say exactly which other packages they need.
> If the -hide-all-packages trick works for 6.8 too then I will do that
> always.
Yes, the -hide-all-packages will work with ghc 6.4+
It also means of course that you have to list all the other packages
that jhc needs, eg:
-hide-all-packages -package base -package blah -package etc
That way you specify exactly the subset of the module namespace that jhc
needs and you know there is no overlaps in that set. Then it doesn't
matter what other crazy packages users have installed.
FTIW, you can blame Cabal for you having to do this. It does the above
-hide-all-packages stuff which lets users get away with having multiple
implementations of the same modules exposed by different packages
(though some users may count that as a feature rather than a bug).
Duncan
More information about the jhc
mailing list