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

Cache fails when updating AppImage (issue from reddit) #90

Closed
folke opened this issue Dec 22, 2022 · 7 comments · Fixed by #76
Closed

Cache fails when updating AppImage (issue from reddit) #90

folke opened this issue Dec 22, 2022 · 7 comments · Fixed by #76
Labels
bug Something isn't working

Comments

@folke
Copy link
Owner

folke commented Dec 22, 2022

Describe the bug
Is anyone having issues when updating the nvim nightly binary? I use appimage, and after the update (just replace the appimage with new one), I can't start nvim, it throws the error below. However, after deleting the cache in ~/.local/state/nvim/lazy/cache, nvim starts normally. Is it a bug or my update process is not supported?

Which version of Neovim are you using?
Gui(specify which GUI client you are using)? Nightly? Version?

To Reproduce
Make sure to read https://github.com/folke/lazy.nvim/wiki/Minimal-%60init.lua%60-to-Reproduce-an-Issue

Steps to reproduce the behavior:

Expected Behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

repro.lua
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 = {
  -- do not remove the colorscheme!
  "folke/tokyonight.nvim",
  -- add any other pugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

-- add anything else here
vim.opt.termguicolors = true
-- do not remove the colorscheme!
vim.cmd([[colorscheme tokyonight]])

Log
Please include any related errors from the Noice log file. (open with :Lazy log)

Lazy log
Failed to source `~/.local/share/nvim/lazy/nvim-lspconfig/plugin/lspconfig.lua`

...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:189: Vim(source):E5113: Error while calling lua chunk: ....local/share/nvim/lazy/lazy.nvim/lua/lazy/core/cache.lua:106: cannot open /tmp/.mount_nvimsFlaRO/usr/share/nvim/runtime/lua/vim/lsp.lua: No such file or directory
stack traceback:
[C]: in function 'error'
....local/share/nvim/lazy/lazy.nvim/lua/lazy/core/cache.lua:106: in function <....local/share/nvim/lazy/lazy.nvim/lua/lazy/core/cache.lua:86>
[C]: in function 'require'
vim/_init_packages.lua: in function '__index'
...ocal/share/nvim/lazy/nvim-lspconfig/plugin/lspconfig.lua:1: in main chunk
[C]: in function 'cmd'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:189: in function <...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:188>
[C]: in function 'xpcall'
.../.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua:78: in function 'try'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:188: in function 'source'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:182: in function 'source_runtime'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:153: in function 'packadd'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:137: in function 'load'
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:59: in function 'startup'
...ceanh/.local/share/nvim/lazy/lazy.nvim/lua/lazy/init.lua:58: in function 'setup'
~/.config/nvim/init.lua:153: in main chunk

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

folke commented Dec 22, 2022

Can you give me more details on this issue?

@goingtosleep
Copy link

goingtosleep commented Dec 22, 2022

Thanks @folke , below is the steps to reproduce. Please let me know if you need anything else.

To reproduce:

  1. Prepare 2 different nvim appimage binaries and repro.lua as in here.
    I included everything in this google drive link

  2. Let's call the 2 binaries nvim and nvim_old. Open nvim with the first binary: ./nvim -u repro.lua. This should start lazy syncing.

  3. Open again with nvim_old: ./nvim_old -u repro.lua. This gives the error as mentioned. The one I got with the reproduce:

Error detected while processing ~/Downloads/repro/repro.lua:
E5113: Error while calling lua chunk: ~/Downloads/repro/repro.lua:35: Vim(colorscheme):E5113: Error while calling lua chunk: .../repro/.repro//plugins/lazy
.nvim/lua/lazy/core/cache.lua:106: cannot open /tmp/.mount_nvimyQpiIn/usr/share/nvim/runtime/lua/vim/diagnostic.lua: No such file or directory
stack traceback:
        [C]: in function 'error'
        .../repro/.repro//plugins/lazy.nvim/lua/lazy/core/cache.lua:106: in function <.../repro/.repro//plugins/lazy.nvim/lua/lazy/core/cache.lua:86>
        [C]: in function 'require'
        vim/_init_packages.lua: in function '__index'
        .../.repro/plugins/tokyonight.nvim/lua/tokyonight/theme.lua:692: in function 'setup'
        ...o/.repro/plugins/tokyonight.nvim/lua/tokyonight/init.lua:23: in function 'load'
        ...o/.repro/plugins/tokyonight.nvim/lua/tokyonight/init.lua:15: in function '_load'
        ...pro/.repro/plugins/tokyonight.nvim/colors/tokyonight.lua:1: in main chunk
        [C]: in function 'cmd'
        ~/Downloads/repro/repro.lua:35: in main chunk
stack traceback:
        [C]: in function 'cmd'
        ~/Downloads/repro/repro.lua:35: in main chunk
Press ENTER or type command to continue

When I delete state/nvim/lazy/cache and open nvim again, it generates a new cache file and starts normally.

@folke
Copy link
Owner Author

folke commented Dec 22, 2022

Thanks. I'm able to reproduce this. Looking into it. Something is defintely wrong there. Thank you for reporting!

@folke folke closed this as completed in 2200284 Dec 22, 2022
@folke
Copy link
Owner Author

folke commented Dec 22, 2022

Fixed!

@goingtosleep
Copy link

Damn you're fast! Thanks a lot @folke 😄

@lewis6991
Copy link
Collaborator

This'll prevent anything in VIMRUNTIME from being cached since the appimage mounts itself into tmp each time.

@folke
Copy link
Owner Author

folke commented Dec 22, 2022

Yeah I know. Might add some special handling for this...

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.

3 participants