nlua.nvim icon indicating copy to clipboard operation
nlua.nvim copied to clipboard

Error while executing scripts/download_sumneko.lua

Open luishgh opened this issue 4 years ago • 9 comments

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

luishgh avatar Feb 10 '21 12:02 luishgh

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

mnowotnik avatar Feb 21 '21 22:02 mnowotnik

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).

mnowotnik avatar Feb 21 '21 22:02 mnowotnik

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?

luishgh avatar Feb 23 '21 22:02 luishgh

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

dtomvan avatar Apr 15 '21 12:04 dtomvan

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:

  • Changed timeout to 100000, but I guess a value lower would possibly work as well, however up until 20000 wasnt enough for me
  • I changed the first argument in line 56 to this, I think it should work with everybody as it doesn't use an absolute path:
    directory .. "3rd/luamake/luamake", "rebuild",

luishgh avatar Apr 16 '21 20:04 luishgh

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.

luishgh avatar Apr 16 '21 21:04 luishgh

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

mnowotnik avatar Apr 16 '21 22:04 mnowotnik

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.

luishgh avatar Apr 16 '21 22:04 luishgh

Nice work!

mnowotnik avatar Apr 16 '21 22:04 mnowotnik