You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make bit32 dependency conditional (for lua 5.5) #245
Following up wahern/cqueues#265), http can now use a Lua 5.5 compatible version of cqueues.
The http rock is still pinned behind 5.5 though,because of the bit32 requirement which is not available (and supposedly, not needed for lua>5.1) for lua5.5.
Some other projects, such as luaposix, use this trick:
do
-- We only want to install a bit32 module for Lua 5.1.
local _ENV={package=nil, dependencies=dependencies}
if package then
dependencies[#dependencies + 1] = 'bit32'
end
end
I have no experience with Lua 5.1 but I assume that it's relying on some boolean casting of nil that changed after that version.
Can a similar method be used in the http rockspec?
Any way I could think up to make this nicer would be an incompatble change in LuaRocks (though I'm more keen to the idea of a rockspec v4 format now). Perhaps @siffiejoe could release a bit32 package update that's just a no-op in Lua 5.5? (As is already the case for Lua 5.2-to-5.4).
In the meantime you could luarocks upload your own fork of the bit32 rockspec with Lua 5.5 support and then depend on "daurnimator/bit32" — rock namespaces have been supported for a long time now (Luarocks 3.0?), they're just not used a lot.
Yes, I already have my own rockspec that removes the bit32 dependency altogether (my project is only compatible with 5.4 and above), but relying on a root manifest would be nicer.
Activity
daurnimator commentedon Oct 6, 2026
I tried to keep the rockspecs purely declarative.
lua-http/http-scm-0.rockspec
Line 17 in 0bb0036
@hishamhm should I add a condition to the rockspec? Or should I publish different rockspecs for each lua version like cqueues does?
hishamhm commentedon Oct 6, 2026
Any way I could think up to make this nicer would be an incompatble change in LuaRocks (though I'm more keen to the idea of a rockspec v4 format now). Perhaps @siffiejoe could release a
bit32package update that's just a no-op in Lua 5.5? (As is already the case for Lua 5.2-to-5.4).In the meantime you could
luarocks uploadyour own fork of the bit32 rockspec with Lua 5.5 support and then depend on"daurnimator/bit32"— rock namespaces have been supported for a long time now (Luarocks 3.0?), they're just not used a lot.scossu commentedon Oct 6, 2026
Yes, I already have my own rockspec that removes the bit32 dependency altogether (my project is only compatible with 5.4 and above), but relying on a root manifest would be nicer.