Search code examples
lualuarocks

Any conflict if Luarocks is compiled w/a different Lua than the target?


If I compile Luarocks with a Lua (eg PUC 5.3), then use Luarocks to install rocks to be used by a different Lua (eg Luajit, Luarocks --tree my/lua-project-5.1), would there be any conflict down the line?


Solution

  • Yes. You shouldn't mix Lua versions like that, because when building modules written in C, they will use the header files for the specific Lua version that LuaRocks was configured for. This will result in modules that will either fail to build or fail to load in other versions of the interpreter.

    Note however that you can have multiple simultaneous installations of LuaRocks, each for one Lua version.