Saghen / blink.cmp

Performant, batteries-included completion plugin for Neovim
MIT License
1.32k stars 77 forks source link

Support old glibc and musl #160

Open xyven1 opened 1 month ago

xyven1 commented 1 month ago

When running blink.cmp on Ubuntu 18, I get the following error:

Error detected while processing TextChangedI Autocommands for "*":
Error executing lua callback: ...al/share/nvim/lazy/blink.cmp/lua/blink/cmp/fuzzy/ffi.lua:102:/home/user/.local/share/nvim/lazy/blink.cmp/lua/blink/cmp/fuzzy/../../../../target/release/blink_cmp_fuzzy.so: cannot open shared object file: No such file or directory
stack traceback:
  [C]: in function 'load'
  ...al/share/nvim/lazy/blink.cmp/lua/blink/cmp/fuzzy/ffi.lua:102: in main chunk
  [C]: in function 'require'
  ...l/share/nvim/lazy/blink.cmp/lua/blink/cmp/fuzzy/init.lua:8: in main chunk
  [C]: in function 'require'
  .../.local/share/nvim/lazy/blink.cmp/lua/blink/cmp/init.lua:42: in function 'update_completions'
  .../.local/share/nvim/lazy/blink.cmp/lua/blink/cmp/init.lua:57: in function 'on_show'
  ...nvim/lazy/blink.cmp/lua/blink/cmp/trigger/completion.lua:172: in function 'show'
  ...nvim/lazy/blink.cmp/lua/blink/cmp/trigger/completion.lua:51: in function <...nvim/lazy/blink.cmp/lua/blink/cmp/trigger/completion.lua:29>

Trust me, I do not want to be on Ubuntu 18, but as it stands my hands are tied. Not sure what could be causing this error. I dont want to arbitrarily dump information in this issue which is not relevant, so I can add details which are relevant as requested.

Saghen commented 1 month ago

Seems like your cargo build --release failed, you're not on a version tag (v0.*), or the prebuild binaries download failed. Share your config and try reinstalling the plugin to double check

xyven1 commented 4 weeks ago

None of that is the case, afaict. There is actually a .so file present, Im pinned to a version, and I have tried reinstalling many times, as well as manually purging the files.

Saghen commented 4 weeks ago

Do you run into the same error on main? It's possible this was fixed with the switch to mlua but that hasn't gone out in a release yet

xyven1 commented 4 weeks ago

Well since there aren't any prebuilt binaries I cant really test it. (Correct me if I'm wrong)

Saghen commented 4 weeks ago

You should be able to install a rust toolchain via https://rustup.rs/ and then build the plugin with build = "cargo build --release" (deltails in the readme)

xyven1 commented 4 weeks ago

Yeah, I guess I was trying to avoid having to set up another tool chain on Ubuntu 18, but I'll give it a shot. Thanks for the tips.

scottmckendry commented 4 weeks ago

New pre-built releases are available @xyven1 if you want to give this another go on a more recent commit?

xyven1 commented 4 weeks ago

Absolutely

xyven1 commented 4 weeks ago

Now it just a glibc version error (which i get with pretty much any application, tbh). So i guess the main issue was fixed.

scottmckendry commented 3 weeks ago

That's odd. AFAIK Neovim v0.10 requires a relatively recent version of glibc. What version of nvim are you running? Chances are certain functionality is already broken.

xyven1 commented 3 weeks ago

That's odd. AFAIK Neovim v0.10 requires a relatively recent version of glibc. What version of nvim are you running? Chances are certain functionality is already broken.

I am using a statically linked version using musl :/. I have had to use a statically linked versions of other applications as well, such as fish.

Saghen commented 3 weeks ago

The binaries should be statically linked so that sounds like a bug on our end. Can you send the full glibc error you're getting? And, only if it's easy, instructions on how you built your neovim so I can test this in docker

Saghen commented 3 weeks ago

Actually, that doesn't make sense, you can't have a cdylib that's statically linked :smile: I'll look to pin against an old version of glibc and support prebuilt musl binaries

xyven1 commented 3 weeks ago

Wow, that would be great! I feel like only supporting modern libc and musl is a good option.

Saghen commented 3 weeks ago

With the upcoming release, there'll be pre-built musl binaries but the detection logic is at the OS level (and specifically for alpine), so you'll have to specify fuzzy.prebuilt_binaries.force_system_triple = 'x86_64-unknown-linux-musl'

xyven1 commented 3 weeks ago

So cool! Thanks for supporting such a niche use case!

xyven1 commented 2 weeks ago

Maybe this isn't quite fixed yet...

20:24:40 msg_show Error executing vim.schedule lua callback: .../.local/share/nvim/lazy/blink.cmp/lua/blink/cmp/init.lua:46: loop or previous error loading module 'blink.cmp.fuzzy'
stack traceback:
  [C]: in function 'require'
  .../.local/share/nvim/lazy/blink.cmp/lua/blink/cmp/init.lua:46: in function 'callback'
  ...e/nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/init.lua:84: in function 'on_completions_callback'
  ...vim/lazy/blink.cmp/lua/blink/cmp/sources/lib/context.lua:60: in function 'fn'
  .../nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/async.lua:86: in function 'cb'
  .../nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/async.lua:44: in function 'cb'
  .../nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/async.lua:44: in function 'resolve'
  .../nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/async.lua:93: in function 'cb'
  .../nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/async.lua:44: in function 'resolve'
  .../nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/async.lua:163: in function 'resolve_if_completed'
  .../nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/async.lua:169: in function 'cb'
  .../nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/async.lua:44: in function 'resolve'
  .../nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/async.lua:93: in function 'cb'
  .../nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/async.lua:44: in function 'cb'
  .../nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/async.lua:44: in function 'resolve'
  .../nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/async.lua:93: in function 'cb'
  .../nvim/lazy/blink.cmp/lua/blink/cmp/sources/lib/async.lua:44: in function ''
  vim/_editor.lua: in function <vim/_editor.lua:0>

and

 failed to get completions with error: error loading module 'blink_cmp_fuzzy' from file '/home/babruell/.local/share/nvim/lazy/blink.cmp/lua/blink/cmp/fuzzy/../../../../target/release/libblink_cmp_fuzzy.so':
   /usr/lib/x86_64-linux-gnu/libc.so: invalid ELF header

I manually downloaded the musl version just to make that wasn't the problem, and got hit with the same error

xyven1 commented 2 weeks ago

LMK if you need any other info. Again thanks for taking this use case seriously, so many other projects I use just hit you with the classic "user issue, they need to update their system"