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: switching between neovim stable|nightly errors with "cannot load incompatible bytecode" #225

Closed
3 tasks done
ibhagwan opened this issue Dec 29, 2022 · 10 comments · Fixed by #197
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@ibhagwan
Copy link

ibhagwan commented Dec 29, 2022

Did you check docs and existing issues?

  • I have read all the lazy docs
  • I have searched the existing issues of lazy
  • I have searched the exsiting issues of the plugin I have a problem with

Neovim version (nvim -v)

0.8.1

Operating system/version

Linux

Describe the bug

When cache is enabled trying to use the nightly appimage results in the error:

E5108: Error executing lua ....local/share/nvim/lazy/lazy.nvim/lua/lazy/core/cache.lua:134: /home/bhagwan
/.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua: cannot load incompatible bytecode
stack traceback:
        [C]: in function 'error'
        ....local/share/nvim/lazy/lazy.nvim/lua/lazy/core/cache.lua:134: in function <....local/share/nvi
m/lazy/lazy.nvim/lua/lazy/core/cache.lua:108>
        [C]: in function 'require'
        ...agwan/.local/share/nvim/lazy/lazy.nvim/lua/lazy/init.lua:31: in function 'setup'
        /home/bhagwan/.config/nvim/lua/lazyplug.lua:20: in main chunk
        [C]: in function 'require'
        /home/bhagwan/.config/nvim/lua/init.lua:244: in main chunk
        [C]: in function 'require'
        [string ":lua"]:1: in main chunk

Steps To Reproduce

  1. Setup lazy nvim with neovim 8.1 and cache enabled
  2. Start neovim 0.8.1
  3. Download curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage
  4. Start the appimage with chmod a+x nvim.appimage && nvim.appimage

Expected Behavior

Auto-detect the compiled bytes are a from different neovim version and regenerate cache when switching between stable and nightly.

@ibhagwan ibhagwan added the bug Something isn't working label Dec 29, 2022
@folke folke closed this as completed in e3ffcff Dec 29, 2022
@folke
Copy link
Owner

folke commented Dec 29, 2022

I can not reproduce this. I've added jit.version to the cache version string, but both 0.8.1 and nightly already use the same version of jit.

Was the 0.8.1 version linked to puc instead of jit maybe? If so you should now get an errro instead that you need to have a neovim version built with luajit

@ibhagwan
Copy link
Author

I can not reproduce this. I've added jit.version to the cache version string, but both 0.8.1 and nightly already use the same version of jit.

Was the 0.8.1 version linked to puc instead of jit maybe? If so you should now get an errro instead that you need to have a neovim version built with luajit

Still getting the same exact error unfortuntaely.

Neovim 0.8.1 version output:

:version
NVIM v0.8.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by void-buildslave@a-fsn-de

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Neovim nightly:

:version
NVIM v0.9.0-dev-577+g587fbdd7a
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-10 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_T
S_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=
gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-pr
ototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DI
NCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LO
G_LEVEL=3 -I/__w/neovim/neovim/build/cmake.config -I/__w/neovim/neovim/src -I/__w/neovim/neovim/.deps/usr
/include -I/usr/include -I/__w/neovim/neovim/build/src/nvim/auto -I/__w/neovim/neovim/build/include
Compiled by root@d49e783ec01b

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/__w/neovim/neovim/build/nvim.AppDir/usr/share/nvim"

Run :checkhealth for more info

Which fails with error:

Error detected while processing /home/bhagwan/.config/nvim/init.vim:
line   19:
E5108: Error executing lua ....local/share/nvim/lazy/lazy.nvim/lua/lazy/core/cache.lua:134: /home/bhagwan
/.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua: cannot load incompatible bytecode
stack traceback:
        [C]: in function 'error'
        ....local/share/nvim/lazy/lazy.nvim/lua/lazy/core/cache.lua:134: in function <....local/share/nvi
m/lazy/lazy.nvim/lua/lazy/core/cache.lua:108>
        [C]: in function 'require'
        ...agwan/.local/share/nvim/lazy/lazy.nvim/lua/lazy/init.lua:31: in function 'setup'
        /home/bhagwan/.config/nvim/lua/lazyplug.lua:20: in main chunk
        [C]: in function 'require'
        /home/bhagwan/.config/nvim/lua/init.lua:244: in main chunk
        [C]: in function 'require'
        [string ":lua"]:1: in main chunk

