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

bug: Initial installation attempt to concatenate local 'old_dir' #1550

Closed
3 tasks done
mehalter opened this issue Jun 25, 2024 · 2 comments · Fixed by #1543
Closed
3 tasks done

bug: Initial installation attempt to concatenate local 'old_dir' #1550

mehalter opened this issue Jun 25, 2024 · 2 comments · Fixed by #1543
Labels
bug Something isn't working

Comments

@mehalter
Copy link

mehalter commented Jun 25, 2024

Did you check docs and existing issues?

  • I have read all the lazy.nvim docs
  • I have searched the existing issues of lazy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.10.0 (github release)

Operating system/version

Arch Linux

Describe the bug

When doing an initial installation with a plugin that configures itself in Lazy a bit as well as being checked out in dev mode it runs into an issue only on the first installation. The message appears that Lazy thinks that the plugin has been added to the runtime path without a directory so when it checks if the plugin's directory has changed it appears to.

Steps To Reproduce

  1. mkdir ~/projects, Make a ~/projects folder because we will be using it for dev mode
  2. git clone https://github.com/mehalter/lazy_test ~/projects/lazy_test, clone the example plugin
  3. rm -rf .repro, Make sure to clean the .repro state because this only happens on a fresh installation
  4. nvim -u repro.lua, run the repro.lua configuration and get the error

Expected Behavior

The error shouldn't happen. The directory of the plugin's location shouldn't be changing given the specs.

I get this behavior in this extremely minimal example as well as with AstroNvim when using it in development mode. I honestly cannot replicate this with LazyVim in development mode and I'm honestly not sure why that is.

Repro

-- DO NOT change the paths and don't remove the colorscheme
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", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  { "mehalter/lazy_test", import = "lazy_test" },
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
  dev = {
    patterns = {
      "lazy_test",
    },
  },
})
@mehalter mehalter added the bug Something isn't working label Jun 25, 2024
@mehalter
Copy link
Author

Also for reference, here is a direct link to the test "plugin": https://github.com/mehalter/lazy_test/blob/main/lua/lazy_test/init.lua

All it has is a single file lua/lazy_test/init.lua with the contents:

return {
  { "mehalter/lazy_test", lazy = false, priority = 10000 },
}

@folke folke closed this as completed in 24c8322 Jun 25, 2024
@folke
Copy link
Owner

folke commented Jun 25, 2024

Thank you for the report. Fixed!

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