Saghen / blink.cmp

Performant, batteries-included completion plugin for Neovim
MIT License
631 stars 26 forks source link

Plugin available via flake but binary not included #71

Open ConorHK opened 1 day ago

ConorHK commented 1 day ago

Including the flake in my inputs make sthe plugin available to source. However, trying to initialize it with a minimal setup fails:

local M = {}
function M.setup()
        local present, blink = pcall(require, "blink.cmp")
        if not present then
                return
        end
        blink.setup({
                fuzzy = {
                        prebuiltBinaries = {
                                download = false,
                        }
                }
        })

end
return M

causes an error on every letter inserted

Error detected while processing TextChangedI Autocommands for "*":
Error executing lua callback: ...myNeovimPackages/start/blink/lua/blink/cmp/fuzzy/ffi.lua:100: /nix/store/9vvi6r9pnzx4m9k8x3rw4ny8jm0pjpxb-vim-pack-dir/pack/myNeovimPackages/start/blink/lua/blink/cmp/fuzzy/../../../../target/release/libblink_cmp_fuzzy.so: cannot open shared objec
t file: No such file or directory
stack traceback:
        [C]: in function 'load'
        ...myNeovimPackages/start/blink/lua/blink/cmp/fuzzy/ffi.lua:100: in main chunk
        [C]: in function 'require'
        ...yNeovimPackages/start/blink/lua/blink/cmp/fuzzy/init.lua:4: in main chunk
        [C]: in function 'require'
        ...pack/myNeovimPackages/start/blink/lua/blink/cmp/init.lua:42: in function 'update_completions'
        ...pack/myNeovimPackages/start/blink/lua/blink/cmp/init.lua:57: in function 'on_show'
        ...ackages/start/blink/lua/blink/cmp/trigger/completion.lua:106: in function 'show'
        ...ackages/start/blink/lua/blink/cmp/trigger/completion.lua:42: in function <...ackages/start/blink/lua/blink/cmp/trigger/completion.lua:29>

With no config (i.e. download is true by default):

:lua require("blink.cmp").setup()
Error detected while processing TextChangedI Autocommands for "*":
Error executing lua callback: ...myNeovimPackages/start/blink/lua/blink/cmp/fuzzy/ffi.lua:100: /nix/store/9vvi6r9pnzx4m9k8x3rw4ny8jm0pjpxb-vim-pack-dir/pack/myNeovimPackages/start/blink/lua/blink/cmp/fuzzy/../../../../target/release/libblink_cmp_fuzzy.so: cannot open shared objec
t file: No such file or directory
stack traceback:
        [C]: in function 'load'
        ...myNeovimPackages/start/blink/lua/blink/cmp/fuzzy/ffi.lua:100: in main chunk
        [C]: in function 'require'
        ...yNeovimPackages/start/blink/lua/blink/cmp/fuzzy/init.lua:4: in main chunk
        [C]: in function 'require'
        ...pack/myNeovimPackages/start/blink/lua/blink/cmp/init.lua:42: in function 'update_completions'
        ...pack/myNeovimPackages/start/blink/lua/blink/cmp/init.lua:57: in function 'on_show'
        ...ackages/start/blink/lua/blink/cmp/trigger/completion.lua:106: in function 'show'
        ...ackages/start/blink/lua/blink/cmp/trigger/completion.lua:42: in function <...ackages/start/blink/lua/blink/cmp/trigger/completion.lua:29>

Im somewhat new to nix so apologies if its a misunderstanding on my part - but from the flake it doesn't seem like the binary is getting bundled in the build

cideM commented 1 day ago

I can reproduce this locally

❯ nix build
Do you want to allow configuration setting 'extra-substituters' to be set to 'https://devenv.cachix.org' (y/N)? This may allow the flake to gain root, see the nix.conf manual page. y
do you want to permanently mark this value as trusted (y/N)? y
Do you want to allow configuration setting 'extra-trusted-public-keys' to be set to 'devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=' (y/N)? This may allow the flake to gain root, see the nix.conf manual page. y
do you want to permanently mark this value as trusted (y/N)? y
warning: ignoring untrusted substituter 'https://devenv.cachix.org'
warning: In a derivation named 'neovim-unwrapped-0.9.5', 'structuredAttrs' disables the effect of the derivation attribute 'disallowedReferences'; use 'outputChecks.<output>.disallowedReferences' instead

~/blink.cmp on main
❯ ls -lah result/target/release/libblink_cmp_fuzzy.so
lrwxr-xr-x 1 root wheel 96 Jan  1  1970 result/target/release/libblink_cmp_fuzzy.so -> /nix/store/g5gk6nh9vi071ssjpff80r93kagb3i2w-blink-fuzzy-lib-2024-08-02/lib/libblink_cmp_fuzzy.so

~/blink.cmp on main
❯ ls -lah /nix/store/g5gk6nh9vi071ssjpff80r93kagb3i2w-blink-fuzzy-lib-2024-08-02/lib/libblink_cmp_fuzzy.so
ls: cannot access '/nix/store/g5gk6nh9vi071ssjpff80r93kagb3i2w-blink-fuzzy-lib-2024-08-02/lib/libblink_cmp_fuzzy.so': No such file or directory

I think the culprit is the symlinking in the preInstall