packer.nvim icon indicating copy to clipboard operation
packer.nvim copied to clipboard

Better to have an obvious prompt and suggestion when failed on git clone timeout

Open chaneyzorn opened this issue 3 years ago • 11 comments

I was stuck with this problem for a long time. >_<

Is it possible to disable timeout ? I try to set clone_timeout to nil but still timeout at 60s.

chaneyzorn avatar Dec 27 '20 12:12 chaneyzorn

I think nil just deletes the key, so packer uses the default value. Does setting clone_timeout to false work?

nanotee avatar Dec 29 '20 20:12 nanotee

@nanotee It works, thank you. I was confused with nil in lua. now I get it.

still wish to have a obvious prompt when failed on timeout. It's hard to find reason from output.

chaneyzorn avatar Dec 30 '20 15:12 chaneyzorn

@chaneyzorn Thanks for the report! I've added a simple warning output in the case that a timeout is triggered in f62f2fc - does that make it easier to debug?

wbthomason avatar Jan 05 '21 15:01 wbthomason

@wbthomason I tested it and find a bug:

Error executing vim.schedule lua callback: ...nvim/site/pack/packer/opt/packer.nvim/lua/packer/log.lua:3: Vim(echomsg):E121: Undefined variable: git

it seems like vim.inspect(cmd) return a string like this "git", then:

local echo_special = vim.schedule_wrap(function(msg, hl)
  vim.cmd('echohl ' .. hl)
  vim.cmd('echom "[packer] ' .. msg .. '"')        --   here goes to echom "[packer] Killing "git" due to timeout!"
  vim.cmd [[echohl None]]
end)
echom "[packer] Killing "git" due to timeout!"

chaneyzorn avatar Jan 06 '21 15:01 chaneyzorn

@chaneyzorn: Whoops, thanks for the catch. I've removed the vim.inspect call in 9f87f30, which hopefully fixes this bug.

wbthomason avatar Jan 09 '21 05:01 wbthomason

@wbthomason It fixes the bug ~

But I noticed that another message will be print after git clone action finished, which scrolls up the echom output:

[packer] Killing git due to timeout!
remote/host: python3 host registered plugins []                                                                                                                                     
remote/host: generated rplugin manifest: /home/chaney/.local/share/nvim/rplugin.vim

Only last one line would be noticed.

May it better to show message to the TUI: image

chaneyzorn avatar Jan 09 '21 14:01 chaneyzorn

Yes, this should be included in the final results report.

wbthomason avatar Jan 12 '21 00:01 wbthomason

@chaneyzorn: Sorry, I realized that my last response was unclear - by "this should be included in the final results report", I meant that "I believe this is in the final results report already". If you press <cr> on the failure to install line, does it not show you more information explaining that there was a timeout?

If not, I can add a more descriptive message to the results table and/or auto-expand the failure results like we do for the successful update results.

wbthomason avatar Jan 16 '21 20:01 wbthomason

image

@wbthomason It dosen't show the timeout. I can only see the timeout msg by using :messages.

chaneyzorn avatar Jan 17 '21 12:01 chaneyzorn

👋🏻

I opened an issue related to clone_timeout here: https://github.com/mrjones2014/dash.nvim/issues/138

I tried setting clone_timeout = false but that didn't help and running :PackerSync still caused the clone to timeout.

return require("packer").startup({
  function()
    use "wbthomason/package.nvim"
    use { "mrjones2014/dash.nvim", run = "make install" }
  end,
  config = {
    clone_timeout = false
  }
})

Integralist avatar Jul 08 '22 11:07 Integralist

@Integralist I faced similar issues installing different packages, I set clone_timeout to a very large number and it worked. nil or false doesn't seem to be recognized.

Zekt avatar Dec 28 '22 18:12 Zekt