haddock 2 and GHC

Simon Marlow marlowsd at gmail.com
Tue Aug 19 06:26:24 EDT 2008


Ian Lynagh wrote:

> I've been thinking about haddock 2 and GHC, and it's not clear to me
> what the best way forwards is.
> 
> Haddock uses ghc-paths to work out where the GHC libdir is. This should
> work fine for running haddock in the tree, but it won't work for
> installing haddock as our builds are relocatable and ghc-paths bakes the
> paths in.
> 
> We could use a shell wrapper around haddock for unix-like systems, and
> add some code to haddock to automatically discover the location for
> Windows. However, this sort of code is fiddly, and a pain to keep
> working.

I chatted with Simon PJ about this today, and on second thoughts it doesn't 
seem so hard to install Haddock with GHC.  We have to do the wrapper script 
business for GHC itself anyway and you already added support to Cabal for 
this, so (I imagine) it shouldn't be too hard to do this for Haddock too. 
On Windows we'll need to use the usual trick for finding the path relative 
to the binary location, but that's standard stuff, and Haddock does it 
already - perhaps we can use the path we get back from Paths_Haddock to 
derive the libdir path to pass to GHC?

> However, haddock would still have to support ghc-paths for standalone
> builds. Also, I think that in a GHC tree we'd still have to pointlessly
> link against ghc-paths, as I can't see a simple way to avoid it.

Can't this be a conditional dependency?

Cheers,
	Simon



More information about the Cvs-ghc mailing list