On 3 April 2013 06:21, Gaspard Bucher <gasp...@teti.ch> wrote: > Hi there, > > I have slightly fixed the modules to behave correctly regarding "require" > and global env. > > Now I stumble on something I was really not expecting: what is the proper > way to test my modules against lua 5.2 ? > > Installing is OK (even if it overwrites /usr/local/bin/lua). Now I have > three binaries to test "lua", "lua5.2" and "luajit". The problem is ... > luarocks. > > $ luarocks install luafilesystem --lua-version=5.2 > > ... > luafilesystem 1.6.2-1 is now built and installed in /usr/local/ > $ lua5.2 >> require 'lfs' > stdin:1: module 'lfs' not found: > no field package.preload['lfs'] > no file '/usr/local/share/lua/5.2/lfs.lua' > no file '/usr/local/share/lua/5.2/lfs/init.lua' > no file '/usr/local/lib/lua/5.2/lfs.lua' > no file '/usr/local/lib/lua/5.2/lfs/init.lua' > no file './lfs.lua' > no file '/usr/local/lib/lua/5.2/lfs.so' > no file '/usr/local/lib/lua/5.2/loadall.so' > no file './lfs.so' > stack traceback: > [C]: in function 'require' > stdin:1: in main chunk > [C]: in ? > > Lua 5.2 was released nearly a year and a half ago. I am not expecting "early > adopter" difficulties or maybe there is something important I am missing > here...
--lua-version=5.2 is not a flag for luarocks, but a flag for the LuaRocks configure script when installing the tool itself. > Having "lua/5.1" in the load paths was very promising concerning lua version > change (ruby people need strange tools like rbenv to solve this). I really > would like to write "lua >= 5.1, < 5.3" in my rockspec dependecies... > > Any hint ? LuaRocks runs fine as either Lua 5.1 and 5.2, but using both at the same time is still a bit tricky. Doug's suggestion works (running as lua5.2 `which luarocks` ...) I'll look into making this simpler. -- Hisham http://hisham.hm/ ------------------------------------------------------------------------------ Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html _______________________________________________ Luarocks-developers mailing list Luarocks-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/luarocks-developers