System.Directory.findExecutable and ghc's ld in Windows
Esa Ilari Vuokko
eivuokko at gmail.com
Fri May 12 08:23:55 EDT 2006
(please CC me as I am not subscribed)
Happens on Cabal darcs head and Windows with ghc.
In Distribution.Simple.GHC.build we try to invoke ld. In Windows
this file is found by deduction from ghc.exe path.
(foo\bin\ghc.exe -> foo\gcc-lib\ld.exe). When this absolute (rooted)
path is passed on to rawSystem*, it gets search through PATH
environment-variable in System.Directory.findExecutable
(or the version in Compat.)
System.Directory.findExecutable went through a rewrite for Windows
between 6.4 series and 6.5 - it now uses Windows API function
SearcPath which passes absolute paths straight throuhg, at least
on my system (Windows XP).
In the end, because 6.4.2 doesn't let absolute paths through,
we need a fix. What is the right way here? Assume ghc 6.4.3 and
get fix merged (see diff ); Add extra check for absolute path
and file existence on findExecutable (and propagate this fix to
base); Or inline the rawSystem* (as needed) in GHC.hs under
correct preprocessor if's? Oh, yeah, we can also say that ghci
libs just don't work under 6.4.x in Windows ;)
More information about the cabal-devel