nvim-neorocks / rocks.nvim

🌒 Neovim plugin management inspired by Cargo, powered by luarocks
GNU General Public License v3.0
657 stars 12 forks source link

Installation scripts fails to configure luarocks due to missing `--with-lua-include' flag #493

Open robin-carlier opened 1 month ago

robin-carlier commented 1 month ago

When trying to install rocks.nvim through the install script, the installer fails to configure luarocks with the following error message:

Configuring LuaRocks version dev...

Lua interpreter found: /bin/lua5.1
Checking if /bin/lua5.1 is Lua version 5.1... yes
lua.h for Lua 5.1 not found (tried //include/lua/5.1/lua.h //include/lua5.1/lua.h //include/lua-5.1/lua.h //include/lua51/lua.h //include/lua.h)

If the development files for Lua (headers and libraries)
are installed in your system, you may need to use the
--with-lua or --with-lua-include flags to specify their location.

If those files are not yet installed, you need to install
them using the appropriate method for your operating system.

Run ./configure --help for details on flags.

configure failed.

A fix is to download the installation script and to modify the configuration command (line 192 of installer.lua) to add the --with-lua-include flag with a path containing the required includes (for instance /usr/include did the trick on Debian testing with the package liblua5.1-0-dev installed).

It would be nice to modify the installation script in a way that allows the user to set this flag through an environment variable instead of having to download, edit and run it locally.

mrcjkb commented 1 month ago

Hey :wave:

thanks for reporting. I'll look into this. We've also thought of packaging a pre-built luarocks (perhaps bundled with Lua 5.1).