Exafunction / codeium.nvim

A native neovim extension for Codeium
MIT License
763 stars 57 forks source link

Executable somomtimes not found #17

Closed ghost closed 1 year ago

ghost commented 1 year ago

For some reason, sometimes, the executable can't be found. It reports this error:

server updated                                                                                                                                                                                                                                                        
Error executing vim.schedule lua callback: ...im/site/pack/paqs/start/plenary.nvim/lua/plenary/job.lua:106: /home/<username>/.codeium/bin/1.1.24/language_server_windows_x64.exe: Executable not found
stack traceback:
        ...im/site/pack/paqs/start/plenary.nvim/lua/plenary/job.lua:106: in function 'job'
        ...im/site/pack/paqs/start/codeium.nvim/lua/codeium/api.lua:194: in function 'start'
        ...m/site/pack/paqs/start/codeium.nvim/lua/codeium/init.lua:13: in function 'callback'
        ...site/pack/paqs/start/codeium.nvim/lua/codeium/update.lua:67: in function 'callback'
        ...vim/site/pack/paqs/start/codeium.nvim/lua/codeium/io.lua:320: in function 'set_executable'
        ...site/pack/paqs/start/codeium.nvim/lua/codeium/update.lua:61: in function 'chmod'
        ...site/pack/paqs/start/codeium.nvim/lua/codeium/update.lua:80: in function 'fn'
        ...vim/site/pack/paqs/start/codeium.nvim/lua/codeium/io.lua:26: in function 'cb'
        vim/_editor.lua:248: in function <vim/_editor.lua:247>
stack traceback:
        [C]: in function 'error'
        ...im/site/pack/paqs/start/plenary.nvim/lua/plenary/job.lua:106: in function 'job'
        ...im/site/pack/paqs/start/codeium.nvim/lua/codeium/api.lua:194: in function 'start'
        ...m/site/pack/paqs/start/codeium.nvim/lua/codeium/init.lua:13: in function 'callback'
        ...site/pack/paqs/start/codeium.nvim/lua/codeium/update.lua:67: in function 'callback'
        ...vim/site/pack/paqs/start/codeium.nvim/lua/codeium/io.lua:320: in function 'set_executable'
        ...site/pack/paqs/start/codeium.nvim/lua/codeium/update.lua:61: in function 'chmod'
        ...site/pack/paqs/start/codeium.nvim/lua/codeium/update.lua:80: in function 'fn'
        ...vim/site/pack/paqs/start/codeium.nvim/lua/codeium/io.lua:26: in function 'cb'
        vim/_editor.lua:248: in function <vim/_editor.lua:247>

I'm running on Linux, so I don't know why it even bothers checking for the windows executable? Anyway, the executable is accessable in the directory so honestly don't know why it sometimes can't find it.

jcdickinson commented 1 year ago

This can happen if calling out to uname fails for some reason. I'll add logging tonight for uname output.

ghost commented 1 year ago

Oh okay. :) Don't know why uname sometimes fails here.

jcdickinson commented 1 year ago

I have pushed a commit that adds a debug for this failing:

export DEBUG_CODEIUM=debug
nvim

You will then find the log under ~/.cache/nvim/codeium.log

luiz00martins commented 1 year ago

I was able to replicate this issue on Windows, which of course doesn't have uname. Is windows not currently supported?

ghost commented 1 year ago

You will then find the log under ~/.cache/nvim/codeium.log

I'm not sure, but here it seems as if it can't find the executable, nothing gets logged and most plugins gets disabled (which is what normally happens when a plugin failes for one reason or another). Maybe it would be better with and option that lets the user set the path to the executable?

jcdickinson commented 1 year ago

Maybe it would be better with and option that lets the user set the path to the executable?

You can use the tools.language_server option to do this.

A-Lamia commented 1 year ago

have this error on windows, doesn't install just errors: uname: Executable not found, I'm not sure if it's even downloading it.

Even when manually setting locations for the language_server it doesn't work.

jcdickinson commented 1 year ago

@A-Lamia Windows is not currently supported, as I no longer have a license to do development+testing. This will require a PR.

SuperCuber commented 1 year ago

@jcdickinson I haven't developed a plugin (and don't know much lua) before but I am getting the same error uname: Executable not found on windows. the stack trace leads me to this line in plenary, that is called from this line in codeium.nvim

Is it possible to try-catch on this and assume windows if it fails?

jcdickinson commented 1 year ago

I could, but then more things would fail. This code should never be executed if the server binary is up to date. You could try manually downloading the binary: https://github.com/Exafunction/codeium/releases/tag/language-server-v1.1.42

Then use the tools.language_server config option to point the plugin at it.

iven commented 1 year ago

I resolved this issue in Linux by chmod +x ~/.cache/nvim/codeium/bin/1.1.42/language_server_macos_x64.

ww-daniel-mora commented 1 year ago

@CroPhYPtic can you update and see if this is still an issue?

jcdickinson commented 1 year ago

This should be fixed with the use of vim.loop.os_uname()

ghost commented 1 year ago

@CroPhYPtic can you update and see if this is still an issue?

Sorry for a very late reply. I've been doing things withoiut AI help for a while. This issue seems to be solved. :)

This should be fixed with the use of vim.loop.os_uname()

Yep, it seems to be fixed. :)