folke / lazy.nvim

💤 A modern plugin manager for Neovim
https://lazy.folke.io/
Apache License 2.0
13.31k stars 319 forks source link

`luarocks` needs `lua 5.1` #1570

Closed kevinrobayna closed 4 weeks ago

kevinrobayna commented 4 weeks ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.10

Operating system/version

MacOs

Describe the bug

When i do a LazyHealth check wihtin lazyvim it says that luarocks is installed but the version is not correct. Looking at the website of luarocks they are even using luarock with lua 5.3.

Steps To Reproduce

Install the latest version of lua Install luarocks LazyHealth

image

Expected Behavior

It should not give a warning as I'm using a newer version of lua

Repro

-- DO NOT change the paths and don't remove the colorscheme
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", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
folke commented 4 weeks ago

luarocks for NEovim plugins requires Lua 5.1, that is completely correct.

folke commented 4 weeks ago

I've improved the health check to show steps you can do to fix your luarocks installation.

image

kevinrobayna commented 4 weeks ago

luarocks for NEovim plugins requires Lua 5.1, that is completely correct.

oh! ok thank you! I wanted to create the ticket more of a question as I wasn't sure.

kevinm6 commented 3 weeks ago

luarocks for NEovim plugins requires Lua 5.1, that is completely correct.

@folke thanks for a lot of your plugins! I have a question, since Lazy supports now luarocks and especially on macOS with Homebrew, lua@5.1 is deprecated and needs workaround to work with newer version, isn't enough luarocks --lua-version=5.1 even with newer version of Lua as you’re already using ?

https://github.com/folke/lazy.nvim/blob/ec95702ae617308df35f35ad93c469c86d47346f/lua/lazy/pkg/rockspec.lua#L167-L184

folke commented 3 weeks ago

Yes, you need 5.1. This is the last time I'll answer this question.

folke commented 3 weeks ago

As is explained in the healthcheck, you can just enable hererocks instead

rmacklin commented 4 days ago

In case it's helpful to anyone, mise can be used to install lua 5.1 (with luarocks):

mise plugins add lua
mise use -g lua@5.1

after which luarocks should be available from ~/.local/share/mise/installs/lua/5.1/luarocks/bin/luarocks and :checkhealth in neovim won't show any errors or warnings about luarocks.