From be3b0c51059f95c40661846e7290ba47c6936c76 Mon Sep 17 00:00:00 2001 From: equa Date: Fri, 27 Nov 2020 12:40:14 -0600 Subject: Add error messages to lua_h_exists Previously, if LUA_INCDIR was specified but invalid, install and other commands would error without a message, eventually causing a failed assertion in cmd.lua and leaving a hard-to-troubleshoot situation with no information. --- src/luarocks/deps.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua index 2233f74a..f6de0db8 100644 --- a/src/luarocks/deps.lua +++ b/src/luarocks/deps.lua @@ -665,7 +665,11 @@ local function lua_h_exists(d, luaver) if data:match("LUA_VERSION_NUM%s*" .. tostring(luanum)) then return d end + + return nil, "Lua header mismatches configured version. You may need to install them or configure LUA_INCDIR.", "dependency" end + + return nil, "Failed finding Lua header files. You may need to install them or configure LUA_INCDIR.", "dependency" end local function find_lua_incdir(prefix, luaver, luajitver) -- cgit v1.2.3-55-g6feb