Opened 5 years ago

Closed 5 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 5 years ago.
Proposed fix

Download all attachments as: .zip

Change History (4)

comment:1 Changed 5 years ago by simonmar

  • Milestone set to 6.14.1
  • Priority changed from normal to high

Changed 5 years ago by refold

Proposed fix

comment:2 Changed 5 years ago by refold

  • Status changed from new to patch

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

comment:3 Changed 5 years ago by igloo

  • Resolution set to fixed
  • Status changed from patch to closed

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.