소스 검색

[ci] Support Lua 5.4 (#11069)

* ci

* retry

* Get traces from node deadlocks

If github does not send SIGINT after 6h run, then `timeout -s INT 1h node ...` will be required

* Revert "Get traces from node deadlocks"

This reverts commit 45161c3568c55806d1f2576253156a50b7046c79.
RblSb 1 년 전
부모
커밋
d4040dfd56
4개의 변경된 파일20개의 추가작업 그리고 9개의 파일을 삭제
  1. 1 1
      .github/workflows/main.yml
  2. 1 1
      extra/github-actions/workflows/main.yml
  3. 16 6
      tests/runci/targets/Lua.hx
  4. 2 1
      tests/unit/src/unit/TestResource.hx

+ 1 - 1
.github/workflows/main.yml

@@ -650,7 +650,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        target: [macro, js, hl, cpp, jvm, php, python, flash, neko]
+        target: [macro, js, hl, cpp, jvm, php, python, lua, flash, neko]
         include:
           - target: hl
             BREW_PACKAGES: ninja

+ 1 - 1
extra/github-actions/workflows/main.yml

@@ -362,7 +362,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        target: [macro, js, hl, cpp, jvm, php, python, flash, neko]
+        target: [macro, js, hl, cpp, jvm, php, python, lua, flash, neko]
         include:
           - target: hl
             BREW_PACKAGES: ninja

+ 16 - 6
tests/runci/targets/Lua.hx

@@ -48,7 +48,7 @@ class Lua {
 
 		getLuaDependencies();
 
-		for (lv in ["-l5.1", "-l5.2", "-l5.3"].concat(systemName == 'Linux' && Linux.arch == Arm64 ? [] : ["-j2.0", "-j2.1"])) {
+		for (lv in ["-l5.1", "-l5.2", "-l5.3", "-l5.4"].concat(systemName == 'Linux' && Linux.arch == Arm64 ? [] : ["-j2.0", "-j2.1"])) {
 			final envpath = getInstallPath() + '/lua_env/lua$lv';
 			addToPATH(envpath + '/bin');
 
@@ -73,23 +73,33 @@ class Lua {
 			installLib("luasec", "1.0.2-1");
 
 			installLib("lrexlib-pcre2", "2.9.1-1");
-			installLib("luv", "1.36.0-0");
 			installLib("luasocket", "3.0rc1-2");
-			installLib("luautf8", "0.1.1-1");
 
 			//Install bit32 for lua 5.1
-			if(lv == "-l5.1"){
+			if (lv == "-l5.1")
 				installLib("bit32", "5.2.2-1");
+
+			if (lv == "-l5.4") {
+				installLib("bit32", "5.3.5.1-1");
+				installLib("luv", "1.44.2-1");
+				installLib("luautf8", "0.1.5-2");
+			} else {
+				installLib("luv", "1.36.0-0");
+				installLib("luautf8", "0.1.1-1");
 			}
 
 			installLib("hx-lua-simdjson", "0.0.1-1");
 
 			changeDirectory(unitDir);
-			runCommand("haxe", ["compile-lua.hxml"].concat(args));
+			final luaDefine = if (lv.startsWith("-l")) {
+				lv.replace("-l", "lua").replace(".", "_");
+			} else lv.replace("-j", "luajit").replace(".", "_");
+			final luaVer = ["-D", luaDefine];
+			runCommand("haxe", ["compile-lua.hxml"].concat(args).concat(luaVer));
 			runCommand("lua", ["bin/unit.lua"]);
 
 			changeDirectory(sysDir);
-			runCommand("haxe", ["compile-lua.hxml"].concat(args));
+			runCommand("haxe", ["compile-lua.hxml"].concat(args).concat(luaVer));
 			runSysTest("lua", ["bin/lua/sys.lua"]);
 
 			changeDirectory(getMiscSubDir("luaDeadCode", "stringReflection"));

+ 2 - 1
tests/unit/src/unit/TestResource.hx

@@ -18,7 +18,8 @@ class TestResource extends Test {
 		#if (neko || php || eval)
 		// allow binary strings
 		eq(haxe.Resource.getBytes("re/s?!%[]))(\"'1.bin").sub(0, 9).toHex(), "48656c6c6f2c204927");
-		#else
+		// updated luautf8.len returns nil for data with invalid sequences
+		#elseif !lua5_4
 		// cut until first \0
 		eq(haxe.Resource.getString("re/s?!%[]))(\"'1.bin").substr(0, 2), "He");
 		#end