Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module 'lfs' not found #11

Closed
Stanzilla opened this issue Oct 11, 2020 · 9 comments
Closed

module 'lfs' not found #11

Stanzilla opened this issue Oct 11, 2020 · 9 comments

Comments

@Stanzilla
Copy link

@Stanzilla Stanzilla commented Oct 11, 2020

Hey there, I'm trying to run the standalone executable with https://atom.io/packages/linter-luacheck in Atom. I get the following error message when doing so:

[Linter] Error running Luacheck Error: [string "luacheck.fs"]:3: module 'lfs' not found:
	no field package.preload['lfs']
	no module 'lfs' in luastatic bundle
stack traceback:
	[C]: in function 'require'
	[string "luacheck.fs"]:3: in main chunk
	[C]: in function 'require'
	[string "luacheck.cache"]:1: in main chunk
	[C]: in function 'require'
	[string "luacheck.main"]:2: in main chunk
	[C]: in function 'require'
	[string "bin.luacheck"]:7: in local 'func'
	[string "luacheck"]:41: in main chunk
    at ChildProcess.<anonymous> (C:\Users\WDAGUtilityAccount\.atom\packages\linter-luacheck\node_modules\sb-exec\lib\index.js:56:20)
    at ChildProcess.emit (events.js:194:13)
    at maybeClose (internal/child_process.js:998:16)
    at Socket.<anonymous> (internal/child_process.js:403:11)
    at Socket.emit (events.js:194:13)
    at Pipe.<anonymous> (net.js:593:12)
@alerque
Copy link
Member

@alerque alerque commented Oct 12, 2020

This is not a problem with luacheck itself. It has a dependency on luafilesystem, and however you are installing it isn't also installing the dependency correctly. I haven't dug into how the extension is installing Lua code, but either it needs to install this itself or perhaps it expects you to install it to your system first. Or perhaps it is installing it but doesn't set the include path correctly.

In any case this should be reported to the plugin's issue tracker.

@Stanzilla
Copy link
Author

@Stanzilla Stanzilla commented Oct 12, 2020

The extension requires you to install luacheck yourself, but I guess it assumes it comes with lfs which is fair since when you install luacheck via luarocks it does indeed install lfs?

@alerque
Copy link
Member

@alerque alerque commented Oct 12, 2020

If you are expected to install this yourself, yes of course you are expected to install LFS. It's listed as a dependency and using luarocks install will automatically take care of that. If you install any other way you need to take care of the dependencies yourself. Distro packages for example often use their own dependency resolution, so they would be responsible for getting this right.

@Stanzilla
Copy link
Author

@Stanzilla Stanzilla commented Oct 12, 2020

I assumed that installing luacheck via luarocks installs lfs but I just checked and it doesn't. that was why I assumed it would work :)

@alerque
Copy link
Member

@alerque alerque commented Oct 12, 2020

I take some of this back, LFS is not even listed as luacheck dependency. I was looking at something else. It does appear that the builder/installer assumes it as part of the luastatic compilation.

So yes there is a bug here. But it's not in the default build process either. Using Luarocks to install seems to result in a working system without even touching the Makefile where this shows up. The header of that file suggests it's only for cross compiling a binary with everything bundled.

I suggest just installing the normal way of either using your distro package manager (if packages exist for it) or using luarocks install.

@matthiesenj
Copy link

@matthiesenj matthiesenj commented Dec 18, 2020

This problem also exists for the windows binary download version linked on the front page (which states it includes e.g. lfs). The version in the same link in Peter's original repo doesn't have this problem, however.

@hemmerling
Copy link

@hemmerling hemmerling commented Mar 7, 2021

This problem also exists for the windows binary download version linked on the front page (which states it includes e.g. lfs). The version in the same link in Peter's original repo doesn't have this problem, however.

The binary of 0.23 is compiled properly
https://github.com/mpeterv/luacheck/releases/download/0.23.0/luacheck.exe
, but it is not 0.24
For 0.23, there is no 32bit and 64bit version.
For 0.24, there are 32bit and 64bit versions.

By adding a complete installation of MinGW 6.3 by its setup utility
https://sourceforge.net/projects/mingw/files/Installer/
and the LuaRocks binaries
https://github.com/luarocks/luarocks/wiki/Installation-instructions-for-Windows
, I was unable to fix the abort of the 0.24 binaries.

@hishamhm
Copy link
Member

@hishamhm hishamhm commented Aug 10, 2021

Sorry for the late response!

I just pushed 0.25.0. The binary should have its bundled lfs dependency fixed.

Luacheck is in need of new maintainers — I'm doing minimal administrative work around it, as time permits, until someone else comes up to take up the project (even if only to do this minimal administrative work more responsively than I'm able to).

If you're still interested in helping out in any way, please reach out via hisham@luarocks.org and let's get something sorted! Thanks!

@hishamhm
Copy link
Member

@hishamhm hishamhm commented Aug 10, 2021

I'm closing this issue for now, feel free to reopen if the binaries are still broken.

@hishamhm hishamhm closed this Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants