I’m getting an error when running :Lazy sync
, where I’m not sure if the problem is with my config, lazy, or hotpot.
The error:
Error executing vim.schedule lua callback: ...ames/.local/share/nvim/lazy/lazy.nvim/lua/lazy/async.lua:127: ...local/share/nvim/lazy/lazy.nvim/lua/lazy/manage/lock.lua:28: assertion failed!
stack traceback:
[C]: in function 'error'
...ames/.local/share/nvim/lazy/lazy.nvim/lua/lazy/async.lua:127: in function 'step'
...ames/.local/share/nvim/lazy/lazy.nvim/lua/lazy/async.lua:155: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
the function from lock.lua
with a failing assertion:
The assertion is from this line, about halfway down:
branch = info.branch or assert(Git.get_branch(plugin)),
function M.update()
M.load()
vim.fn.mkdir(vim.fn.fnamemodify(Config.options.lockfile, ":p:h"), "p")
local f = assert(io.open(Config.options.lockfile, "wb"))
f:write("{\n")
-- keep disabled and cond plugins
for name in pairs(M.lock) do
if not (Config.spec.disabled[name] or Config.spec.ignore_installed[name]) then
M.lock[name] = nil
end
end
for _, plugin in pairs(Config.plugins) do
if not plugin._.is_local and plugin._.installed then
local info = assert(Git.info(plugin.dir))
M.lock[plugin.name] = {
branch = info.branch or assert(Git.get_branch(plugin)),
commit = assert(info.commit, "commit is nil"),
}
end
end
---@type string[]
local names = vim.tbl_keys(M.lock)
table.sort(names)
for n, name in ipairs(names) do
local info = M.lock[name]
f:write(([[ %q: { "branch": %q, "commit": %q }]]):format(name, info.branch, info.commit))
if n ~= #names then
f:write(",\n")
end
end
f:write("\n}\n")
f:close()
end
I added vim.print(plugin.name)
and it’s hotpot when the assertion fails.
Here’s the relevant parts of my config:
init.lua:
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
-- Bootstrap hotpot (fennel compiler)
local hotpotpath = vim.fn.stdpath("data") .. "/lazy/hotpot.nvim"
if not vim.uv.fs_stat(hotpotpath) then
vim.notify("Bootstrapping hotpot.nvim...", vim.log.levels.INFO)
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--single-branch",
"--branch=v0.12.0",
"https://github.com/rktjmp/hotpot.nvim.git",
hotpotpath,
})
vim.notify("Bootstrapping hotpot.nvim... Done", vim.log.levels.INFO)
end
vim.opt.rtp:prepend(lazypath)
vim.opt.rtp:prepend(hotpotpath)
-- This allows us to write the rest of our config in fennel
require 'hotpot'
require 'config'
config.fnl:
(require :options)
; Setting <leader>, which occurs in 'mappings' needs to come before any
; <leader> mappings in plugin configurations)
(require :mappings)
(require :lazy-config)
(require :commands)
lazy-config.fnl:
(local lazy (require :lazy))
(local plugins [ :rktjmp/hotpot.nvim ])
(lazy.setup plugins)
(there’s usually more here but I have a bunch of stuff commented out to try isolate the problem).
I’m bit stuck on how to proceed. I’m not super keen to do a deep dive into how lazy works. Anyone have any idea whether this is a problem with my config, or a bug?