Opened 2 years ago

Last modified 18 months ago

#20821 new defect

OpenWrt Lua patches break standard Lua runtime compatibility

Reported by: alex@… Owned by: developers
Priority: normal Milestone:
Component: packages Version: Chaos Calmer 15.05
Keywords: Cc:


I was trying to get luarocks working. With some help from #lua channel on freenode (and other places), I was able to deduce that one of the OpenWrt patches for Lua breaks it.

OpenWrt Lua:

# lua -e 'mt={__lt=print}; print(setmetatable({}, mt) < setmetatable({}, mt))'
lua: (command line):1: attempt to compare two table values
stack traceback:
        (command line):1: in main chunk
        [C]: ?

Normal Lua:

$ lua -e 'mt={__lt=print}; print(setmetatable({}, mt) < setmetatable({}, mt))'
table: 0x60c270 table: 0x60c430

The patch which might be causing it is '010-lua-5.1.3-lnum-full-260308.patch'.

I removed a number of those patches (as well as applying various other fixes) and was able to get luarocks to work finally. Still, this particular problem lies in the base OpenWrt Lua runtime, not with luarocks. Language related stuff in OpenWrt Lua runtime should not differ from standard Lua runtime otherwise bad things will happen.

You can reproduce this problem by using 15.05 release x86 image and the above code.

Attachments (0)

Change History (1)

comment:1 Changed 18 months ago by karlp@…

lnum is a known, well established patch set, it's _not_ meant to be, nor does it claim complete "standard" lua compliance. Neither does luajit, and neither does lua 5.1 vs 5.2 vs 5.3....

Add Comment

Modify Ticket

as new .

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.