aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorequa <equaa@protonmail.com>2020-11-27 12:40:14 -0600
committerequa <equaa@protonmail.com>2020-11-27 12:40:14 -0600
commitbe3b0c51059f95c40661846e7290ba47c6936c76 (patch)
treedb75739fb4d7b1c0c04f8b9736ab52525c507a4f /src
parentd2c3b57b324f06d17cd2c594e26b143dfe3a8133 (diff)
downloadluarocks-be3b0c51059f95c40661846e7290ba47c6936c76.tar.gz
luarocks-be3b0c51059f95c40661846e7290ba47c6936c76.tar.bz2
luarocks-be3b0c51059f95c40661846e7290ba47c6936c76.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/deps.lua4
1 files changed, 4 insertions, 0 deletions
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)
665 if data:match("LUA_VERSION_NUM%s*" .. tostring(luanum)) then 665 if data:match("LUA_VERSION_NUM%s*" .. tostring(luanum)) then
666 return d 666 return d
667 end 667 end
668
669 return nil, "Lua header mismatches configured version. You may need to install them or configure LUA_INCDIR.", "dependency"
668 end 670 end
671
672 return nil, "Failed finding Lua header files. You may need to install them or configure LUA_INCDIR.", "dependency"
669end 673end
670 674
671local function find_lua_incdir(prefix, luaver, luajitver) 675local function find_lua_incdir(prefix, luaver, luajitver)