HaxeFoundation / HaxeManual

The official Haxe manual
https://haxe.org/manual/
Creative Commons Attribution 4.0 International
221 stars 153 forks source link

Update lua dependencies #523

Closed tobil4sk closed 1 year ago

tobil4sk commented 1 year ago

Regex library is handled separately in #522

Simn commented 1 year ago

This conflicts after merging the other PR.

And is this really saying that this should install this library on 5.1 and 5.4, but not on 5.3 (which it used to say).

tobil4sk commented 1 year ago

Yes, it was incorrect before. For 5.2 and 5.3, the bit32 library is a built-in part of std so it does not need to be installed manually. 5.1 didn't have this library yet, so someone created a backport and uploaded it to luarocks, which is why you need to run luarocks install bit32 on 5.1.

Then, 5.4 removed this library in favour of native bitwise operators, which is why the bit32 library (originally intended just as a backport for 5.1, but now usable on anything < 5.5) should be installed on 5.4 as well.

Our unit tests don't install bit32 from luarocks on 5.3 and they run fine: https://github.com/HaxeFoundation/haxe/blob/dd0d6a64e90f3b93b8a1be966184f51bc6d35903/tests/runci/targets/Lua.hx#L80-L83.

RblSb commented 1 year ago

Our tests also depend on specific old versions of luasocket / luv / luautf8, for example you cannot install old enough luautf8 on lua 5.4 to make length work on broken unicode strings, instead of returning nil (can affect http requests and other stuff). I'm not sure about best solution here.