Problem using luarocks on F35

Installed lua 5.4 and it works fine. Luarocks, when installed from main fedora repo is not installed with a working configuration. Tried to install a rock and found I kept getting permission issues and other problems.

luarocks install lcurses gives:
*Error: Your user does not have write permissions in /usr/lib/luarocks/rocks-5.4
– you may want to run as a privileged user or use your local tree with --local.
*
luarocks install --local lcurses gives:
*Installing https://luarocks.org/lcurses-6-2.src.rock

Error: Failed finding Lua header files. You may need to install them or configure LUA_INCDIR.
*

Other operations yield results that seem to indicate problems with lua and/or luarocks specific configuration unfinished, missing, or wrong. I welcome any advice and will post any potentially useful information if and when I have some.

Ok. found it. I just moved to Fedora so I don’t know much about doing things in a Fedora-like way. I kept searching for answers and eventually found that even though nothing complained about lua.h, that it is needed by luarocks. Lo and behold I have no lua.h… So I installed ‘lua-devel’.

Still can’t get lcurses to install, but it may be abandoned and luarocks definitely complains about my Lua version being outside of its version check.

Understandable, we were all there at one point or another.

Well, that’s actually a good point, and not really your fault. Luarocks, by its very nature, can be expected to need to compile some of the Lua code it’s asked to install. It can’t do that without the necessary header files.

So, having it depend on lua(abi) (which is provided by lua-libs) probably isn’t sufficient. The luarocks package should also require either lua-devel or pkgconfig(lua), which will cause lua-devel to be pulled in automatically on install of luarocks. That’s how Fedora packaging is meant to work, and if the luarocks package had the correct dependencies you couldn’t not have had lua-devel installed along with it.

I’ve opened Fedora bug 2091484 regarding the missing dependency on lua-devel.

It turns out lua-devel was already a dependency, but it was a Suggests: dependency. IMHO that’s insufficient, as it won’t trigger automatic installation by default.

I’ve submitted a PR to correct that, add a couple of other missing dependencies, and update luarocks to version 3.9.0 while I’m at it. (I don’t have any prediction or expectation as to whether that will be accepted or rejected, or if it will end up being ignored. There’s certainly no set timeframe for either of the first two happening. But, hey, “fingers crossed” I guess? :roll_eyes: )

2 Likes