topgrade icon indicating copy to clipboard operation
topgrade copied to clipboard

Vim-plug update step doesn't report errors

Open Popkornium18 opened this issue 3 years ago • 6 comments

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 function 2_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 function 2_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

Popkornium18 avatar May 26 '21 10:05 Popkornium18

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?

r-darwish avatar May 27 '21 07:05 r-darwish

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.

SuperSandro2000 avatar Aug 05 '21 17:08 SuperSandro2000

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.

SuperSandro2000 avatar Aug 05 '21 21:08 SuperSandro2000

@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 avatar Sep 20 '21 16:09 Corey-Keller

@Corey-Keller Can you elaborate (maybe over at #756)?

wbthomason avatar Sep 20 '21 17:09 wbthomason

@wbthomason can done!

Corey-Keller avatar Sep 20 '21 17:09 Corey-Keller