folke / lazy.nvim

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

feature: check incompatible luarocks version #1741

Closed boltlessengineer closed 2 weeks ago

boltlessengineer commented 3 weeks ago

Did you check the docs?

Is your feature request related to a problem? Please describe.

Continuing from https://github.com/rest-nvim/rest.nvim/issues/450

lazy.nvim seems to only use hererocks when it can’t find luarocks from PATH. But it doesn’t check if installed luarocks is compatible version.

So for example, as what happens from the issue above, lazy.nvim tries to use luarocks even the version is way too old (2.4.2 from that issue)

Describe the solution you'd like

Check installed luarocks version and use hererocks if the installed luarocks is incompatible version.

Describe alternatives you've considered

Additional context

No response

folke commented 2 weeks ago

Just make sure you have a properly working configured lazy/luarocks/hererocks. I can't possibly account for all user issues.

boltlessengineer commented 2 weeks ago

@folke I understand your point, What is the least compatible version of luarocks then? It isn’t documented right now.

folke commented 2 weeks ago

That totally depends on the plugins you want to install, so no idea...

boltlessengineer commented 2 weeks ago

In the issue I mentioned, lazy.nvim tried to run luarocks install --dev … but failed because installed luarocks version was 2.4.2 which doesn’t support --dev flag so clearly lazy.nvim requires luarocks version higher than 2.5 (I don’t know exactly what version first included --dev flag) and I’m saying this should be documented.

https://github.com/folke/lazy.nvim/blob/460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb/lua/lazy/pkg/rockspec.lua#L197-L211