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

packersync hangs

Open bryant-the-coder opened this issue 3 years ago • 11 comments

packersync hangs on windows. adlfter the process is completed, the prompt (windows terminal) would lag. anyways to fix this? my github repo

bryant-the-coder avatar Jan 03 '22 06:01 bryant-the-coder

I see the same. Building nvim off master, and attempting the latest version of packer.

mnarrell avatar Jan 03 '22 15:01 mnarrell

It's been hanging for me for quite a while, I was just about to open an issue but this is generally what I see after running packersync:

image

The number of packages syncing is different each time.

knpwrs avatar Jan 03 '22 16:01 knpwrs

I've had luck setting max_jobs to something like 10.

mnarrell avatar Jan 03 '22 17:01 mnarrell

I've had this issue for a while too. My personal computer runs Linux and I've never had any issues with Packer hanging on that machine. For work I use a macbook and it will always hang.

Today I deleted all plugins and tried installing them in batches on my macbook and running PackerSync did not hang up until around plugin 70. After that no order of plugin that I tried would work. Finally, setting a limit to max_jobs allowed all plugins to update without hanging.

otherJL0 avatar Jan 03 '22 18:01 otherJL0

same problem then. i have around 40 plugins. i m running windows. the packersync prompts hang, escaping neovim also hangs my whole comp hangs. jope packer can fix this

bryant-the-coder avatar Jan 04 '22 00:01 bryant-the-coder

anyone still having this issue?

bryant-the-coder avatar Jan 06 '22 04:01 bryant-the-coder

I fixed it by setting max_jobs as suggested above. Perhaps there should be a default value? Though it feels like a bandaid without knowing exactly what is going on. I would think lua should be able to schedule jobs such that it doesn’t hang.

knpwrs avatar Jan 06 '22 13:01 knpwrs

conf for packer?

bryant-the-coder avatar Jan 06 '22 15:01 bryant-the-coder

Yeah, here's the commit where I set it: https://github.com/knpwrs/dotfiles/commit/5d0f0ab1cb0dc654cebabe1b5ab0c3dd46731108?w=1

knpwrs avatar Jan 06 '22 15:01 knpwrs

I also have the same problem. I'm on windows and have around 40+ plugins. The max_jobs doesn't seem to fix it for me. When i run PackerSync i can still move around in my project for some time before whole Nvim is freezing. After like 30 seconds the PackerSync window pops up.

devpaps avatar Mar 14 '22 10:03 devpaps

i have same issue, and try with this solution, it work for me, setting on packer.init add max_jobs = 10

shendypratamaa avatar Aug 12 '22 05:08 shendypratamaa

I have the same problem, and adding config = { max_jobs = 10 }} in my packer.init.lua could help me solve this problem

twandylue avatar Oct 08 '22 06:10 twandylue

i hv switched to linux now. packersync is not lagging or stopping anymore. so i think its windows issue

bryant-the-coder avatar Nov 02 '22 16:11 bryant-the-coder

I'm still running into the same issue on MacOS if I don't have max_jobs set to 10. Are we closing the issue because there is a workaround?

wilkinson4 avatar Nov 02 '22 16:11 wilkinson4

For reference how to add max_jobs = 10:

put max_jobs = 10 in packer.init({ ... }) .

plugins.lua

-- auto install packer if not installed
local ensure_packer = function()
  local fn = vim.fn
  local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
  if fn.empty(fn.glob(install_path)) > 0 then
    fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path })
    vim.cmd([[packadd packer.nvim]])
    return true
  end
  return false
end
local packer_bootstrap = ensure_packer() -- true if packer was just installed

-- autocommand that reloads neovim and installs/updates/removes plugins
-- when file is saved
vim.cmd([[ 
  augroup packer_user_config
    autocmd!
    autocmd BufWritePost plugins.lua source <afile> | PackerSync
  augroup end
]])

local status, packer = pcall(require, "packer")
if not status then
  return
end

packer.init({
  package_root =  fn.stdpath("data") .. "/site/pack",
  compile_path = fn.stdpath("config") .. "plugin/packer_compiled.lua",
  plugin_package = "packer",
  display = { open_fn = require("packer.util").float },
  max_jobs = 10,
})

-- add list of plugins to install
return packer.startup(function(use)
  use("wbthomason/packer.nvim")
  ...
  ...
  if packer_bootstrap then
    packer.sync()
  end
end)

AlanJui avatar Nov 17 '22 13:11 AlanJui

EDIT: So this helped me instead: ulimit -n 4096 just run it in terminal and open neovim for sync (or make it permanent in shell rc)

this happened to me today, i dont really understand how to fix this ...i would expect this helps but it does not

return require('packer').startup(function(use)
    -- packer {{{
    use {'wbthomason/packer.nvim',  config = function()
        require('packer').init{ max_jobs = 10 }
    end}

then if i run it manually i probably need to extend defaults because this way it wants to delete all my plugins.

What I want to ask the most is "why is this closed when this still happens?". Can we reopen this issue? Because everyone with more than 70 plugins will have to bypass this

nagy135 avatar Dec 19 '22 13:12 nagy135