HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.17k stars 654 forks source link

[CI] Fix lua tests on windows #10919

Open kLabz opened 1 year ago

kLabz commented 1 year ago

Lua tests have been fixed in https://github.com/HaxeFoundation/haxe/pull/10916, but are still failing on windows.

Current attempt at fixing CI for windows is making progress but is not there yet. @inklit if you give up please provide some informations about what problems you faced / what you tried so far..

I'm disabling lua tests on windows again until this is fixed; at least now lua tests are running on unix :+1:

inklit commented 1 year ago

Here's the current state: In order for tests to work on Windows, we need to link libopenssl, libpcre, and libuv with the current Lua runtime.

libopenssl is relatively straight forward: we just install it from choco and then set the openssl directory. libpcre is a bit not as straight forward, we can install it from msys2's pacman, but have to install msys2 first, then we can directly set the libpcre directory as well.

My PR does both of these, although the catch is: you need to install the correct ARCH version of these libs, and the directories will be different on 32 bit vs. 64 bit, so my current PR only supports 64 bit. This is easy to address after we figure out what else is broken.

There is another issue (hopefully the last...) related to libuv. During the installation of libuv, the luarocks config is providing an incorrect location for liblua:

- Lua: using information from luarocks
-- LUA_LIBDIR: C:\Users\runneradmin\haxe-ci\lua_env\lua-l5.1\bin

^this should actually be \lib, it seems it got bindir and libdir mixed up, which results in this error:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
LUA_LIBRARIES
    linked by target "luv" in directory C:/Users/runneradmin/AppData/Local/Temp/luarocks_luv-1.36.0-0-442/luv-1.36.0-0
CMake Generate step failed.  Build files cannot be regenerated correctly.
l0go commented 1 year ago

Would it be better to get libpcre into Choco's repo? Not too familiar with it.

inklit commented 1 year ago

Would it be better to get libpcre into Choco's repo? Not too familiar with it.

It would be faster, for sure.

FYI, I was able to fix libpcre, libuv, and libopenssl, but now our own hx-lua-simdjson library is failing to build, and at this point I give up because this repository is abandoned, never had 32 bit support, and likely never built properly for MingGW.

tobil4sk commented 1 year ago

hx-lua-simdjson library is failing to build, and at this point I give up because this repository is abandoned, never had 32 bit support, and likely never built properly for MingGW.

We could try to update hx-lua-simdjson with a newer version from https://github.com/simdjson/simdjson, but it might take some work. Seems there is some chance that 32 bit works: https://github.com/simdjson/simdjson/issues/742#issuecomment-618513037

tobil4sk commented 3 months ago

I've sent some upstream patches to lua-simdjson which allow it to compile both on windows and on unix: https://github.com/FourierTransformer/lua-simdjson/pull/82. Previous patches got windows working but broke mac/linux builds.

If we can have a HaxeFoundation/hx-lua-simdjson repo, we can pull these changes in from upstream and maybe get further with this.

tobil4sk commented 1 month ago

I had to send a few more bug fixes upstream to get the haxe unit tests passing, but everything seems to be working now! Windows support in hx-lua-simdjson is now available with this PR: https://github.com/HaxeFoundation/hx-lua-simdjson/pull/1