-
-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PackerInstall causing Neovim to crash #496
Comments
@mhanberg that seems like a nasty issue. I think if nvim is crashing that almost certainly means theres also an upstream neovim issue since even if packer is misbehaving neovim ought not to crash. Regarding this issue I tried running Could you try whittling down the config file you provided to just the minimal amount of things required to trigger this error so we can verify it isn't related to a plugin. Also could you try this with 0.5 stable, just to see if there's been a change introduced on nightly nvim that might account for this. |
@akinsho looks like it works on the stable branch (without editing my config). I tried it again on master with only this as my config local install_path = vim.fn.stdpath("data") .. "/site/pack/packer/opt/packer.nvim"
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
vim.cmd("!git clone https://github.com/wbthomason/packer.nvim " .. install_path)
end
vim.cmd [[packadd packer.nvim]]
local startup = require("packer").startup
startup(
function(use, use_rocks)
use "tjdevries/nlua.nvim"
end
) and it still crashed. |
Based on the error from the video above, it looks similar to an issue I kept having (I'm not sure if it is the same issue). What I think is happening is, Packer accepts the use config but because it's not yet installed thus it doesn't exist therefore when you try to load the plugin, CRASH. I'm not sure how it would do this but perhaps packer could create a tmp mock that only returns a setup function that does nothing else until the actual plugin can be installed? I created some global functions that allows you to ignore errors caused by not yet installed plugins (it will still message about it, just not crash out) because I was getting annoyed that one exception would stop the rest of my config from loading function _G.config_error (err)
print("Backtrace:", debug.traceback(err))
end
function _G.load_config (config)
local _, required = xpcall(require, config_error, config)
return required
end
function _G.setup_config (setup_module, config)
local setup = load_config(setup_module).setup
if type(setup) == 'function' then
return setup(config)
else
print("No setup function for:", setup_module)
end
end Then you would use it like this: -- inside of packers setup function
use {
'nvim-treesitter/nvim-treesitter',
requires = 'RRethy/nvim-treesitter-textsubjects',
run = ':TSUpdate',
config = function () load_config('plugins.language.tree_sitter') end,
}
-- inside of `plugins/language/tree_sitter.lua`
return load_config('nvim-treesitter.configs', {
-- config tree_sitter like normal
} The advantage is that exceptions(plugin file not found, mistake in config file, etc) won't halt the loading of the plugin or config ensuring that all your (working config) still loads but that you still get messages about exceptions for you to fix. |
Sorry haven't had time to get back to this or look into it, also not going to have much time soon tbh. It seems to me that since the bug is reproducible by switching versions it is most likely related to a change in nvim, might still mean a fix is required on this side due to some api change in 0.6-dev but still don't think whatever packer is doing should be crashing nvim and that that is an upstream issue. |
Given you're on a M1 Mac, I'm wondering if this is somehow a Luarocks issue? |
I am running into this issue on an intel mac (, under both nightly and stable neovim. This is my first time setting up packer, so it very well could be my mistake, but wanted to provide another example in case it helps isolate anything. I've also attached the osx crash log in case that adds anything! nvim --version
packer_init.lua
plugins.lua
|
Hi @pjantrania! Thanks for the report - it looks like Neovim is crashing in the middle of a Would you mind
Thanks, and sorry for the hassle. |
I suspect you have Try |
If @clason is right, we should add a notice of this to the README. |
whoa--following @clason's steps, |
Great, glad things are working now! Thanks for the macOS assist, @clason! I'll add a note about this to the README. |
@mhanberg: I suspect this may have been the issue for you too, and your dependency got fixed when you went from nightly -> stable. As such, I'm going to close this issue, but feel free to reopen if you don't think it's solved. |
…r conflict with brew installation of Neovim: wbthomason/packer.nvim#496. Added Neovim dependencies to Brewfile.
Apologies to comment on a closed issue: is my understanding correct then that currently in order to use packer on Mac one must necessarily build Neovim from source (to avoid the |
No, that is not correct. |
What is then the recommendation to avoid the |
You cannot avoid the My comment was about a very specific situation:
None of which seem to apply to you. Are you observing an actual problem, or is this just idle speculation? |
I am trying to set-up packer on a macOS but, even using the reproducible examples both in this thread and in the documentation (README), I am getting the error As such, I thought the only option left would be that somehow the installation on macOS is faulty (as mentioned in the README).
I notice that installing nvim via homebrew does explicitly pour |
No, because homebrew's Neovim is set up to use homebrew's luv (as opposed to the build from source, which isn't). Your issue is unrelated to this thread. (Make sure you're not lazy-loading packer, and that you restart Neovim after every change to the config.) |
- `nvim --version`:
git --version
: git version 2.32.0Steps to reproduce
:PackerInstall
Actual behaviour
Expected behaviour
packer files
Plugin specification file(s)
local install_path = vim.fn.stdpath("data") .. "/site/pack/packer/opt/packer.nvim"
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
vim.cmd("!git clone https://github.com/wbthomason/packer.nvim " .. install_path)
end
vim.cmd [[packadd packer.nvim]]
local startup = require("packer").startup
startup(
function(use, use_rocks)
use {"wbthomason/packer.nvim", opt = true}
use "tjdevries/nlua.nvim"
use "norcalli/nvim.lua"
use "tpope/vim-repeat"
use "bakpakin/fennel.vim"
use "sainnhe/vim-color-forest-night"
use "christoomey/vim-tmux-runner"
use {"rrethy/vim-hexokinase", run = "make hexokinase"}
use "alvan/vim-closetag"
use "junegunn/goyo.vim"
use "AndrewRadev/splitjoin.vim"
use "tpope/vim-vinegar"
use "tpope/vim-commentary"
use "tpope/vim-dispatch"
use "vim-ruby/vim-ruby"
use "tpope/vim-rsi"
use "elixir-editors/vim-elixir"
-- use "tpope/vim-endwise"
use "tpope/vim-fugitive"
use "junegunn/gv.vim"
use "airblade/vim-gitgutter"
use "tpope/vim-rails"
use "tpope/vim-sensible"
use "vim-test/vim-test"
use "christoomey/vim-tmux-navigator"
use "tpope/vim-liquid"
use "pangloss/vim-javascript"
use "isRuslan/vim-es6"
-- use "mxw/vim-jsx"
-- use "jiangmiao/auto-pairs"
use "tpope/vim-surround"
use "tpope/vim-eunuch"
use "tpope/vim-projectionist"
use "avakhov/vim-yaml"
use "chr4/nginx.vim"
use "mattn/emmet-vim"
use "tpope/vim-markdown"
use "matze/vim-move"
-- use "Yggdroot/indentLine"
use {"lukas-reineke/indent-blankline.nvim"}
use {
"junegunn/fzf",
run = function()
vim.fn"fzf#install"
end
}
use "junegunn/fzf.vim"
use "farmergreg/vim-lastplace"
use {"mg979/vim-visual-multi", branch = "master"}
use "ekalinin/Dockerfile.vim"
use "kana/vim-textobj-user"
use "amiralies/vim-textobj-elixir"
use "stsewd/fzf-checkout.vim"
use "reedes/vim-wordy"
end
)
require("packer.luarocks").setup_paths()
_ = require("underscore")
packer log file
[DEBUG Mon Jul 19 23:45:15 2021 8.1090564144396e+14] .../pack/packer/opt/packer.nvim/lua/packer/plugin_utils.lua:176: Updating FS state
[DEBUG Mon Jul 19 23:45:37 2021 8.1092691669521e+14] ...are/nvim/site/pack/packer/opt/packer.nvim/lua/packer.lua:361: packer.install: requiring modules
[DEBUG Mon Jul 19 23:45:37 2021 8.1092692060854e+14] ...are/nvim/site/pack/packer/opt/packer.nvim/lua/packer.lua:308: Processing plugin specs
[DEBUG Mon Jul 19 23:45:37 2021 8.1092693084992e+14] .../pack/packer/opt/packer.nvim/lua/packer/plugin_utils.lua:176: Updating FS state
[DEBUG Mon Jul 19 23:46:16 2021 8.1096661268867e+14] ...are/nvim/site/pack/packer/opt/packer.nvim/lua/packer.lua:361: packer.install: requiring modules
[DEBUG Mon Jul 19 23:46:16 2021 8.1096661706792e+14] ...are/nvim/site/pack/packer/opt/packer.nvim/lua/packer.lua:308: Processing plugin specs
[DEBUG Mon Jul 19 23:46:16 2021 8.1096662748558e+14] .../pack/packer/opt/packer.nvim/lua/packer/plugin_utils.lua:176: Updating FS state
[DEBUG Mon Jul 19 23:56:48 2021 8.1159809896225e+14] ...are/nvim/site/pack/packer/opt/packer.nvim/lua/packer.lua:361: packer.install: requiring modules
[DEBUG Mon Jul 19 23:56:48 2021 8.1159810271333e+14] ...are/nvim/site/pack/packer/opt/packer.nvim/lua/packer.lua:308: Processing plugin specs
[DEBUG Mon Jul 19 23:56:48 2021 8.1159811022954e+14] .../pack/packer/opt/packer.nvim/lua/packer/plugin_utils.lua:176: Updating FS state
packer compiled file
I don't think it got this far to compile one ¯\_(ツ)_/¯Screen.Recording.2021-07-19.at.11.46.07.PM.mov
The text was updated successfully, but these errors were encountered: