mpeterv / luacheck

A tool for linting and static analysis of Lua code.
MIT License
1.92k stars 322 forks source link

Luacheck is completely unresponsive #111

Closed davisdude closed 7 years ago

davisdude commented 7 years ago

I installed Luacheck via LuaRocks and it is completely unresponsive to all commands. For instance, when I run luacheck --help, it hangs/freezes until I close it.

This is what luacheck.bat looks like:

@echo off
"C:\Program Files\lua\5.2.4\bin\lua.exe" -e "package.path=\"C:\\Users\\USERNAME\\AppData\\Roaming/luarocks/share/lua/5.2/?.lua;C:\\Users\\USERNAME\\AppData\\Roaming/luarocks/share/lua/5.2/?/init.lua;c:\\program files\\lua\\5.2.4\\/share/lua/5.2/?.lua;c:\\program files\\lua\\5.2.4\\/share/lua/5.2/?/init.lua;C:\\Program Files (x86)\\LuaRocks\\5.2/lua/?.lua;\"..package.path; package.cpath=\"C:\\Users\\USERNAME\\AppData\\Roaming/luarocks/lib/lua/5.2/?.dll;c:\\program files\\lua\\5.2.4\\/lib/lua/5.2/?.dll;\"..package.cpath" -e "local k,l,_=pcall(require,\"luarocks.loader\") _=k and l.add_context(\"luacheck\",\"0.20.0-1\")" "c:\program files\lua\5.2.4\\lib\luarocks\rocks\luacheck\0.20.0-1\bin\luacheck" %*
exit /b %ERRORLEVEL%

I'm using LuaRocks 2.4.2 with Lua 5.2.4.

mpeterv commented 7 years ago

What are versions of Luacheck dependencies (run luarocks show luafilesystem and luarocks show lanes)? Does it still happen if you forcefully remove them (luarocks remove --force luafilesystem and luarocks remove --force lanes)?

davisdude commented 7 years ago

I don't actually have lanes installed since it wasn't listed as a dependency, but here's the output for luarocks show luafilesystem:

LuaFileSystem 1.6.3-2 - File System Library for the Lua Programming Language

LuaFileSystem is a Lua library developed to complement the set of functions
related to file systems offered by the standard Lua distribution. LuaFileSystem
offers a portable way to access the underlying directory structure and file
attributes.

License:        MIT/X11
Homepage:       http://keplerproject.github.io/luafilesystem
Installed in:   c:\program files\lua\5.2.4\

Modules:
        lfs (c:\program files\lua\5.2.4\/lib/lua/5.2/lfs.dll)

Depends on:
        lua >= 5.1 (using 5.2-1)

Removing LuaFilesystem seems to do the trick... is there any way I can have both installed?

Edit: LuaCheck now works for individual files, but fails on directories

mpeterv commented 7 years ago

This implies that there is a problem with luafilesystem, what happens if you run lua -l lfs?

davisdude commented 7 years ago

lfs.dll was installed to lib\lua\5.2\ while Lua was looking for it in bin\. After moving the dll to bin\ , lua -l lfs now works correctly, but the operation of LuaCheck is still as described earlier (unresponsive)

mpeterv commented 7 years ago

So, lua -l lfs works, but luacheck --help hangs, is that right? But with luafilesystem uninstalled luacheck --help works. Is that correct?

davisdude commented 7 years ago

Not exactly. lua -l lfs works, but luacheck --help hangs. With luafilesystem uninstalled, luacheck works as expected, with the exception of directories.

davisdude commented 7 years ago

This is a problem with LuaFileSystem, not LuaCheck, so I'm closing