Repository navigation
test: the precompile compute guard check builds with llvm-mingw too - #2390
Merged
hckrman101 merged 1 commit intoNov 11, 2026
Merged
Conversation
tests/test_precompile_compute_guard.py compiled its fixture for the MSVC target alone. llvm-mingw's clang++ (the toolchain the builder and HOOKSHOT_MINGW use) finds no Visual Studio headers there and stopped at <windows.h>, so run_all failed on a llvm-mingw-only Windows setup. The fixture now takes the target the game's own build gives that compiler (toolchain.py native_target): MinGW with -fms-extensions for llvm-mingw, the MSVC target otherwise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tests/test_precompile_compute_guard.pyfails on a Windows setup that has only llvm-mingw (the toolchain Hookshot Builder ships andHOOKSHOT_MINGWselects, as CONTRIBUTING.md's Windows setup describes):fatal error: 'windows.h' file not found.python -I -B tests/run_all.pytherefore reports a failure on a clean contributor setup although nothing in the game is wrong.Cause
The fixture was always compiled with
--target=x86_64-pc-windows-msvc. llvm-mingw's clang++ does not look for Visual Studio or the Windows SDK, so for the MSVC target it has no<windows.h>(clang++ -vsearches only its own resource dir and the legacyMicrosoft Visual Studio 8-10paths). The game itself never builds that way with llvm-mingw:third_party/a64-kit/tools/toolchain.pynative_target()gives it--target=x86_64-w64-mingw32 -fms-extensions, which is what makesguarded_compute's__try/__exceptcompile there.Change
tests/test_precompile_compute_guard.py:windows_target(cxx)asks the compiler-dumpmachine. A MinGW clang++ (*-windows-gnu/*mingw*) builds the fixture forx86_64-w64-mingw32with-fms-extensions, as the game's build does. Any other compiler keeps the MSVC target, so CI'swindows-2022runner is unchanged.Tested
Windows 11, llvm-mingw 20261104 (clang 23.1.5,
-dumpmachine=x86_64-w64-windows-gnu), no clang on PATH other than llvm-mingw's:tests/run_all.py precompile_compute_guardwindows.hnot found)guarded_computewithout__try(copy of the source via--source)case 1: exit 0xc0000005, expected 0x0So with the MinGW target the check still fails without the guard: SEH through
-fms-extensionscatches the injected access violation only when__tryis there.Full
python -I -B tests/run_all.pyon this branch: 355 passed, 29 skipped, 3 failed, none of them this test:test_recorder_sync: the llvm-mingw negative-control problem fixed by test: the recorder exit check catches the old destructor on llvm-mingw too #2240 (that PR's patch makes it pass here, 3 runs out of 3).test_vcore_fs_open,test_vcore_video_acquire:env_onon current main, tracked in main: test_vcore_fs_open and test_vcore_video_acquire no longer compile since #2042 met #2301 and #2322 #2379 / test: test_vcore_fs_open and test_vcore_video_acquire build again with env_on #2380.Not tested
Related: #2240 (the other test that fails only with llvm-mingw).