Open vendion opened 1 year ago
please try running
cd ~/.local/share/nvim/lazy/tabnine-nvim
./dl_binaries.sh
If that doesn't fix the problem, could you share more information about your machine?
If you try this command, it should output what neovim thinks your system details are.
$ nvim --headless '+lua =vim.inspect(vim.loop.os_uname())' '+qa'
Inspecting the code, it seems that the arch_and_platform
function is the only thing on this line that could return a nil
value. I wonder if @vendion is using an unsupported combo (like arm64 linux) or a unix distribution such as freebsd
(also unsupported).
Yes, in this case I'm running FreeBSD, but that doesn't justify spamming me with the above error to the point that neovim is unusable. Instead of constantly throwing this error, if the plugin detects the platform is unsupported then it should stop trying to load or error silently rather than having me hit <Enter>
multiple times a second.
Now to be fair, FreeBSD does has the ability to run Linux binaries, so it is possible the amd64 Linux binary could work (similar to using wine to run Windows programs on Unix-like OS) but that is a different matter.
My use case isn't that uncommon, as I share all my configs across all my machines via a VCS repo (https://gitlab.com/vendion/dotfiles) which includes FreeBSD machines (amd64) and Linux (amd64, aarch64).
To be clear, I'm not saying this is intended behavior, I was simply hypothesizing about the cause of the issue
I wonder if just returning an empty string would even cause any issues...
something like this:
if os_uname.sysname == "Linux" and os_uname.machine == "x86_64" then
return "x86_64-unknown-linux-musl"
elseif
-- ...
else
return ""
end
the binary would not be found, causing the uv.spawn
to return nil, and I think there's enough checks to ensure that doesn't throw an error?
Though in the long term, detecting unsupported configurations is a much better idea.
same problem
we were trying to resolve this at #82, but it seemed to stagnate when @amirbilu got busy. i'd appreciate more eyes on that code, or else another (replacement) PR with whatever Amir has in mind
I had this exact problem while on an ARM linux machine (asahi fedora to be precise).
The fix I made was more or less following the conversation thread here. I narrowed the nil value output down to the case statements in arch_and_platform()
, which did not account for the aarch64 linux platform.
This is the change I ended up making in binary.lua:
local function arch_and_platform()
local os_uname = uv.os_uname()
if os_uname.sysname == "Linux" and os_uname.machine == "x86_64" then
return "x86_64-unknown-linux-musl"
-- REDFLAME2112: Added this line to help support aarch64 linux...
elseif os_uname.sysname == "Linux" and os_uname.machine == "aarch64" then
return "aarch64-unknown-linux-gnu"
elseif os_uname.sysname == "Darwin" and os_uname.machine == "arm64" then
return "aarch64-apple-darwin"
elseif os_uname.sysname == "Darwin" then
return "x86_64-apple-darwin"
elseif os_uname.sysname == "Windows_NT" and os_uname.machine == "x86_64" then
return "x86_64-pc-windows-gnu"
elseif os_uname.sysname == "Windows_NT" then
return "i686-pc-windows-gnu"
end
end
:)
Tabnine now offers arm64 support.. is there anyone here who will be willing to test it?
Yes, I would be interested in trying it.
@vendion I'm unable to test it atm as I don't have an access to an arm machime, can you please test this? https://github.com/codota/tabnine-nvim/pull/179/files Please make sure to run dl_binaries.sh first.
Appreciate your feedback!
Merging this for now.. let me know if you have any issue
With the latest version of tabnine-nvim I get the following error message whenever I open Neovim:
Worse is whenever I dismiss this error it comes back up a few seconds later.