@folke folke reopened this Dec 29, 2022
@folke
Copy link
Owner

folke commented Dec 29, 2022

Your LuaJit version is exactly the same between both. Is there anything else special about your installation? Where did you get the 0.8.1 from? Is that also appimage?

@ibhagwan
Copy link
Author

Your LuaJit version is exactly the same between both. Is there anything else special about your installation? Where did you get the 0.8.1 from? Is that also appimage?

My 0.8.1 comes from the void linux packages (prebuilt binaries), I will download the 0.8.1 appimage, clean and reinstall lazy and see if that makes any difference.

@ibhagwan
Copy link
Author

Ok, so I downloaded the 0.8.1 appimage, deleted the ~/.local/share/nvim/lazy and ~/.local/state/nvim/lazy folders and I'm getting the same errors only this time multiplied by the number of plugins, seems like the compiled bytecode from the appimages isn't able to load even when compiled by it's own appimage binaries:

Failed to load **plugins.cmp**
....local/share/nvim/lazy/lazy.nvim/lua/lazy/core/cache.lua:134: /home/bhagwan/.config/nvim/lua/plugins/c
mp.lua: cannot load incompatible bytecode
# stacktrace:
  - ~/.config/nvim/lua/lazyplug.lua:20
  - ~/.config/nvim/lua/init.lua:244
Press ENTER or type command to continue
  - lua:1
Press ENTER or type command to continue
Failed to load **plugins.comment**
....local/share/nvim/lazy/lazy.nvim/lua/lazy/core/cache.lua:134: /home/bhagwan/.config/nvim/lua/plugins/c
omment.lua: cannot load incompatible bytecode
# stacktrace:
  - ~/.config/nvim/lua/lazyplug.lua:20
  - ~/.config/nvim/lua/init.lua:244
Press ENTER or type command to continue
  - lua:1
Press ENTER or type command to continue
Failed to load **plugins.devicons**
....local/share/nvim/lazy/lazy.nvim/lua/lazy/core/cache.lua:134: /home/bhagwan/.config/nvim/lua/plugins/d
evicons.lua: cannot load incompatible bytecode
# stacktrace:
  - ~/.config/nvim/lua/lazyplug.lua:20
  - ~/.config/nvim/lua/init.lua:244
Press ENTER or type command to continue
  - lua:1
Press ENTER or type command to continue
Failed to load **plugins.fugitive**
....local/share/nvim/lazy/lazy.nvim/lua/lazy/core/cache.lua:134: /home/bhagwan/.config/nvim/lua/plugins/f
ugitive.lua: cannot load incompatible bytecode
# stacktrace:
  - ~/.config/nvim/lua/lazyplug.lua:20
  - ~/.config/nvim/lua/init.lua:244
Press ENTER or type command to continue
  - lua:1
Press ENTER or type command to continue
Failed to load **plugins.fzf-lua**
....local/share/nvim/lazy/lazy.nvim/lua/lazy/core/cache.lua:134: /home/bhagwan/.config/nvim/lua/plugins/f
zf-lua/init.lua: cannot load incompatible bytecode
# stacktrace:
...

@folke
Copy link
Owner

folke commented Dec 29, 2022

You need to delete ~/.cache/nvim/lazy/cache

@ibhagwan
Copy link
Author

You need to delete ~/.cache/nvim/lazy/cache

Oops I guess I missed that, so switching between the 0.8.1 and 0.9 appiamges works with no issue but as expected I can't switch between the appimage and my local 0.8.1 binaries.

I can workaround this by doing a simple test (in the code) and deleting ~/.cache/nvim/lazy/cache if need be, not sure if this is worth your time.

@folke folke closed this as completed in b8c5ab5 Dec 29, 2022
@folke
Copy link
Owner

folke commented Dec 29, 2022

I just pushed a change that should fix the incompatible byte code as well

@folke
Copy link
Owner

folke commented Dec 29, 2022

Can you see if the new version works without issues?

@ibhagwan
Copy link
Author

I just pushed a change that should fix the incompatible byte code as well

Just tested, worked like a charm :-)

Tyvm!

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