On Mon, 2008-08-04 at 16:33 +0100, Simon Peyton-Jones wrote:
> Ian
> 
> John discovered (we think) that a new feature of the build system is
> that all GHC's source modules must be listed by the developer in
> ghc.cabal.

Yes.

> Actually gets a long way without this, but there's a confusing link
> error later.

Yes, that's rather unfortunate.
        
        http://hackage.haskell.org/trac/hackage/ticket/128
        "cabal building broken libraries when module list is not
        complete"
        (it's been an open ticker for over 1 year)

> (The old make system would just use whatever .hs files were around.)

As does Cabal, but only partly, which is the problem. We use ghc --make
to do the build part but then Cabal doesn't know about all the files ghc
--make found, so it doesn't know to link them into the library archive
file.

The solution is for Cabal not to use ghc --make and to do it's own
chasing of .hs files (and all other pre-processors). We've got a GSoC
student working on a project to do just this. Obviously this isn't a
quick fix.

> There's nothing wrong with this change, but I want to check that it's
> what you intend.

It's not intended, but it's been a limitation in Cabal since the
beginning and won't be fixed in Cabal for some time yet (not until after
the GSoC project is done and some more time to integrate it fully).

If we wanted a quicker fix, we could ask ghc --make not to look at any
files other than the ones we supply and if it find it needs extra
imports not satisfied by local files or given packages, for it to report
an error. This is kind of what we do to make sure we don't get untracked
package dependencies, ghc has the -hide-all-packages flag.

> And let's add a note to that effect in
> http://hackage.haskell.org/trac/ghc/wiki/Building/Files. I've drafted
> one - pls check

Looks fine. For what it's worth, it's also documented in the Cabal user
guide, not that people would look there to discover this information
that they don't know they need to know. Sigh.

Duncan

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to