Skip to content

Fix Luarocks 3.10 config for lua versions <= 5.3

Y requested to merge yparitcher/luarocks:LUA into main

As of version 3.10 upstream dropped usage of the LUA_INTERPRETER variable and instead uses the LUA variable with the path to the lua interpreter. This breaks the config files for pre 5.4 versions of lua.

example: currently we have a broken config with LUA = "/usr/bin/lua5.4"

-- LuaRocks configuration

rocks_trees = {
   { name = "user", root = home .. "/.luarocks" };
   { name = "system", root = "/usr" };
}
variables = {
   LUA_DIR = "/usr";
   LUA_INCDIR = "/usr/include/lua5.1";
   LUA_BINDIR = "/usr/bin";
   LUA_VERSION = "5.1";
   LUA = "/usr/bin/lua5.4";
}

With this MR:

-- LuaRocks configuration

rocks_trees = {
   { name = "user", root = home .. "/.luarocks" };
   { name = "system", root = "/usr" };
}
variables = {
   LUA_DIR = "/usr";
   LUA_INCDIR = "/usr/include/lua5.1";
   LUA_BINDIR = "/usr/bin";
   LUA_VERSION = "5.1";
   LUA = "/usr/bin/lua5.1";
}

Merge request reports