tjdevries / nlua.nvim

Lua Development for Neovim
MIT License
262 stars 21 forks source link

Error while executing scripts/download_sumneko.lua #20

Open luishgh opened 3 years ago

luishgh commented 3 years ago

Got this error while executing :luafile scripts/download_sumneko.lua I don't know if it is an issue or I have done something wrong, sorry if this is the case.

E5113: Error while calling lua chunk: ...hgh/.config/nvim/bundle/plenary.nvim/lua/plenary/job.lua:80: ./3rd/luamake/luamake: Executable not found
stack traceback:
        ...hgh/.config/nvim/bundle/plenary.nvim/lua/plenary/job.lua:80: in function 'new'
        scripts/download_sumneko.lua:16: in function 'run'
        scripts/download_sumneko.lua:55: in function 'build'
        scripts/download_sumneko.lua:62: in main chunk
mnowotnik commented 3 years ago

Same. Seems like there is a bug in plenary since args seem alright.

mnowotnik commented 3 years ago

Replace first argument in line "./3rd/luamake/luamake", "rebuild", with the full path to directory and it will work. You may also adjust timeout value (10000 = 10 sec).

luishgh commented 3 years ago

Replace first argument in line "./3rd/luamake/luamake", "rebuild", with the full path to directory and it will work.

Ok, will try it as soon as I have some free time.

You may also adjust timeout value (10000 = 10 sec).

How do I do this?

dtomvan commented 3 years ago

Fixed by running the 3rd/luamake/compile/install.sh myself

luishgh commented 3 years ago

Ok, will try it as soon as I have some free time.

Sorry for taking so long, free time has been really scarce for me recently :/.

I got this script to work, my changes were the following:

luishgh commented 3 years ago

The only thing I'm not sure now is what cwd to put on this. Now that the luamake executable is called with its full path, I think the cwd could be omitted. However, I don't know how plenary works and if this is possible. I will do a commit with cwd set to directory because it worked this way and link the PR to this issue.

mnowotnik commented 3 years ago

I think it's a bug in libuv https://www.ibm.com/support/pages/apar/IV76797 . cwd param has no effect on resolving relative path of an executable - the current working directory of the invoking process is used for that purpose.

TL;DR

@LuisHGH just make a PR with your workaround and call it a day, you can omit cwd param

luishgh commented 3 years ago

Just finished doing a few tests of the modified script and it seems to be working properly, will make the PR now.

you can omit cwd param

Actually the luamake rebuild fails if the cwd is not the lua-language-server folder:

/home/luishgh/.cache/nvim/nlua/sumneko_lua/lua-language-server/3rd/luamake/luamake: ...ua/lua-language-server/3rd/luamake/scripts/simu
lator.lua:105: /home/luishgh/make.lua: No such file or directory
stack traceback:
        [C]: in function 'assert'
        ...ua/lua-language-server/3rd/luamake/scripts/simulator.lua:105: in function 'simulator.dofile'
        ...lua-language-server/3rd/luamake/scripts/command/init.lua:4: in main chunk
        ...eko_lua/lua-language-server/3rd/luamake/scripts/util.lua:45: in function 'util.command'
        ...-language-server/3rd/luamake/scripts/command/rebuild.lua:9: in main chunk
        ...eko_lua/lua-language-server/3rd/luamake/scripts/util.lua:45: in function 'util.command'
        ...eko_lua/lua-language-server/3rd/luamake/scripts/main.lua:6: in main chunk
        [C]: in function 'require'
        ...lua/sumneko_lua/lua-language-server/3rd/luamake/main.lua:5: in main chunk
        [C]: in ?

So this section of the code actually stayed how it was.

mnowotnik commented 3 years ago

Nice work!