[GHC] #3186: findExeutable does not respect order of search
path on Windows
GHC
trac at galois.com
Wed Apr 22 18:48:38 EDT 2009
#3186: findExeutable does not respect order of search path on Windows
---------------------------------+------------------------------------------
Reporter: duncan | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: libraries/directory | Version: 6.10.2
Severity: normal | Resolution:
Keywords: | Testcase:
Os: Windows | Architecture: Unknown/Multiple
---------------------------------+------------------------------------------
Comment (by duncan):
Replying to [comment:4 NeilMitchell]:
> Ahh! That explains it! I am indeed running cabal from next to haddock.
Ok good, I'm glad we figured it out.
You win the prize for finding this month's most peculiar bug :-)
> I don't see why findExecutable is using the path you started the program
from. It seems reasonable to use the current directory first, but other
than that should jump straight to the %PATH%. For finding .dll's it makes
sense for findExecutable to try the relative to .exe path first, which I
suspect is why this behaviour exists.
Though the MSDN page says it should not be used for locating .dll files
because LoadLibrary uses a different order again.
> Cabal should probably check GHC bin dir for haddock anyway, given the
GHC/haddock dependency.
Yeah: http://hackage.haskell.org/trac/hackage/ticket/546
So, to close this ticket I think we just want to document that
`findExecutable` searches a whole bunch of dirs. We should pin it down.
The MSDN docs do not explicitly say. It's probably the exe dir, current
dir, windows and system dirs and then the %PATH% (and it's modified by
"safe search" in Vista I think).
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3186#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list