NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.48k stars 13.67k forks source link

neovim setup broken on unstable #154299

Closed matthiasbeyer closed 2 years ago

matthiasbeyer commented 2 years ago

Describe the bug

I don't know what the actual problem is, I just know that 4f6d8095fd51954120a1d08ea5896fe42dc3923b was the last nixpkgs-unstable revision where my neovim setup successfully built.

Since then there were several changes to the neovim definition, discussion include but are not limited to:

Right now, with latest unstable (0ecf7d414811f831060cf55707c374d54fbb1dec), I get:

error: 'vimrcContent' at /var/src/nixpkgs-unstable/pkgs/misc/vim-plugins/vim-utils.nix:265:18 called with unexpected argument 'customRc', at /var/src/nixpkgs-unstable/pkgs/applications/editors/neovim/utils.nix:122:20

(using krops, hence the /var/src prefix here).

Can someone elaborate?

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.4.161, NixOS, 21.05.git.dde1557825c (Okapi)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.16`
 - channels(m): `""`
 - channels(root): `""`
 - nixpkgs: `/var/src/nixpkgs`

@teto @manveru @garbas

teto commented 2 years ago

in the codebase, I can only find customRC, no customRc

matthiasbeyer commented 2 years ago

On f603f36ca2e12e69f6d48602c2ddc2c30544b407 if I rg customRc I get:

pkgs/misc/vim-plugins/vim-utils.nix
261:        customRc = ''let mapleader = " "'';

pkgs/applications/editors/neovim/wrapper.nix
28:    # it will append "-u <customRc>" to the wrapped arguments

but both matches are documentation.... weird!

matthiasbeyer commented 2 years ago

Okay, so the customRc/customRC messup was my bad.

Now I get

builder for '/nix/store/7z3618bijsy3x3920i52yrl6h20m80xx-neovim-0.6.1.drv' failed with exit code 1; last 10 log lines:
  line    8:
  E117: Unknown function: funcref#Function
  line    9:
  E117: Unknown function: funcref#Function
  line   15:
  E117: Unknown function: funcref#Function
  E116: Invalid arguments for function actions#AddAction
  remote/host: python3 host registered plugins []
  remote/host: generated rplugin manifest: /nix/store/dc05iz4q3qzlhaj32zs4w26gd6mxsizn-neovim-0.6.1/rplugin.vim
  Generating rplugin.vim failed!
cannot build derivation '/nix/store/d6x4nicvwx8jq9zy2fl2d6c6hs98541g-nvim.drv': 1 dependencies couldn't be built
teto commented 2 years ago

yes my mistake in the documentation :'(

Could you write a test of the setup that you used to build and now fails in pkgs/applications/editors/neovim/tests.nix ? We can then fix it and having the test would help avoid regressions too.

matthiasbeyer commented 2 years ago

I'd love to, but I don't even know where the bug comes from and dumping my multi-hundret vim setup in there sounds like a bad idea... or do you have an idea how to approach this in a way so that I don't have to just "dump and pray"? :laughing:

teto commented 2 years ago

it would help to have the full log, seems like some plugin is not loaded or not in the correct order when trying to generate the rplugin manifest. What plugins do you that rely on remote providers (python plugins in general like deoplete) ? it may be listed in the file generated by :UpdateRemotePlugins.

matthiasbeyer commented 2 years ago

So I tried to find the plugin which causes the issue and I am not sure, but it is most likely one of these:

ncm2
ncm2-ultisnips
ncm2-bufword
ncm2-path
ncm2-tmux
ncm2-look
ncm2-otherbuf

Although when I remove them, I get another error (but not the same, so it seems that one or several of these plugins is the issue):

builder for '/nix/store/csg2sx96ryqpcvn7j52m22gwzkllyryp-neovim-0.6.1.drv' failed with exit code 1; last 10 log lines:
  E1208: -complete used without -nargs
  line  460:
  E1208: -complete used without -nargs
  line  464:
  E1208: -complete used without -nargs
  line  468:
  E1208: -complete used without -nargs
  remote/host: python3 host registered plugins []
  remote/host: generated rplugin manifest: /nix/store/qv8y74i5f6jx2ysa8smgqi5hpq1w8v3z-neovim-0.6.1/rplugin.vim
  Generating rplugin.vim failed!
cannot build derivation '/nix/store/p370qschm8l712g0llps4dnwxanlmany-nvim.drv': 1 dependencies couldn't be built

Not sure how to get the full build log.

teto commented 2 years ago

at the end of a failed build, there is a recommandation like "run nix log /nix/store/p370qschm8l712g0llps4dnwxanlmany-nvim.drv to see the full output". Run that command and paste it somewhere, it may help you find the issue. I myself dont use any remote plugin .

There is one test for remote plugins "test_nvim_with_remote_plugin" so maybe you can adapt it with ncm2 until you trigger the bug. In a nixpkgs checkout, run nix-build -A neovim.tests to run the tests

matthiasbeyer commented 2 years ago

This issue seems not only be present on unstable. I just updated one of my devices to 21.11 and it results in broken neovim there as well (neovim complains about fugitive: fugitive#statusline is not known anymore).

matthiasbeyer commented 2 years ago

This happens, btw, most surely because neovim does not find any plugins.

matthiasbeyer commented 2 years ago

Okay, somehow I got it working. The issue seems to be nixos 21.05 + unstable newer than mentioned. 21.11 with newer unstable than mentioned seems to work. Closing this now.