Open polarmutex opened 2 years ago
The error seems to stem from gitsigns: git not in path. Aborting setup
?
If you add git as a buildInput of gitsigns-nvim in pkgs/applications/editors/vim/plugins/overrides.nix does that fix it ?
It's kinda strange as I use gitsigns-nvim and dont see it (well I've disabled it last week for another reason).
Also be careful that the "src" you see here
gitsigns-nvim = buildNeovimPlugin {
pname = "gitsigns.nvim";
version = "2022-09-01";
src = fetchFromGitHub {
owner = "lewis6991";
repo = "gitsigns.nvim";
rev = "d7e0bcbe45bd9d5d106a7b2e11dc15917d272c7a";
sha256 = "1h4gxyamynwygxpqfib2a7sd1xbi6sh8ixg85j6qiaqqpahr0a4k";
};
meta.homepage = "https://github.com/lewis6991/gitsigns.nvim/";
};
is not the "src" used by the derivation (a confusing bug I am working on, see https://github.com/NixOS/nixpkgs/pull/178180#issuecomment-1197726116)
The git dependency for gitsigns is a small issue I still need to fix but does not cause the rplugin generation to fail. If I disabled Neogit plug-in from my config it builds.
As part of my attempt to track down the issue I was only changing neovim commits and the neovim commit reference is the first commit where my config breaks.
There is a auto command in the neogit plugin folder referencing afile that causes the error when generating the rplugin file. The neovim commit that breaks is refactoring out duplicated code dealing with auto commands. But the neovim change looks correct but is causing issues with the nix neovim wrapper
Here's my slightly different nix log:
Generating remote plugin manifest
[coc.nvim] "node" is not executable, checkout https://nodejs.org/en/download/
Cannot find git. Please set g:gitgutter_git_executable.
Error detected while processing StdinReadPost Autocommands for "*":
E495: no autocommand file name to substitute for "<afile>"
Error detected while processing BufEnter Autocommands for "*"..function <SNR>6_detect_indent:
line 10:
E495: no autocommand file name to substitute for "<afile>"
Error detected while processing BufWinEnter Autocommands for "*":
E495: no autocommand file name to substitute for "<afile>"
Error detected while processing BufEnter Autocommands for "*"..function <SNR>6_detect_indent:
line 10:
E495: no autocommand file name to substitute for "<afile>"
remote/host: python3 host registered plugins []
remote/host: generated rplugin manifest: /nix/store/s32mksqrhld9qvrwrl03n9ay3hidwdxb-neovim-master/rplugin.vim
Generating rplugin.vim failed!
Dropping the nightly overlay as a dependency gets me back to a working build.
I come from the linked issue above. I also used neovim nightly, though I used github:neovim/neovim
rather than the overlay, since that's deprecated. Removing that and just using Nixpkgs' neovim results in an error that I believe is a home-manager thing, as it looks like I need to use neovim-unwrapped
for it. But after removing that overlay, it seems to work perfectly, I suppose this is more of an issue with how the neovim flake works, maybe?
A neovim commit broke this, but the commit looks correct and valid, so I still need to track down what needs to be changed in nixpkgs to fix this, any help would be appreciated as I do not fully know the neovim package scripts. Removing the overlay fixes this because the commit that broke is not released. Once the next version of neovim is released, I suspect this issue will be more widespread and can not be fixed unless you do not update neovim
For example, where is makeWrapper defined? I am trying to find what is being executed to generate the rplugin.vim.
I get a similar error, using the neovim from the nixos-22.05 branch:
Generating remote plugin manifest
[nerdtree-git-status] git command not found
Error detected while processing StdinReadPost Autocommands for "*":
E495: no autocommand file name to substitute for "<afile>"
Error detected while processing BufEnter Autocommands for "*"..function <SNR>6_detect_indent:
line 10:
E495: no autocommand file name to substitute for "<afile>"
Error detected while processing BufWinEnter Autocommands for "*":
E495: no autocommand file name to substitute for "<afile>"
Error detected while processing BufEnter Autocommands for "*"..function <SNR>6_detect_indent:
line 10:
E495: no autocommand file name to substitute for "<afile>"
remote/host: python3 host registered plugins []
remote/host: generated rplugin manifest: /nix/store/vsazps5a952gw5x6g42bbbkvv64dd3qx-neovim-master/rplugin.vim
Generating rplugin.vim failed!
For me, removing vim-polyglot
from the plugins fixes the issue and allows me to build neovim again.
For example, where is makeWrapper defined?
I think this is in pkgs/applications/editor/neovim/wrapper.nix
(i. e. https://github.com/NixOS/nixpkgs/blob/f21492b413295ab60f538d5e1812ab908e3e3292/pkgs/applications/editors/neovim/wrapper.nix#L81 for the 22.05 branch).
The log output of neovim can be adjusted by modifying the -V1rplugins.log
part of the command generating the manifest, the higher the number the more detailed the output. Adding a cat rplugins.log
before the exit 1
allows to view the error output with nix log
after the build failure. See https://gist.github.com/liketechnik/2c5d537913ab581aca1083674d941d38 for a diff accomplishing just that.
Unfortunately I haven't been able to find out where the issue is caused (i. e. changes to the nixos module, changes in neovim or a vim-polyglot update), so I don't have a full solution here.
Unfortunately I haven't been able to find out where the issue is caused (i. e. changes to the nixos module, changes in neovim or a vim-polyglot update), so I don't have a full solution here.
Apparently the error occurs due to the manifest being generate in ex mode (-E
). Not using it allows to build the plugin manifest successfully (at least for my set of plugins). The following patch accomplishes the necessary change:
diff --git a/pkgs/applications/editors/neovim/wrapper.nix b/pkgs/applications/editors/neovim/wrapper.nix
index 2a0d60ce5a7..002b81e26fb 100644
--- a/pkgs/applications/editors/neovim/wrapper.nix
+++ b/pkgs/applications/editors/neovim/wrapper.nix
@@ -100,7 +100,7 @@ let
if ! $out/bin/nvim-wrapper \
-u ${writeText "manifest.vim" manifestRc} \
-i NONE -n \
- -E -V1rplugins.log -s \
+ -V1rplugins.log \
+UpdateRemotePlugins +quit! > outfile 2>&1; then
cat outfile
echo -e "\nGenerating rplugin.vim failed!"
Is that acceptable fix that can merged into nixpkgs?
Well, at the very least you can very much PR it and ask for review.
Well, at the very least you can very much PR it and ask for review.
Done, see #191852
I guess this can be closed now that #191852 has been merged?
I'm hitting something with the same error message on current master (b7fa69bbea93d990454dbf42f310de1af8940459, aarch64-darwin), but I haven't done much debugging yet. Weirdly after applying the debugging patch in https://github.com/NixOS/nixpkgs/issues/189804#issuecomment-1250332129, the build succeeds, and it seems to be related to the verbosity level. -V7rplugin.log
and below fail, while -V8rplugin.log
succeeds (the default is -V10
, according to the docs).
Reproduction:
❯ nix-build -j1 -E '
let pkgs = import ./. {}; in
pkgs.neovim.override {
withNodeJs = true;
configure.packages.test = with pkgs.vimPlugins; { start = [ coc-nvim vim-better-whitespace vim-polyglot ]; };
}
'
this derivation will be built:
/nix/store/5h5kpb164d2hdczm0ynlsw2zhw02m993-neovim-0.8.0.drv
building '/nix/store/5h5kpb164d2hdczm0ynlsw2zhw02m993-neovim-0.8.0.drv'...
Generating remote plugin manifest
=11;?(BError detected while processing StdinReadPost Autocommands for "*":
E495: no autocommand file name to substitute for "<afile>"
Error detected while processing BufEnter Autocommands for "*"..function <SNR>6_d
etect_indent:
line 10:
E495: no autocommand file name to substitute for "<afile>"
Error detected while processing BufWinEnter Autocommands for "*":
E495: no autocommand file name to substitute for "<afile>"
Error detected while processing BufEnter Autocommands for "*"..function <SNR>6_d
etect_indent:
line 10:
E495: no autocommand file name to substitute for "<afile>"
Error detected while processing BufWinEnter Autocommands for "*":
E495: no autocommand file name to substitute for "<afile>"
Error detected while processing BufEnter Autocommands for "*"..function <SNR>6_d
etect_indent:
line 10:
E495: no autocommand file name to substitute for "<afile>"
remote/host: generated rplugin manifest: /nix/store/hqyfmcis07dz107mjd8kbzdipma4
2ib5-neovim-0.8.0/rplugin.vim112Vim: Error reading input, exiting...
Error detected while processing command line..BufWinLeave Autocommands for "*":
E495: no autocommand file name to substitute for "<afile>"
E495: no autocommand file name to substitute for "<afile>"
-- More --Vim: Finished.
Press ENTER or type command to continue
Generating rplugin.vim failed!
Still a problem on current master (83018dd5d795a7f0729c94c2d234986f2858c300, aarch64-darwin, x86_64-linux). Should I reopen this issue or open a new one with a nearly identical description?
[ignoring the question regarding opening a new issue]
I'll be honest here: My "fix" that closed this issue was more of a "x changed somehow" + "x doesn't seem to be needed here" -> "let's remove x" (x being neovim's ex mode). Unfortunately I did not (and do not) understand which change in ex mode caused the original error to surface (and the (neo)vim changelogs have not been particularly helpful for me to grasp the changes made). So my fix may very well just have hid the underlying problem :( And I have no idea what that problem is.
Thanks for the explanation. It sounds to me like the issue is I'm seeing is related or the same, and some part of it is still present, so I'm going to reopen this issue for visibility.
Changing the verbosity level was enough to pass my simple reproduction so I opened a PR, but not enough to build my vim configuration (oops). Here's a build log with the debugging changes from https://github.com/NixOS/nixpkgs/issues/189804#issuecomment-1250332129 in case it's helpful.
I spent a while looking at this, but it looks like I'm going to need to learn a whole bunch more about neovim.
My particular failure seems to be a warning issued by vim-gitgutter
, which understandably can't find git. It passes if I set disable flag (let g:gitgutter_enabled = 0
) while building the manifest, but I don't see a way to set that without changes to nixpkgs. However, any package that calls echo
seems to be problematic.
I still don't know what affects the exit status, or how installing these three packages combine to make echo
change the exit status.
Here's a reproduction:
Note that this assumes the following verbosity change patch has been applied.
{ pkgs ? import ~/src/nixpkgs {} }:
let
# A simple "extension" that echos during load, which mimics the behavior of
# more complex plugin issuing a warning.
echo-on-load = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "echo-on-load";
version = "0";
src = pkgs.runCommand "echo-on-load-source" {} ''
mkdir -p $out/plugin
echo 'echo "a test message"' > $out/plugin/echo-on-load.vim
'';
};
in
pkgs.neovim.override {
withNodeJs = true;
configure.packages.test = with pkgs.vimPlugins; {
start = [
# Removing any one of the following makes the build pass.
coc-nvim
vim-better-whitespace
vim-polyglot
echo-on-load
];
};
}
diff --git a/pkgs/applications/editors/neovim/wrapper.nix b/pkgs/applications/editors/neovim/wrapper.nix
index 01a9cf98954..dfde843cdaf 100644
--- a/pkgs/applications/editors/neovim/wrapper.nix
+++ b/pkgs/applications/editors/neovim/wrapper.nix
@@ -98,7 +98,7 @@ let
if ! $out/bin/nvim-wrapper \
-u ${writeText "manifest.vim" manifestRc} \
-i NONE -n \
- -V1rplugins.log \
+ -Vrplugins.log \
+UpdateRemotePlugins +quit! > outfile 2>&1; then
cat outfile
echo -e "\nGenerating rplugin.vim failed!"
Steps To Reproduce
Steps to reproduce the behavior:
Build log
error: builder for '/nix/store/db9r5s33ir4zjbk8a9x84qkl0l15k285-neovim-master.drv' failed with exit code 1; last 8 log lines:
rplugin.vim generation failed for an auto command in the plugin neogit.
not sure where to begin to fix this (it might need fixing in neovim but the changes looks good to me) happy to look into fixing , but might need some pointers on where to look
Additional context
neovim commit that breaks this plugin generation: neovim/neovim@64d147b my neovim repo used to build: https://github.com/polarmutex/neovim-flake
Notify maintainers
@teto
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.