lua-travis-example icon indicating copy to clipboard operation
lua-travis-example copied to clipboard

LuaJIT won't find its JIT library (jit.* modules)

Open n1tehawk opened this issue 9 years ago • 1 comments

This project currently installs the LuaJIT interpreter with only a standard search path for Lua modules, based on /usr/local. .travis/setenv_lua.sh then arranges for an updated LUA_PATH including the LuaRocks directories, but also ignores the LUA_HOME_DIR where LuaJIT actually got installed.

This isn't a problem for "normal" Lua[JIT] use, unless you start requiring the jit.* modules (directly or indirectly). For example, requesting a bytecode listing with luajit -bl mysource.lua causes an error luajit: unknown luaJIT command or jit.* modules not installed.

I've been experimenting a bit, and it seems there actually is a trivial solution to this. Simply changing the line .travis/setup_lua.sh#L56 from make && make install PREFIX="$LUA_HOME_DIR" to make PREFIX="$LUA_HOME_DIR" && make install PREFIX="$LUA_HOME_DIR" will modify the (builtin) search path in a way that includes the LuaJIT destination directory, which I consider more suitable for the Travis CI installation. With this change applied, the jit.* modules are found without problems.

Regards, NiteHawk

n1tehawk avatar Jun 05 '16 18:06 n1tehawk

thanks , for nginx.lua, see the error message "unknown luaJIT command or jit.* modules not installed", I got the solution to the problem from your content

shorile avatar Feb 10 '21 03:02 shorile