mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-07-21 04:35:12 +00:00
fix(health, rockspec): accept Lua 5.1+ for luarocks compatibility
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: #2020
This commit is contained in:
parent
6c3bda4aca
commit
17732094c8
2 changed files with 4 additions and 4 deletions
|
@ -43,7 +43,7 @@ function M.have(cmd, opts)
|
||||||
else
|
else
|
||||||
local version = vim.trim(out[1] or "")
|
local version = vim.trim(out[1] or "")
|
||||||
version = version:gsub("^%s*" .. vim.pesc(c) .. "%s*", "")
|
version = version:gsub("^%s*" .. vim.pesc(c) .. "%s*", "")
|
||||||
if opts.version_pattern and not version:find(opts.version_pattern, 1, true) then
|
if opts.version_pattern and not version:find(opts.version_pattern) then
|
||||||
opts.warn(("`%s` version `%s` needed, but found `%s`"):format(c, opts.version_pattern, version))
|
opts.warn(("`%s` version `%s` needed, but found `%s`"):format(c, opts.version_pattern, version))
|
||||||
else
|
else
|
||||||
found = ("{%s} `%s`"):format(c, version)
|
found = ("{%s} `%s`"):format(c, version)
|
||||||
|
@ -59,7 +59,7 @@ function M.have(cmd, opts)
|
||||||
(opts.optional and opts.warn or opts.error)(
|
(opts.optional and opts.warn or opts.error)(
|
||||||
("{%s} %snot installed"):format(
|
("{%s} %snot installed"):format(
|
||||||
table.concat(cmd, "} or {"),
|
table.concat(cmd, "} or {"),
|
||||||
opts.version_pattern and "version `" .. opts.version_pattern .. "` " or ""
|
opts.version_pattern and "version matching `" .. opts.version_pattern .. "` " or ""
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -82,7 +82,7 @@ function M.check(opts)
|
||||||
M.hererocks.bin("lua"),
|
M.hererocks.bin("lua"),
|
||||||
vim.tbl_extend("force", opts, {
|
vim.tbl_extend("force", opts, {
|
||||||
version = "-v",
|
version = "-v",
|
||||||
version_pattern = "5.1",
|
version_pattern = "5%.[1-9]",
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
@ -92,7 +92,7 @@ function M.check(opts)
|
||||||
{ "lua5.1", "lua", "lua-5.1" },
|
{ "lua5.1", "lua", "lua-5.1" },
|
||||||
vim.tbl_extend("force", opts, {
|
vim.tbl_extend("force", opts, {
|
||||||
version = "-v",
|
version = "-v",
|
||||||
version_pattern = "5.1",
|
version_pattern = "5%.[1-9]",
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue