Opened 7 years ago

Closed 7 years ago

#4266 closed bug (fixed)

ghci can't find ghc.exe on Windows 7 if the path contains spaces

Reported by: refold Owned by:
Priority: high Milestone: 7.0.1
Component: GHCi Version: 6.12.3
Keywords: Cc:
Operating System: Windows Architecture: x86_64 (amd64)
Type of failure: GHCi crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


This was first reported on the Haskell Platform trac. Platform installer puts binaries in $PROGRAMFILES\Haskell Platform\$PLATFORMVERSION\bin, and this causes ghci to fail on Windows 7 (but not XP!) with 'Unable to locate ghc.exe' when run from the command line. Installing HP to C:\hp2010 fixes the issue.

Looking at ghci.c, this is caused either by a call to SearchPath, or a call to GetShortPathName. The latter looks more suspect. I don't have access to a Windows 7 machine currently, so I can't fix this myself.

Attachments (1)

ghci-space.patch (1.7 KB) - added by refold 7 years ago.
Proposed fix

Download all attachments as: .zip

Change History (4)

comment:1 Changed 7 years ago by simonmar

Milestone: 6.14.1
Priority: normalhigh

Changed 7 years ago by refold

Attachment: ghci-space.patch added

Proposed fix

comment:2 Changed 7 years ago by refold

Status: newpatch

The attached patch fixes the issue on Windows 7 by removing the call to GetShortPathName.

comment:3 Changed 7 years ago by igloo

Resolution: fixed
Status: patchclosed

Thanks for the report and patch. Happily, GetShortPathName is no longer used in the ghci wrapper in the HEAD. I've opened #4275 for the last remaining call to GetShortPathName.

Note: See TracTickets for help on using tickets.