-
-
Notifications
You must be signed in to change notification settings - Fork 690
[ci] Enable lua tests on windows #12500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
By default, hererocks configures a very old generator so we need to set one manually for luv to build properly.
|
The 9757 failure is more general than the original issue, even this fails: function main() {
trace(Sys.systemName());
}It tries to run Line 298 in 0cb1c2d
And this is a minimal sample to reproduce the Socket error: function main() {
var s = new sys.net.Socket();
var host = new sys.net.Host("127.0.0.1");
s.bind(host, 0);
s.listen(1);
trace(s.host());
}It seems after the listen call, the host information isn't available anymore so |
The LuaSocket connect and bind methods are too high level. They also change the type of the object which previously required reconstructing a new TcpMaster object on certain method calls (e.g. listen()). We can avoid this by creating a generic TcpMaster object and using the lower level methods on it. This way it is still possible to bind and listen separately on windows which avoids a test failure. See luasocket documentation: https://lunarmodules.github.io/luasocket/tcp.html#listen https://lunarmodules.github.io/luasocket/socket.html#bind
This ended up running uname on windows, which doesn't work well on systems where it isn't available. We can instead check the system path separator and assume Windows if the separator is "\".
Since we prepare the arguments for parsing by cmd.exe, we need to skip CreateProcess handling otherwise the escape characters get messed up. The 'verbatim' option takes care of this. See luv docs: https://github.com/luvit/luv/blob/master/docs/docs.md#uvspawnpath-options-on_exit
The copy command does not work properly with /, we need to translate it to \. Also, now quoting is performed manually as SysTools.quoteWinArg doesn't quote if the argument contains a ",", which needs to be quoted as it has a special meaning for the windows "copy" command.
This reverts commit 7727f98. This causes more harm than good, as it breaks program paths containing spaces or other unusual characters.
Other haxe targets do not pass through the shell when args are given, and this makes it easier to properly handle weird characters in the program path or arguments, as we can let luv handle that. For reference, here is hxcpp's implementation, which only uses the shell if args are null: https://github.com/HaxeFoundation/hxcpp/blob/0d23f857c88a14ecabb946d4ae879a45a48b14ca/src/hx/libs/std/Process.cpp#L208
31b5c19 to
28239de
Compare
read and write were fixed in: 5b3641b but append was ommited.
Os.rename and Os.remove don't work with unicode paths on most systems, and we are using luv for most operations here anyway. Vanilla versions can still be used with `-D lua-vanilla`
Unlike the shell command, this will work properly with unicode paths on windows. If lua_vanilla is specified, fall back to the previous version.
|
The remaining unicode filesystem failures are down to the age old issue of windows ansi code pages (neko also suffers from this, and so does hxcpp for printing to stdout). Unfortunately, the builtin lua Io.open method uses c fopen that operates with the active code page on windows, which on most systems doesn't support the full unicode range. These are the options we could take:
External workarounds at the distributor/user level (not very practical):
None of these seem like great options unfortunately, but unicode is and has always been a pain on windows so this is not really our fault. I think for now I will add a define flag to set |
OpenSSL is preinstalled on the windows runner, so we can use that. Unlike the previous solution, this version sets up luarocks for visual studio binaries instead of mingw, which should be a bit simpler to set up. Still could have some improvements for local execution.
We now get past dependency setup, but some unit tests fail:
Fixes #6927
Closes #10919 (duplicate of above)
Closes #10917 (alternative PR)