Just tried out my config (which I recently added a rock to) on my work mac (running BigSur not sure if that matters) and found that although the same install process seems to happen to setup luarocks via packer, the install process appears to finish but I don't think luarocks is correctly installed since further calls to install try to install luarocks again. The rock I also specified (penlight) is also not installed.
Yeah, that's https://github.com/nvim-lua/plenary.nvim/issues/4 (and the same fix - setting env var MACOSX_DEPLOYMENT_TARGET to 10.15 - works to fix it). I'm considering setting that env var by default in packer, but I want to know how that value was found first, so I can have confidence I won't cause more problems by setting it.
Note that you only need to set that variable once when you install the first rock (because that's when hererocks builds luajit, which requires the flag to build correctly). Once luajit is installed (locally), using rocks (and adding further rocks if they don't need a complicated build) works fine without it.
So doing this manually with MACOSX_DEPLOYMENT_TARGET=10.15 nvim and then calling PackerSync once should suffice (until you wipe the cache directory).
@wbthomason that resolved the issue for me, I'm happy to close this or otherwise leave it here so you can track against doing something automagically for users or maybe to track against documenting the fix if not, whatever you prefer.
Might be good to leave open (and pin?) for now, at least until the Readme is finalized with such instructions?
Hi, I am having trouble running PackerSync I think it is related to this issue since it fails to spawn a plenary.nvim process and I am running macOS BigSur with the m1 chip.
Any ideas on how to solve this issue?
Error executing vim.schedule lua callback: .../site/pack/packer/start/plenary.nv
im/lua/plenary/job.lua:374: Failed to spawn process...
stack traceback:
.../site/pack/packer/start/plenary.nvim/lua/plenary/job.lua:374: in func
tion '_execute'
.../site/pack/packer/start/plenary.nvim/lua/plenary/job.lua:417: in func
tion 'start'
...im/site/pack/packer/start/gitsigns.nvim/lua/gitsigns.lua:77: in funct
ion 'run_job'
...im/site/pack/packer/start/gitsigns.nvim/lua/gitsigns.lua:204: in func
tion 'ret'
...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/async.lua:59: in funct
ion 'step'
...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/async.lua:62: in funct
ion <...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/async.lua:49>
...e/pack/packer/start/gitsigns.nvim/lua/gitsigns/async.lua:70: in funct
ion 'cb'
vim.lua:243: in function <vim.lua:243>
NVIM v0.5.0-dev+nightly-17-gcc1851c9f
Build type: Release
LuaJIT 2.1.0-beta3
@mherna: this error occurs when you run PackerSync? I'm a bit confused, as packer doesn't use plenary at all, and your stack trace seems to point to an issue in plenary.
@wbthomason, thanks for the reply. I reinstalled neovim, and the issue got solved. Weirdly it was happening just when I ran PackerSync, which led me to believed it had something to with packer, but good to know that packer doesn't use plenary for future reference.
@mherna Did you only reinstall neovim or did you also clean any packer packages in $HOME/.local/share/nvim/site/pack/start $HOME/.local/share/nvim/site/pack/opt ?
@matu3ba I cleaned$HOME/.local/share/nvim/site/pack/start and $HOME/.local/share/nvim/site/pack/opt
@wbthomason I feel like "clean $HOME/.local/share/nvim/site/pack/start and $HOME/.local/share/nvim/site/pack/opt" belongs to the FAQ. The alternative is to have logging+instructions, if you want to investigate further.
Notes from discussion with @clason on Gitter/Matrix:
python_cmd is wrong on macOS; should be python3packer may think that the hererocks install job succeeds even when it fails. Need to figure out whyI think I'm getting something related to this:
Error in packer_compiled: ...vim/site/pack/packer/opt/packer.nvim/lua/packer/load.lua:10: attempt to index local 'plugin' (a nil value)
Please check your config for correctness
As far as I can tell, the hererocks installation craps out at some point but without an error. (I'm guessing, since I don't have a packer_hererocks directory in ~/.cache/nvim)
The PackerSync trick with MACOSX_DEPLOYMENT_TARGET doesn't seem to work for me, though 馃槥 Is there a way to manually install hererocks in that directory to at least have a temporary fix?
@garymh Your error message doesn't seem obviously related to luarocks. What makes you think the problem lies there rather than with a config or compiled file issue?
@wbthomason I guess it could be something different- I'm just using a very slimmed down packer setup and still getting it. The only thing I could pick out that looked off from my packer compiled file was the luarocks path.
Here is my packer loading code:
local packer = nil
local function init()
if packer == nil then
packer = require('packer')
util = require("packer/util")
packer.init({
compile_path = util.join_paths(vim.fn.stdpath("config"),
"vimscript", "packer_compiled.vim"),
max_jobs = 10
})
end
local use = packer.use
packer.reset()
use {"wbthomason/packer.nvim", opt = true}
use {
"AndrewRadev/switch.vim",
cmd = {"Switch", "SwitchReverse"},
config = function()
vim.g.switch_custom_definitions =
{
{"assert", "refute"}, {"if", "unless"}, {"[ ]", "[x]"},
{"yes", "no"}, {"let g:", "vim.g."}
}
end
}
end
local plugins = setmetatable({}, {
__index = function(_, key)
init()
return packer[key]
end
})
return plugins
The error message comes up when I use the :Switch command. It seems to work fine when not lazy-loaded... maybe it's a problem with that?
Yeah - it seems to be something with lazy loading? 馃し I removed all the keys and cmd triggers from my packer loading code and everything seems to be working... 馃
Most helpful comment
@wbthomason, thanks for the reply. I reinstalled neovim, and the issue got solved. Weirdly it was happening just when I ran
PackerSync, which led me to believed it had something to withpacker, but good to know thatpackerdoesn't useplenaryfor future reference.