eagletmt / ghcmod-vim

Happy Haskell programming on Vim, powered by ghc-mod
http://www.vim.org/scripts/script.php?script_id=4473
433 stars 59 forks source link

vimproc#get_command_name: File "ghc-mod" is not found. #42

Open mrt181 opened 10 years ago

mrt181 commented 10 years ago

I have installed spf13 vim, installed ghc-mod with cabal and compiled vimproc for cygwin.

I am running on Windows 7 64 with cygwin64 1.7.28.

When I open a haskell source file I get this error message: Error executing "function ghcmod#util#check_version..vimproc#system..139_system..vimproc#pgroup_open..139_pgroup_open..vimproc#plineopen3..139_plineopen..139_convert_args..vimproc#get_command_name": Line 15: E605: Not caught exception: vimproc#get_command_name: File "ghc-mod" is not found. Error executing "function ghcmod#util#check_version..vimproc#system..139_system..vimproc#pgroup_open..139_pgroup_open..vimproc#plineopen3..139_plineopen": Line 52: E170: Missing :endfor Error executing "function ghcmod#util#check_version": Line 2: E171: Missing :endif Error executing "/home/r892107/.spf13-vim-3/.vim/bundle/ghcmod-vim/after/ftplugin/haskell/ghcmod.vim": Line 15: E171: Missing :endif Error executing "function 26_LoadFTPlugin": Line 17: E170: Missing :endfor

eagletmt commented 10 years ago

Could you show me the output from the following commands?

:echo executable('ghc-mod')
:echo vimproc#get_command_name('ghc-mod')

An expected output is:

1
/path/to/your/ghc-mod
mrt181 commented 10 years ago

This is the output

:echo executable('ghc-mod')
1
:echo vimproc#get_command_name('ghc-mod')
Error executing "function vimproc#get_command_name":
Line   15:
E605: Not caught exception: vimproc#get_command_name: File "ghc-mod" is not found.
eagletmt commented 10 years ago

Hmm, that's strange. It seems that Vim can find your ghc-mod executable but vimproc cannot. Could you also show me the absolute path to ghc-mod and output from the following commands?

:echo $PATH
:echo has('win32unix')
:echo vimproc#filepath#which('ghc-mod')
:call system('ghc-mod') | echo v:shell_error
mrt181 commented 10 years ago

Absolute path to ghc-mod

C:\Users\martin\AppData\Roaming\cabal\bin\ghc-mod.exe
:echo $PATH
/usr/local/bin:/usr/bin:/c/Users/martin/AppData/Roaming/cabal/bin:/c/Program Files (x86)/Haskell/bin:/c/Program Files (x86)/Haskell Platform/2013.2.0.0/lib/extralibs/bin:/c/Program Files (x86)/Haskell Platform/2013.2.0.0/bin:/c/Oracle/Client/11.2.0.3/bin:/c/Program File
s/Common Files/Microsoft Shared/Microsoft Online Services:/c/Program Files (x86)/Common Files/Microsoft Shared/Microsoft Online Services:/c/Program Files (x86)/Java/jdk1.6.0/bin:/c/Oracle/Client/11.2.0.3_64/bin:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/W
INDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/Microsoft Application Virtualization Client:/c/Program Files (x86)/Enterprise Vault/EVClient:/c/Program Files (x86)/Microsoft ASP.NET/ASP.NET Web Pages/v1.0:/c/Program Files/Microsoft SQL Server/110/Tools/Binn
:/c/Program Files (x86)/Microsoft SQL Server/100/Tools/Binn/VSShell/Common7/IDE:/c/Program Files (x86)/Microsoft SQL Server/100/Tools/Binn:/c/Program Files/Microsoft SQL Server/100/Tools/Binn:/c/Program Files (x86)/Microsoft SQL Server/100/DTS/Binn:/c/TIBCO/TIBRV/BIN:/e/
apache-ant-1.8.4/bin:/c/Program Files (x86)/Java/jdk1.6.0/bin:/e/apache-maven-3.1.1/bin:/c/Program Files (x86)/GNU/GnuPG/pub:/c/Program Files (x86)/TIBCO/TIBRV/bin:/c/Program Files (x86)/Calibre2:/e/sbt/bin:/c/ZeroMQ/bin:/c/Program Files (x86)/Haskell Platform/2013.2.0.0
/mingw/bin:/e/0MQ/jzmq/lib:/c/Program Files (x86)/Windows Kits/8.1/Windows Performance Toolkit:/c/Program Files/Microsoft/Web Platform Installer:/c/Program Files/TortoiseGit/bin:/usr/bin:/
:echo has('win32unix')
1
:echo vimproc#filepath#which('ghc-mod')
E119: Too few arguments for function: vimproc#filepath#which
E15: invalid expression: vimproc#filepath#which('ghc-mod')
:call system('ghc-mod') | echo v:shell_error
1
eagletmt commented 10 years ago

Sorry, :echo vimproc#filepath#which('ghc-mod', $PATH) is the correct command I'd like you to execute.

But anyhow, I could reproduce your situation after changing cygdrive by mount -c /. I'm investigating what causes it. Thanks.

mrt181 commented 10 years ago

executing this

:echo vimproc#filepath#which('ghc-mod', $PATH)
Error executing  "function neocomplcache#init#lazy..neocomplcache#init#_sources..neocomplcache#sources#ghc#define..necoghc#ghc_mod_version..<SNR>187_system..vimproc#system..<SNR>179_system..vimproc#pgroup_open..<SNR>179_pgroup_open..vimproc#plineopen3..<SNR>179_
plineopen..<SNR>179_convert_args..vimproc#get_command_name":
Line   15:
E605: Not caught exception: vimproc#get_command_name: File "ghc-mod" is not found.

This is my cygwin fstab:

none / cygdrive binary,posix=0,user 0 0
eagletmt commented 10 years ago

I found that :echo glob('/[Cc]') returns empty string even if :echo glob('/C') returns 'C' and :echo glob('/c') returns 'c' when mount -c / is applied. vimproc uses glob() to get canonicalized path (I guess).

By the way, mount -c /; ls / doesn't contain the c directory though /c is an accessible directory. Is it a correct behavior for Cygwin? I'm unfamiliar with Cygwin.

eagletmt commented 10 years ago

Cygwin behaves strange with mount -c /...

An workaround to this issue is to set cygdrive prefix to other that / :pensive:

mrt181 commented 10 years ago

Setting fstab to

none / cygdrive binary,posix=0,user 0 0

removes the need to enter a prefix when trying to access the mounted virtual drives. You can than navigate around your drives like that

$ cd /c/Users
$ pwd
/c/Users

he default setting in cygwin is

none /cygdrive cygdrive binary,posix=0,user 0 0

Reverting back to the default setting you now need to do this to navigate around

$ cd /cygdrive/c/Users
$ pwd
/cygdrive/c/Users

With the prefix vimproc works again. Thank you

zekzekus commented 9 years ago

i guess i have this same problem but i am on mac os x. looks like vimproc can't find ghc-mod executable.