fix(health, rockspec): accept Lua 5.1+ for luarocks compatibility #2022
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.1flag 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: