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

luarocks needs lua 5.1 #1570

Closed
3 tasks done
kevinrobayna opened this issue Jun 27, 2024 · 8 comments
Closed
3 tasks done

luarocks needs lua 5.1 #1570

kevinrobayna opened this issue Jun 27, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@kevinrobayna
Copy link

Did you check docs and existing issues?

  • I have read all the lazy.nvim docs
  • I have searched the existing issues of lazy.nvim
  • I have searched the existing issues of plugins related to this issue

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
@kevinrobayna kevinrobayna added the bug Something isn't working label Jun 27, 2024
@folke
Copy link
Owner

folke commented Jun 27, 2024

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

@folke folke closed this as not planned Won't fix, can't repro, duplicate, stale Jun 27, 2024
@folke folke pinned this issue Jun 27, 2024
@folke folke changed the title bug: lazy health check says luarocks needs lua 5.1 (and not at least) luarocks needs lua 5.1 Jun 27, 2024
@folke
Copy link
Owner

folke commented Jun 27, 2024

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

image

@kevinrobayna
Copy link
Author

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
Copy link

kevinm6 commented Jun 28, 2024

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 ?

local ok = task:spawn(luarocks, {
args = {
"--tree",
root,
"--server",
Config.options.rocks.server,
"--dev",
"--lua-version",
"5.1",
"install", -- use install so that we can make use of pre-built rocks
"--force-fast",
"--deps-mode",
"one",
rockspec.package,
},
cwd = task.plugin.dir,
env = env,
})

@folke
Copy link
Owner

folke commented Jun 28, 2024

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

@folke
Copy link
Owner

folke commented Jun 28, 2024

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

@rmacklin
Copy link

rmacklin commented Jul 21, 2024

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.

@kadimisetty
Copy link

5.1 is on nix as well, if that's more your thing:

nix profile install nixpkgs#lua51Packages.lua
nix profile install nixpkgs#lua51Packages.luarocks

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

No branches or pull requests

6 participants
@folke @kadimisetty @rmacklin @kevinrobayna @kevinm6 and others