Haddock vs GHC version

Hi, I'm getting the error: cabal: Haddock's internal GHC version must match the configured GHC version After cabal configure, cabal haddock. What went wrong? How do I fix it? Can that error message give version numbers, so its easier to track down in future. $ haddock --version Haddock version 2.4.2, (c) Simon Marlow 2006 Ported to use the GHC API by David Waern 2006-2008 $ haddock --ghc-version 6.10.2 $ ghc --version The Glorious Glasgow Haskell Compilation System, version 6.10.2 $ cabal --version cabal-install version 0.6.2 using version 1.6.0.3 of the Cabal library Thanks Neil

On Wed, 2009-04-22 at 08:52 +0100, Neil Mitchell wrote:
Hi,
I'm getting the error:
cabal: Haddock's internal GHC version must match the configured GHC version
After cabal configure, cabal haddock. What went wrong? How do I fix it?
Check the cabal configure -v output. Check that you're picking up the versions and locations of ghc and haddock that you expect.
Can that error message give version numbers, so its easier to track down in future.
Done. It now says: cabal: Haddock's internal GHC version must match the configured GHC version. The GHC version is 6.8.2 but haddock is using GHC version 6.10.1
$ haddock --version Haddock version 2.4.2, (c) Simon Marlow 2006 Ported to use the GHC API by David Waern 2006-2008
$ haddock --ghc-version 6.10.2
$ ghc --version The Glorious Glasgow Haskell Compilation System, version 6.10.2
That all looks sensible so my only suggestion is that it's not actually using these ones. Check the configure output and compare the full paths to the tools. If that provides now joy then in the worst case, use the patch I applied to show what it thinks it is doing. Duncan

Hi
Check the cabal configure -v output. Check that you're picking up the versions and locations of ghc and haddock that you expect.
I'm not, I get: Using haddock version 2.5.0 found on system at: C:\Program Files\Haskell\bin\haddock.exe But running haddock gives: $ haddock --version Haddock version 2.4.2, (c) Simon Marlow 2006 Ported to use the GHC API by David Waern 2006-2008 $ which haddock c:\ghc\ghc-6.10.2\bin\haddock.exe How come it's picking up a different haddock? Is that an error with the findExecutable, or is it deliberately trying to pick a newer version? Thanks Neil

On Wed, 2009-04-22 at 11:09 +0100, Neil Mitchell wrote:
Hi
Check the cabal configure -v output. Check that you're picking up the versions and locations of ghc and haddock that you expect.
I'm not, I get:
Using haddock version 2.5.0 found on system at: C:\Program Files\Haskell\bin\haddock.exe
But running haddock gives:
$ haddock --version Haddock version 2.4.2, (c) Simon Marlow 2006 Ported to use the GHC API by David Waern 2006-2008
$ which haddock c:\ghc\ghc-6.10.2\bin\haddock.exe
How come it's picking up a different haddock? Is that an error with the findExecutable, or is it deliberately trying to pick a newer version?
It's not looking for a newer version. It's looking for the first version that is on the Windows %PATH% env var. It looks like your real Windows %PATH% is not set to the same thing as your MSYS $PATH. I thought that MSYS made these consistent but perhaps not. In ghci, see what System.Environment.getEnv "PATH" says. Is it the same as MSYS's echo $PATH? I wonder if running export PATH in MSYS makes any difference. Duncan

Hi
How come it's picking up a different haddock? Is that an error with the findExecutable, or is it deliberately trying to pick a newer version?
It's not looking for a newer version. It's looking for the first version that is on the Windows %PATH% env var.
It looks like your real Windows %PATH% is not set to the same thing as your MSYS $PATH. I thought that MSYS made these consistent but perhaps not. In ghci, see what System.Environment.getEnv "PATH" says. Is it the same as MSYS's echo $PATH? I wonder if running export PATH in MSYS makes any difference.
I'm running under Windows command prompt under XP, so MSYS issues are irrelevant: $ echo %PATH% C:\Program Files\MiKTeX 2.7\miktex\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\Syste m32\Wbem;c:\Program Files\IBM\WebSphere MQ\bin;c:\Program Files\IBM\WebSphere MQ \Tools\c\Samples\Bin;C:\Program Files\Windows Imaging\;C:\Program Files\Graphviz 2.22\bin;C:\ghc\ghc-6.10.2\bin;C:\ghc\ghc-6.8.3\bin;C:\Program Files\Gtk2Hs\bin; C:\bin;C:\Program Files\Haskell\bin;C:\Program Files\Microsoft Office\OFFICE11;C:\ghc\ghc-6.10.2 I've got a haddock in C:\Program Files\Haskell\bin and another in C:\ghc\ghc-6.10.2\bin (and probably 6.8.3 as well). Is Cabal searching the path in the right order? Thanks Neil

On Wed, 2009-04-22 at 11:52 +0100, Neil Mitchell wrote:
How come it's picking up a different haddock? Is that an error with the findExecutable, or is it deliberately trying to pick a newer version?
It's not looking for a newer version. It's looking for the first version that is on the Windows %PATH% env var.
I've got a haddock in C:\Program Files\Haskell\bin and another in C:\ghc\ghc-6.10.2\bin (and probably 6.8.3 as well). Is Cabal searching the path in the right order?
For the record: it turns out that the answer is no. This is because the Win32 SearchPath function doesn't just search the %PATH%, it searches the directory containing the .exe of the currently running process, the current directory, the windows and system directories and finally it searches the %PATH%. So in this example, the cabal.exe program is in C:\Program Files\Haskell \bin and so Windows looks there first for haddock.exe despite the fact that C:\ghc\ghc-6.10.2\bin is earlier on the %PATH%. The workaround therefore is to get rid of a duplicate haddock or to specify the one to use explicitly. The ticket for a nicer solution is http://hackage.haskell.org/trac/hackage/ticket/546 Duncan
participants (2)
-
Duncan Coutts
-
Neil Mitchell