I think the only sane choice is to install haddock with ghc. Some
people may have multiple GHCs installed, some system-wide and some in
their home directory. I think it is generally impossible to guess for
an installer which version of which ghc to use.
Manuel
Ian Lynagh:
Hi all,
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.
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.
Alternatively, we could build haddock and haddock the libraries, but
not
ship haddock with GHC. I think that some people prefer this anyway.
However, if we do that, people need to make sure that they install a
version of haddock that is compatible with their .haddock files.
There's also a problem where, at the point we are configuring the
libraries, we can't tell Cabal where haddock is because we haven't
built
it yet. I think that the best way around this is to add a
--with-haddock=PATH flag to "Setup haddock".
So currently I'm thinking that the best way is:
* Build the ghc-paths library when building GHC, but don't install it
* Build haddock when building GHC, but don't install it
* Add the above flag to Cabal
* Advertise as best we can which version of haddock people need to
work
with a given GHC binary distribution
Any comments?
Thanks
Ian
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc