Ian Lynagh wrote:

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

Does it? I'm looking at the http://code.haskell.org/haddock/ repo, and
as far as I can see haddock's getGhcLibDir just looks at the commandline
flags for the path to use, falling back to the ghc-paths path if no flag
is given. And grepping for GetModuleFileName doesn't find anything.

Or have I misunderstood what you meant?

I just meant that Haddock already uses Paths_haddock to get the location of its own support files, which on Windows will be constructing a path relative to the binary location. If the GHC libdir is in a fixed location relative to Haddock's support files (in a Windows installer), it's easy.


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?

If you have

    Flag ghcPaths

    if flag(ghcPaths)
        Build-Depends: ghc-paths

then there's no reason for that flag ever to be turned on. I'm not sure
what cabal-install does, but if you try and build it manually with Cabal
and don't have ghc-paths installed then Cabal will happily build it for
you without ghc-paths.

Hmm. We want a flag that isn't subject to Cabal's automatic resolution. Duncan, is there any way to do what we want here?

Cheers,
        Simon

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

Reply via email to