diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 079bd461609..d8bb786b6eb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -478,12 +478,6 @@ jobs: mkdir "$env:HAXELIB_ROOT" haxelib setup "$env:HAXELIB_ROOT" - - name: Add msbuild to PATH (hl/c) - uses: microsoft/setup-msbuild@v2 - if: matrix.target == 'hl' - with: - msbuild-architecture: x64 - - name: Cache Lua environments uses: ./.github/actions/cache-lua if: matrix.target == 'lua' diff --git a/tests/runci/targets/Hl.hx b/tests/runci/targets/Hl.hx index f8fff44e48f..a4b0268ac98 100644 --- a/tests/runci/targets/Hl.hx +++ b/tests/runci/targets/Hl.hx @@ -29,10 +29,6 @@ class Hl { static public function getHlDependencies() { Sys.putEnv("HASHLINK", hlInstallDir); - if (systemName == "Windows") { - Sys.putEnv("HASHLINK_SRC", hlInstallDir); - Sys.putEnv("HASHLINK_BIN", hlInstallBinDir); - } if (FileSystem.exists(hlBinary)) { infoMsg('hl has already been installed at $hlBinary.'); @@ -87,38 +83,14 @@ class Hl { static function buildAndRunHlc(dir:String, filename:String, ?run) { if (run == null) run = runCommand; - final compiler = if (systemName == "Mac") "clang" else "gcc"; - final extraCompilerFlags = switch (systemName) { - case "Windows": ["-ldbghelp", "-municode"]; - case "Mac": ["-rpath", hlInstallLibDir]; - case _: ['-Wl,-rpath,$hlInstallLibDir']; - }; - - runCommand(compiler, [ - "-o", '$dir/$filename.exe', - '$dir/$filename.c', - '-I$dir', - '-I$hlInstallDir/include', - '-L$hlInstallLibDir', - '$hlInstallLibDir/fmt.hdll', - '$hlInstallLibDir/ssl.hdll', - '$hlInstallLibDir/sqlite.hdll', - "-lm", - "-lhl" - ].concat(extraCompilerFlags)); - - run('$dir/$filename.exe', []); + runCommand("haxelib", ["run", "hashlink", "build", '$dir/$filename.c', "-D", "hlgen.makefile=make"] + .concat(systemName == "Windows" ? ["-D", "hlgen.makefile.jumbo"] : [])); + run('$dir/$filename', []); // Run with MSBuild if (systemName == "Windows") { - runCommand("MSBuild.exe", [ - '$dir/$filename.sln', - '-nologo', '-verbosity:minimal', - '-t:$filename', - '-property:Configuration=Release', - '-property:Platform=$msbuildPlatform' - ]); - run('$dir${msbuildPlatform == 'x64' ? '/x64' : ''}/Release/$filename.exe', []); + runCommand("haxelib", ["run", "hashlink", "build", '$dir/$filename.c', "-D", "hlgen.makefile=vs2022"]); + run('$dir${msbuildPlatform == 'x64' ? '/x64' : ''}/Debug/$filename.exe', []); } } @@ -131,7 +103,7 @@ class Hl { } if (withHlcTests) { - runCommand("haxe", [hxml, "-hl", '$target/hlc.c', "-D", "hlgen.makefile=ci"].concat(args)); + runCommand("haxe", [hxml, "-hl", '$target/hlc.c'].concat(args).concat(["--debug"])); buildAndRunHlc(target, "hlc"); } } @@ -156,7 +128,7 @@ class Hl { } if (Hl.withHlcTests) { runCommand("haxe", ["compile-hlc.hxml"].concat(extraArgs).concat(haxeArgs)); - buildAndRunHlc("bin/hlc", "unit", runCommand); + buildAndRunHlc("bin/hlc", "main", runCommand); } } @@ -174,11 +146,11 @@ class Hl { buildAndRunHlc("bin/hlc/testArguments", "TestArguments", dontRun); buildAndRunHlc("bin/hlc/exitCode", "ExitCode", dontRun); buildAndRunHlc("bin/hlc/utilityProcess", "UtilityProcess", dontRun); - buildAndRunHlc("bin/hlc/sys", "sys", (cmd, ?args) -> runSysTest(FileSystem.fullPath(cmd), args)); + buildAndRunHlc("bin/hlc/sys", "main", (cmd, ?args) -> runSysTest(FileSystem.fullPath(cmd), args)); } changeDirectory(getMiscSubDir("cross", "eventLoop")); - buildAndRun("build-hl.hxml", "bin/eventLoop"); + buildAndRun("build-hl.hxml", "bin/eventLoop", haxeArgs); // these are generic tests for genhl which shouldn't actually execute the .hl using hl jit, // so they are not skipped with --skip-hl-jit @@ -189,8 +161,7 @@ class Hl { runCommand("haxe", ["run-base.hxml", "--run", "Main", "hl"]); if (Hl.withHlcTests) { - final hlcTemplateDefine = systemName == "Windows" ? "hlgen.makefile=vs2022" : "hlgen.makefile=make"; - runCommand("haxe", ["run-base.hxml", "--run", "Main", "hlc", "-D", hlcTemplateDefine].concat(haxeArgs)); + runCommand("haxe", ["run-base.hxml", "--run", "Main", "hlc", "-D", "hlgen.makefile"].concat(haxeArgs)); } } } diff --git a/tests/sys/compile-hlc.hxml b/tests/sys/compile-hlc.hxml index 4f0bdb8c814..dc3ef812084 100644 --- a/tests/sys/compile-hlc.hxml +++ b/tests/sys/compile-hlc.hxml @@ -1,22 +1,18 @@ compile-each.hxml --main Main --hl bin/hlc/sys/sys.c --D hlgen.makefile=ci +-hl bin/hlc/sys/main.c --next compile-each.hxml --main TestArguments -hl bin/hlc/testArguments/TestArguments.c --D hlgen.makefile=ci --next compile-each.hxml --main ExitCode -hl bin/hlc/exitCode/ExitCode.c --D hlgen.makefile=ci --next compile-each.hxml --main UtilityProcess -hl bin/hlc/utilityProcess/UtilityProcess.c --D hlgen.makefile=ci diff --git a/tests/sys/gen_test_res.py b/tests/sys/gen_test_res.py index fac084673bd..e6f4a09377a 100755 --- a/tests/sys/gen_test_res.py +++ b/tests/sys/gen_test_res.py @@ -81,7 +81,7 @@ ("../../bin/cpp/UtilityProcess", "bin-cpp"), ("../../bin/cppia/UtilityProcess.cppia", "bin-cppia"), ("../../bin/hl/UtilityProcess.hl", "bin-hl"), - ("../../bin/hlc/utilityProcess/UtilityProcess.exe", "bin-hlc"), + ("../../bin/hlc/utilityProcess/UtilityProcess", "bin-hlc"), ("../../bin/lua/UtilityProcess.lua", "bin-lua"), ("../../bin/java/UtilityProcess-Debug.jar", "bin-java-debug"), ("../../bin/java/UtilityProcess.jar", "bin-java"), diff --git a/tests/sys/src/ExitCode.hx b/tests/sys/src/ExitCode.hx index e555eb33497..b3ad76a1b1b 100644 --- a/tests/sys/src/ExitCode.hx +++ b/tests/sys/src/ExitCode.hx @@ -13,7 +13,7 @@ class ExitCode { "bin/neko/ExitCode.n"; #elseif hl #if hlc - "bin/hlc/exitCode/ExitCode.exe"; + "bin/hlc/exitCode/ExitCode"; #else "bin/hl/ExitCode.hl"; #end diff --git a/tests/sys/src/TestArguments.hx b/tests/sys/src/TestArguments.hx index 2afe7b906f9..e8d6b519d74 100644 --- a/tests/sys/src/TestArguments.hx +++ b/tests/sys/src/TestArguments.hx @@ -73,7 +73,7 @@ class TestArguments extends utest.Test { "bin/neko/TestArguments.n"; #elseif hl #if hlc - "bin/hlc/testArguments/TestArguments.exe"; + "bin/hlc/testArguments/TestArguments"; #else "bin/hl/TestArguments.hl"; #end diff --git a/tests/sys/src/TestSys.hx b/tests/sys/src/TestSys.hx index 0e4a056d8ef..8374dcc455c 100644 --- a/tests/sys/src/TestSys.hx +++ b/tests/sys/src/TestSys.hx @@ -125,7 +125,7 @@ class TestSys extends TestCommandBase { "sys.js" #elseif hl #if hlc - "sys.exe" + "main" + (Sys.systemName() == "Windows" ? ".exe" : "") #else "sys.hl" #end diff --git a/tests/sys/src/UtilityProcess.hx b/tests/sys/src/UtilityProcess.hx index 1c05b6b4072..132478ceea1 100644 --- a/tests/sys/src/UtilityProcess.hx +++ b/tests/sys/src/UtilityProcess.hx @@ -48,7 +48,7 @@ class UtilityProcess { #end #elseif hl #if hlc - "UtilityProcess.exe"; + "UtilityProcess"; #else "UtilityProcess.hl"; #end diff --git a/tests/unit/compile-hlc.hxml b/tests/unit/compile-hlc.hxml index 237ed1daed9..a64f29360a5 100644 --- a/tests/unit/compile-hlc.hxml +++ b/tests/unit/compile-hlc.hxml @@ -1,8 +1,7 @@ compile-each.hxml --main unit.TestMain --hl bin/hlc/unit.c +-hl bin/hlc/main.c #-D interp -D hl-check -D hl-ver=1.16.0 --D hlgen.makefile=ci --D UTEST-PRINT-TESTS \ No newline at end of file +-D UTEST-PRINT-TESTS