Ticket #546 (new defect)
Opened 4 years ago
look for haddock in ghc's bin dir before using findExecutable
| Reported by: | duncan | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Cabal-1.8 |
| Component: | Cabal library | Version: | 1.6.0.2 |
| Severity: | normal | Keywords: | |
| Cc: | ndmitchell@… | Difficulty: | easy (<4 hours) |
| GHC Version: | Platform: | Windows |
Description
With current versions of haddock it's important to pick a version that's consistent with the ghc in use. Normally we use System.Directory.findExecutable to find tools like haddock. However on Windows, the Win32 SearchPath function looks not just in the %PATH%. It looks first in the directory where the .exe of the current process lives (which might either be runghc.exe or it might be cabal.exe) and only secondarily in the %PATH%.
So, for ghc, Cabal should look for haddock first in ghc's bin dir and then if it's not there, use findExecutable to look in various other places.
Reported originally on the mailing list and as a ghc ticket.
