Skip to content

Conversation

@slg95
Copy link

@slg95 slg95 commented Jul 14, 2025

Description

Previously, lazy.nvim health checks required exactly Lua 5.1, causing warnings on systems with newer Lua versions (5.2, 5.3, 5.4). This was unnecessarily restrictive since LuaRocks can run on any Lua version 5.1+ to build packages.

Its true that Neovim plugins must be Lua 5.1 compatible (due to LuaJIT), but the --lua-version 5.1 flag tells luarocks to build for 5.1.

After some light testing, I verified a system with Lua 5.4 should be able to build Lua 5.1-compatible packages just fine.
I tested with image.nvim (shown in screenshot below).

The key point is that this removes false warnings while maintaining the same safety guarantees - LuaRocks with any modern Lua version can still build packages targeting Lua 5.1 compatibility for Neovim.

Related Issue(s)

Fixes: #2020
Fixes: #1570

Screenshots

To test, I added the following to my init.lua:

  -- image.nvim - Image viewer that has a proper rockspec file
  {
    '3rd/image.nvim',
    build = "rockspec", -- This plugin has image.nvim-scm-1.rockspec in its repo!
    config = function()
      -- image.nvim shows images in Neovim
      -- require('image').setup({
      --   -- configuration options
      -- })
    end,
  },
Screenshot 2025-07-14 at 5 25 58 PM

Previously, lazy.nvim health checks required exactly Lua 5.1, causing
warnings on systems with newer Lua versions (5.2, 5.3, 5.4). This was
unnecessarily restrictive since LuaRocks can run on any Lua version 5.1+
to build packages.

Its true that Neovim plugins must be Lua 5.1 compatible (due to LuaJIT),
but the `--lua-version 5.1` flag tells luarocks to build for 5.1.

After some light testing, I verified a system with Lua 5.4 should be
able to build Lua 5.1-compatible packages just fine.

The key point is that this removes false warnings while maintaining the
same safety guarantees - LuaRocks with any modern Lua version can still
build packages targeting Lua 5.1 compatibility for Neovim.

Closes: folke#2020
@clason
Copy link
Collaborator

clason commented Jul 19, 2025

Thanks, but this warning is intended. You can work around this if you know your way around luarocks, but that is not the reason for this warning (which is just that: a warning).

@clason clason closed this Jul 19, 2025
@slg95
Copy link
Author

slg95 commented Jul 21, 2025

@clason But why is this warning intended? From the discussions in #2020 and #1570, there were no concrete reasons given for why this warning exists. Just because Neovim requires plugins use Lua 5.1 doesn't mean you actually need to have Lua 5.1 installed to build LuaRocks packages that are compatible with Lua 5.1.

There are of course plenty of workarounds, such as installing Lua 5.1 or just ignoring the warning. But why should people have to work around this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Lazy gives warning for Lua version even if it is greater than the minimum version luarocks needs lua 5.1

2 participants