Lua 5.5.0 initial fixes#661
Conversation
* Language version must match exactly * Loop variables in Lua >=5.5 are RO (fix) * Rockspec permit build with Lua 5.5
Naive and probably needs better solutions instead of work-abounds but seems to work
hugomg
left a comment
There was a problem hiding this comment.
Looks promising!
I'll wait until we sort out the lua-internals PR before we run this through the CI. The CI won't work unless that other PR is merged first.
| line = line:match("^%s*(.-)%s*$") | ||
| local line | ||
| for _line in input:gmatch("([^\n]*)") do | ||
| line = _line:match("^%s*(.-)%s*$") |
There was a problem hiding this comment.
Can we declare the variable inside the for loop?
for _line in input:gmatch("([^\n]*)") do
local line = _line:match("^%s*(.-)%s*$")
| } | ||
| dependencies = { | ||
| "lua == 5.4", | ||
| "lua >= 5.4, < 5.6", |
There was a problem hiding this comment.
This should be exactly 5.5.
In fact, if Luarocks allowed it, we would specify the minor patch 5.5.0. Pallene is only compatible with one specific minor patch at a time, because we rely on internal APIs that can break even in a minor patch.
| } else { | ||
| return cast(TValue *, luaH_getstr(t, key)); | ||
| TValue idx; | ||
| return cast(TValue *, luaH_getstr(t, key, &idx)); |
There was a problem hiding this comment.
This looks sketchy. luaH_getstr now returns a lu_byte instead of a pointer. It probably makes no sense to cast the return value to TValue* ?
We need to look closer into this, but its possible that this API change is related to the 5.5 changes to the internal representation of arrays, which now stores the TValue tag separately from the payload. https://sol.sbc.org.br/index.php/sblp/article/view/30252
Trivial test, i.e. by far not complete: