[haskell-platform] #136: Windows error: "ghci: Unable to locate ghc.exe"
haskell-platform
haskell-platform at projects.haskell.org
Tue Aug 24 19:36:12 EDT 2010
#136: Windows error: "ghci: Unable to locate ghc.exe"
-------------------------------+--------------------------------------------
Reporter: mcandre | Owner: refold
Type: defect | Status: reopened
Priority: major | Milestone: 2010.2.0.0
Component: Windows installer | Resolution:
Keywords: |
-------------------------------+--------------------------------------------
Comment (by mcandre):
I downloaded [http://darcs.haskell.org/ghc-6.12/ghc/driver/ghci/ghci.c
ghci.c]. There are only two entry paths to print the {{{Unable to locate
ghc.exe}}} error message: lines 81-90 and lines 92-98.
{{{
/* Locate the binary we want to start up */
if ( !SearchPath(NULL,
BINARY_NAME,
NULL,
dwSize,
(char*)binPath,
&szEnd) ) {
errmsg1("%s: Unable to locate ghc.exe", argv[0]);
return 1;
}
dwSize = MAX_PATH;
/* Turn the path into short form - LFN form causes problems
when passed in argv[0]. */
if ( !(GetShortPathName(binPath, binPathShort, dwSize)) ) {
errmsg1("%s: Unable to locate ghc.exe", argv[0]);
return 1;
}
}}}
There appears to be an inconsistency in the code. {{{SearchPath}}} on line
86 casts {{{binPath}}} to a character pointer. Strangely,
{{{GetShortPathName}}} on line 95 does not.
According to Microsoft documentation, both functions should use
{{{LPCTSTR}}}s; in other words, {{{TCHAR}}}s. If I'm wrong, then both
should use char pointers. Either way, both should be passing the same
types. But they're not.
If the wrong type is being passed to one of these functions, then the
functions may return {{{NULL}}}, which would result in the error being
printed.
Is any particular compiler used to create ghci.exe? I'm not sure if I
should use Cygwin, MinGW, Visual Studio, or some other compilation system.
--
Ticket URL: <http://trac.haskell.org/haskell-platform/ticket/136#comment:13>
haskell-platform <http://trac.haskell.org/haskell-platform>
The Haskell Platform: a comprehensive and robust collection of Haskell libraries
More information about the Haskell-platform
mailing list