Hi all,

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.

Here's a minimal test case:

dummy.cabal:

        name: dummy
        version: 1.0
        depends: util-1.0
        exposed: True
        
and then:

GetOpt.hs:
module GetOpt where

now we register the dummy package:
$ ghc-pkg register dummy.cabal --user

and try to compile our empty GetOpt module

$ ghc -c GetOpt.hs

GetOpt.hs:1:0:
    Module `GetOpt' is a member of package util-1.0.
    To compile this module, please use -ignore-package util-1.0.


One package A depending on another package (B) should be only an
implementation detail of the package A and should not affect the
interface or exposed modules to clients of that package A.

Obviously, the most immediate problem is that it means we end up
exposing the old hslibs packages which should never be exposed by
default since they gobble too much of the module namespace.

Duncan
(on behalf of the Gentoo Haskell team)

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

Reply via email to