tzachar / compe-tabnine

TabNine source for hrsh7th/nvim-compe
BSD 3-Clause "New" or "Revised" License
52 stars 3 forks source link

[Bug] TabNine keep downloading itself making it unusable with compe-tabnine Neovim plugin #32

Open pidgeon777 opened 3 years ago

pidgeon777 commented 3 years ago

General Informations:

Issue Details:

My compe-tabnine plugin folder is structured as follows:

C:\Users\MyUsername\AppData\Local\nvim-data\site\pack\packer\start\compe-tabnine\binaries

Inside of the binaries folder, the following executables are placed:

The fact is that often, new files are created by TabNine when it updates itself, for example in this folder:

After the automatic update process, the newly created folder will contain:

As a result, the originally started process TabNine_Windows.exe will keep crashing because of the newly released TabNine update, which should be run instead. compe-tabnine plugin will detect TabNine_Windows.exe crash and it will try to start it again, in an endless loop. In the end, this makes Neovim unusable.

I only see three solutions for this annoying behaviour:

I would like to hear your opinion about this, and how could this be fixed. Until that, TabNine is not usable in Windows with the Neovim client.

pidgeon777 commented 3 years ago

https://github.com/codota/TabNine/issues/425

tzachar commented 3 years ago

If you look at the install script, Windows is not currently supported. Any patches fixing the issue are welcome; please make sure to handle all the different ways neovim can be installed in Windows.

pidgeon777 commented 3 years ago

I don't know if I have the necessary knowledge to do that.

Anyway, I would like to start from what seems to be the major issue: when running TabNine.exe, the process check if a new version exists. If yes, it downloads it to a different location, as shown above, and it terminate itself.

Is this behaviour caused by compe-tabnine, or it is related to TabNine itself?

tzachar commented 3 years ago

If you look at the install script, and check the binaries directory, you can see that we link to the last TabNine binary which was downloaded by compe-tabnine. The way TabNine works is that once it downloads a newer version of itself, it will usually exec the latest version available. TabNine will also look for the latest version installed once invoked and will start it. This all works on linux and mac, I realy don't know why it goes into an infinite loop on windows.

tzachar commented 3 years ago

Is this still an issue?

pidgeon777 commented 3 years ago

Yes. I'm trying to find a way to solve this issue in Windows 10.

Maybe making use of symbolic/hard links, as in Unix OS, could help?

We could link the current TabNine_Windows.exe executable to the newly downloaded executable, instead.

Some code in the LUA script which could check for patterns of the newly downloaded file path, and link TabNine_Windows.exe to that new executable, instead.

And do this everytime a new binary is downloaded (scan the base path looking for the newly downloaded binary).

The format of the newly downloaded binary is the one I described in my previous messages.

tzachar commented 3 years ago

Please try using #33 We dispense with the links there.