topgrade
topgrade copied to clipboard
Vim-plug update step doesn't report errors
I just realized that topgrade never upgraded my neovim plugins but still reported that everything went fine. It just says:
―― 11:57:34 - Neovim
Plugins upgraded
However if I dry run topgrade and manually run the command (on Arch) this happens:
$ /usr/bin/nvim -u /home/user/.config/nvim/init.vim -U NONE -V1 -nNesS /tmp/.tmpKhasCa
not found in 'packpath': "pack/*/start/*"
not found in 'packpath': "pack/*/start/matchit"
not found in 'packpath': "pack/*/start/*"
not found in 'runtimepath': "plugin/**/*.vim"
Reading ShaDa file "/home/user/.local/share/nvim/shada/main.shada" info marks oldfiles
line 0: could not source "/tmp/.tmpKhasCa"
Error detected while processing command line:
E484: Can't open file /tmp/.tmpKhasCa
Entering Ex mode. Type "visual" to go to Normal mode.
:
:
:
Writing ShaDa file "/home/user/.local/share/nvim/shada/main.shada"
Additional details:
- Which operating system or Linux distribution are you using? Arch Linux and Ubuntu
- How did you install Topgrade? On Arch from the AUR and on Ubuntu from GitHub. Both have the same issue.
On Ubuntu:
2021-05-26T10:02:18.038Z DEBUG topgrade::steps::vim > Wrote vim script to "/tmp/.tmphsAwkQ" not found in 'packpath': "pack/*/start/*" not found in 'packpath': "pack/*/start/matchit" not found in 'packpath': "pack/*/start/*" not found in 'runtimepath': "plugin/**/*.vim" Reading ShaDa file "/home/user/.local/share/nvim/shada/main.shada" info marks oldfiles Plug Downloading the latest version of vim-plugvim-plug is already up-to-date not found in 'runtimepath': "ftplugin/vim-plug.vim ftplugin/vim-plug_*.vim ftplugin/vim-plug/*.vim" not found in 'runtimepath': "indent/vim-plug.vim" not found in 'runtimepath': "syntax/vim-plug.vim syntax/vim-plug/*.vim"Error detected while processing function2_update[1].. 2_update_impl[115].. 2_nvim_cb[1].. 2_job_cb[4].. 2_job_out_cb[10].. 2_log[4].. 2_nvim_cb[1].. 2_job_cb[4].. 2_job_exit_cb[3].. 2_reap[12].. 2_bar: line 3: E440: undo line missingPlugins upgraded
On Arch:
2021-05-26T10:03:21.931Z DEBUG topgrade::steps::vim > Wrote vim script to "/tmp/.tmpxLfMDm" not found in 'packpath': "pack/*/start/*" not found in 'packpath': "pack/*/start/matchit" not found in 'packpath': "pack/*/start/*" not found in 'runtimepath': "plugin/**/*.vim" Reading ShaDa file "/home/user/.local/share/nvim/shada/main.shada" info marks oldfiles Plug Downloading the latest version of vim-plugvim-plug is already up-to-date not found in 'runtimepath': "ftplugin/vim-plug.vim ftplugin/vim-plug_*.vim ftplugin/vim-plug/*.vim" not found in 'runtimepath': "indent/vim-plug.vim" not found in 'runtimepath': "syntax/vim-plug.vim syntax/vim-plug/*.vim"Error detected while processing function2_update[1].. 2_update_impl[115].. 2_nvim_cb[1].. 2_job_cb[4].. 2_job_out_cb[10].. 2_log[4].. 2_nvim_cb[1].. 2_job_cb[4].. 2_job_exit_cb[3].. 2_reap[12].. 2_bar: line 3: E440: undo line missingPlugins upgraded
The way Topgrade checks for failure is by checking the program's exit code, as it does for Vim too. If you're not seeing an error it means that Vim returned 0 dispite the failure. this is the Vim script used to upgrade packages. I'm not a Vim expert in any way. Does anyone know of a way to fix the script to cause Vim to return non-zero exist code on errors?
I am not sure why this sometimes fails. When I run topgrade --only vim
it works but when I run it all together it doesn't.
I don't think the vim upgrade is failing but something is calling a git log (git log --pretty=format:%h HEAD...HEAD@{1}
) which opens a prompt or an pager which is not closed. I can press y to retry as much as I want but no new processes are created but when I press once enter topgrade just continues.
@r-darwish to exit with a non 0 exit status, use cq
(see :help cq
in vim), ~~also, please see #756 for fixing issues with Packer specifically)~~
EDIT: @wbthomason #756 doesn't actually fix Packer (not for me at least).
@Corey-Keller Can you elaborate (maybe over at #756)?
@wbthomason can done!