Skip to content
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

git submodules don't work #72

Closed
ilAYAli opened this issue Dec 21, 2022 · 8 comments · Fixed by #76
Closed

git submodules don't work #72

ilAYAli opened this issue Dec 21, 2022 · 8 comments · Fixed by #76
Labels
bug Something isn't working

Comments

@ilAYAli
Copy link

ilAYAli commented Dec 21, 2022

This plugin (mine) https://github.com/ilAYAli/scMRU.nvim works with Packer et al. but not with Lazy.
I followed this guide when I wrote it.
The mentioned sqlite3 lua rocks module is fairly old so I should probably just replace it. Regardless, other plugins might use a similar pattern, so the issue might be of interest.

Which version of Neovim are you using?
NVIM v0.8.0-1210-gd367ed9b2

Steps to reproduce the behavior:

Lazy fails during installation with a minimal config file.

local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  'ilAYAli/scMRU.nvim',
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

:checkhealth and Lazy log does not contain any errors, but the following is printed to :messages

Failed to source `/Users/username/.local/share/nvim/lazy/scMRU.nvim/plugin/mru.vim`

...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:185: Vim(lua):E5108: Error executing lua ...er/.local/share/nvim/lazy/scMRU.nvim/lua/mru/display.lua:1: module 'ljsqlite3' not found:
^Ino field package.preload['ljsqlite3']not found in lazy cache
^Ino file './ljsqlite3.lua'
^Ino file '/Users/runner/work/neovim/neovim/.deps/usr/share/luajit-2.1.0-beta3/ljsqlite3.lua'
^Ino file '/usr/local/share/lua/5.1/ljsqlite3.lua'
^Ino file '/usr/local/share/lua/5.1/ljsqlite3/init.lua'
^Ino file '/Users/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/ljsqlite3.lua'
^Ino file '/Users/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/ljsqlite3/init.lua'
^Ino file '/Users/username/.local/share/nvim/lazy/scMRU.nvim/plugin/../lua/mru/deps/lua-ljsqlite3/init.lua'
^Ino file './ljsqlite3.so'
^Ino file '/usr/local/lib/lua/5.1/ljsqlite3.so'
^Ino file '/Users/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/ljsqlite3.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'ljsqlite3 not found in lazy plugins
stack traceback:
^I[C]: in function 'require'
^I...er/.local/share/nvim/lazy/scMRU.nvim/lua/mru/display.lua:1: in main chunk
^I[C]: in function 'require'
^I...etter/.local/share/nvim/lazy/scMRU.nvim/lua/mru/init.lua:1: in main chunk
^I[C]: in function 'require'
^I[string ":lua"]:1: in main chunk
^I[C]: in function 'cmd'
^I...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:185: in function <...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:184>
^I[C]: in function 'xpcall'
^I.../.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua:77: in function 'try'
^I...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:184: in function 'source'
^I...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:178: in function 'source_runtime'
^I...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:149: in function 'packadd'
^I...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:133: in function 'load'
^I...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:64: in function 'startup'
^I...etter/.local/share/nvim/lazy/lazy.nvim/lua/lazy/init.lua:58: in function 'setup'
^I/Users/username/sync/config/nvim/init.lua:19: in main chunk

stacktrace:

@ilAYAli ilAYAli added the bug Something isn't working label Dec 21, 2022
@folke
Copy link
Owner

folke commented Dec 21, 2022

Probably because of the clearing of the rtp path. set config.performance.rtp.reset = false

@folke folke closed this as completed Dec 21, 2022
@ilAYAli
Copy link
Author

ilAYAli commented Dec 21, 2022

I get the exact same error with this:

require("lazy").setup("plugins", {
  performance = {
    rtp = {
       reset = false,
    },
  },
  debug = true,
})

@folke
Copy link
Owner

folke commented Dec 21, 2022

Then it's not lazy that is doing something. Where did you install that module?

Be aware that Lazy does not support luarocks like PAcker. Is that what you're trying to achieve?

@ilAYAli
Copy link
Author

ilAYAli commented Dec 21, 2022

Good point, the dependencies are installed as git submodules.

@folke
Copy link
Owner

folke commented Dec 21, 2022

and is the so built?

@ilAYAli
Copy link
Author

ilAYAli commented Dec 21, 2022

The dependencies only contain .lua files, no binaries.

@folke folke changed the title Possible issue when loading luarock modules. git submodules don't work Dec 21, 2022
@folke
Copy link
Owner

folke commented Dec 21, 2022

Should be fixed now!

@ilAYAli
Copy link
Author

ilAYAli commented Dec 21, 2022

Should be fixed now!

Indeed, great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants