haskell-idea-plugin icon indicating copy to clipboard operation
haskell-idea-plugin copied to clipboard

ghc-mod and ghc-modi problem

Open mickeyvip opened this issue 11 years ago • 13 comments

IntelliJ 14.0.1, Haskell 0.4.1-beta, Windows 8.1

Settings in IntelliJ for Haskell:

Setting Value
cabal executable cabal
cabal data path C:\Users\Me\AppData\Roaming\cabal
ghc-mod execuable C:\Users\Me\AppData\Roaming\cabal\bin\ghc-mod.exe
ghc-modi execuable C:\Users\Me\AppData\Roaming\cabal\bin\ghc-modi.exe

Project is compiled and ran OK.

Clicking Ctrl+Shift+T on some symbol produces the error:

ghc-modi failed
ghc-modi failed with error: NG BUG: GMEString "user error (ghc not found)"
You can disable ghc-modi in Settings | Haskell

If "Use ghc-mod automatic check" is checked - the above error keeps appearing on each key-down as I type.

Thank you.

mickeyvip avatar Dec 07 '14 20:12 mickeyvip

ghc-modi can't find ghc. Try to add ghc to your PATH.

atsky avatar Dec 08 '14 14:12 atsky

Just re-checked - the ghc is on my path (D:\Programming\Haskell Platform\2014.2.0.0\bin), but I keep getting the error.

Also what should be set for cabal data path? I'm new to cabal.

mickeyvip avatar Dec 09 '14 20:12 mickeyvip

Oh. I think have found a bug, but a have no Windows machine to check. Is ghc path is last in your PATH variable? cabal data path is path where cabal stores packages. There must be folder repo-cache.

atsky avatar Dec 10 '14 17:12 atsky

It is not last. The ghc.exe is in D:\Programming\Haskell Platform\2014.2.0.0\bin

> echo %PATH%
D:\Programming\Haskell Platform\2014.2.0.0\lib\extralibs\bin;
D:\Programming\Haskell Platform\2014.2.0.0\bin;
C:\ProgramData\Oracle\Java\javapath;
C:\Windows\system32;
C:\Windows;
C:\Windows\System32\Wbem;
C:\Windows\System32\WindowsPowerShell\v1.0\;
D:\Programming\Haskell Platform\2014.2.0.0\mingw\bin;
C:\Users\Mickey\AppData\Roaming\cabal\bin;

I cannot find repo-cache folder on my PC. The closest I have is C:\Users\Mickey\AppData\Roaming\cabal\packages.

By the way, cabal.exe exists in D:\Programming\Haskell Platform\2014.2.0.0\lib\extralibs\bin and in C:\Users\Mickey\AppData\Roaming\cabal\bin. I have rename the one in D:\Programming\Haskell Platform\2014.2.0.0\lib\extralibs\bin in order to make the updates work correctly.

mickeyvip avatar Dec 10 '14 21:12 mickeyvip

You have to set cabal data path to D:\Users\Mickey\AppData\Roaming\cabal.

atsky avatar Dec 11 '14 11:12 atsky

Thank you

mickeyvip avatar Dec 11 '14 11:12 mickeyvip

IntelliJ IDEA 14.0.2, Haskell Platform 2014.2.0.0. Having the same issue. The command line is being able to find out ghc.exe, so it must be in the PATH, however this plugin claims ghc not found. No solution suggested above worked.

ryo0ka avatar Jan 15 '15 08:01 ryo0ka

I meet the same issue... And also meet this: AssertionError: Wrong line separators: '...not found)\r\n' at offset 49

wuciawe avatar Apr 05 '15 11:04 wuciawe

Same problem.

ka3a4ok avatar May 16 '15 13:05 ka3a4ok

Open IDE. Create project - all works fine. Close IDE, open IDE, open creaed projects - errors starting.

ghc-modi failed ghc-modi failed with error: NG BUG: GMEIOException user error (ghc not found) You can disable ghc-modi in Settings | Haskell

ka3a4ok avatar May 16 '15 15:05 ka3a4ok

@ka3a4ok Copy ghc.exe to the same directory as ghc-modi. Use where ghc-modi and where ghc to see where they are.

edit: you also need to move cabal.exe somewhere else. It can't be in the same directory as the new copy of ghc.exe or cabal init, cabal configure, etc... won't work anymore.

mtomassoli avatar Jun 16 '15 09:06 mtomassoli

So I suddenly started having this problem today. Everything was working perfectly, and when I booted up and launched IntelliJ this morning, ghc-modi is broken with this same error message. As far as I can tell, everything is in the correct place (Haskell Platform, cabal data path.) Nothing should have changed.

0culus avatar Jun 19 '15 15:06 0culus

@mtomassoli Thank you, that fixed the issue. I made a symbolic link to ghc.exe in the place where ghc-modi.exe was located.

freeman42x avatar Jul 05 '15 18:07 freeman42x