exposed packages and cabal depends

Simon Marlow simonmar at microsoft.com
Fri Apr 1 03:44:56 EST 2005


On 31 March 2005 23:15, Isaac Jones wrote:

> Ian Lynagh mentioned this problem to me a few weeks ago and Alex's
> thread reminded me of it.  This doesn't really relate to Alex's
> proposal, so I'm starting a new thread.
> 
> Let's say that from GHC's perspective, package A is exposed and
> package B is hidden.  Angela Author creates package C which
> build-depends on both A and B.  She incorrectly lists the
> build-depends on B, but not on A.  While building, she doesn't notice,
> since A is an exposed package.
> 
> This kinda sucks, since it would be nice to check build-dependencies
> at build time.  This is very similar to the situation in Debian where
> a packager doesn't realize that there's a build-dependency on A, since
> she's already got it installed, but when the auto-builders get to it,
> the build fails since they don't have A installed.
> 
> I don't know how to solve this; is there a way to require explicit
> -package flags for all packages in ghc 6.4?  If there were, say
> -fhide-all-packages, then cabal could use that while building and
> Angela would catch the error of her ways much earlier.
> 
> I think the situation for "run-time" dependencies is similar.

You can find the dependencies in .hi files.  eg:

  $ ghc --show-iface Main.hi | grep '^package dep'
  package dependencies: base-1.0 haskell98-1.0

The dependencies for the whole library are the union of the package
dependencies of the exposed modules.  It should be pretty easy to
implement './setup check-dependencies' in Cabal.

Perhaps ghc --make could have an option to print the dependencies at the
end of compilation, too.

Cheers,
	Simon


More information about the Libraries mailing list