test(libs): give the prx loader tests the MinGW runtime on their PATH #12426

Merged
meh7an merged 1 commit from upstream-pr/12426 into main 2026-10-29 09:41:50 +00:00
meh7an commented 2026-10-28 13:14:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by meh7an on 2026-10-28T13:14:40Z.


What

guest_kernel_sys_threads_main, guest_kernel_sys_threads_main_patched and net_ipv6only_patched fail on Windows when ctest runs from a shell whose PATH puts another MinGW runtime ahead of the toolchain's, such as Git Bash with C:\Program Files\Git\mingw64\bin.

The three test executables link the MinGW runtime statically and load libkernel_sys.prx or libSceNet.prx with LoadLibraryExW(..., LOAD_WITH_ALTERED_SEARCH_PATH). So nothing has loaded libstdc++-6.dll yet. Windows looks for the libraries' runtime next to the .prx and then on PATH, not in build/tests where the build copies it.

Git's libstdc++-6.dll lacks the std::__codecvt_utf8_utf16_base<wchar_t> members (do_unshift, do_in, do_out, ...). libkernel_sys, libkernel and libc import those members, and libSceNet pulls in the last two. The result:

  • The threads tests hang on a modal "Entry Point Not Found" dialog, which names libkernel_sys.prx as the importing module, until ctest's 20 s timeout.
  • net_ipv6only_patched sets SEM_FAILCRITICALERRORS, so LoadLibraryExW fails with error 127 instead, and std::abort() exits with 0xc0000409.

On MinGW this gives the three tests the compiler's directory at the front of PATH, as #10101 did for patched_libraries.

Tested

Windows 11, WinLibs GCC 15.2.0 UCRT, main e02b43abef plus this change, ctest run from Git Bash (PATH starts with C:\Program Files\Git\mingw64\bin, C:\winlibs\mingw64\bin later).

  • Before (main b99bbebacd, same shell): guest_kernel_sys_threads_main and _patched time out at 20 s behind the Entry Point Not Found dialog; net_ipv6only_patched prints libSceNet.prx: LoadLibraryEx failed with error 127 and exits 0xc0000409. On this change's build, net_ipv6only_patched_tests.exe run by hand from the same shell without the prepended directory still prints error 127.
  • After: the three tests pass.
  • Full suite (ctest --parallel 4): 2772/2773 pass. The one failure, agc_driver_mesh_barycentric_emulation, fails on main b99bbebacd too.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5051083749 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12426). Originally posted by [meh7an](https://github.com/meh7an) on 2026-10-28T13:14:40Z. --- ### What `guest_kernel_sys_threads_main`, `guest_kernel_sys_threads_main_patched` and `net_ipv6only_patched` fail on Windows when `ctest` runs from a shell whose PATH puts another MinGW runtime ahead of the toolchain's, such as Git Bash with `C:\Program Files\Git\mingw64\bin`. The three test executables link the MinGW runtime statically and load `libkernel_sys.prx` or `libSceNet.prx` with `LoadLibraryExW(..., LOAD_WITH_ALTERED_SEARCH_PATH)`. So nothing has loaded `libstdc++-6.dll` yet. Windows looks for the libraries' runtime next to the `.prx` and then on PATH, not in `build/tests` where the build copies it. Git's `libstdc++-6.dll` lacks the `std::__codecvt_utf8_utf16_base<wchar_t>` members (`do_unshift`, `do_in`, `do_out`, ...). `libkernel_sys`, `libkernel` and `libc` import those members, and `libSceNet` pulls in the last two. The result: - The threads tests hang on a modal "Entry Point Not Found" dialog, which names `libkernel_sys.prx` as the importing module, until ctest's 20 s timeout. - `net_ipv6only_patched` sets `SEM_FAILCRITICALERRORS`, so `LoadLibraryExW` fails with error 127 instead, and `std::abort()` exits with 0xc0000409. On MinGW this gives the three tests the compiler's directory at the front of PATH, as #10101 did for `patched_libraries`. ### Tested Windows 11, WinLibs GCC 15.2.0 UCRT, main e02b43abef plus this change, `ctest` run from Git Bash (PATH starts with `C:\Program Files\Git\mingw64\bin`, `C:\winlibs\mingw64\bin` later). - Before (main b99bbebacd, same shell): `guest_kernel_sys_threads_main` and `_patched` time out at 20 s behind the Entry Point Not Found dialog; `net_ipv6only_patched` prints `libSceNet.prx: LoadLibraryEx failed with error 127` and exits 0xc0000409. On this change's build, `net_ipv6only_patched_tests.exe` run by hand from the same shell without the prepended directory still prints error 127. - After: the three tests pass. - Full suite (`ctest --parallel 4`): 2772/2773 pass. The one failure, `agc_driver_mesh_barycentric_emulation`, fails on main b99bbebacd too. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-28 13:52:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T13:52:55Z.

Review: CHANGES_REQUESTED


The CMake change is narrow and the Windows CI job passes. One repository-rule follow-up remains: this head's merge base with current main is e02b43abef, while current main is 750cf6cf48 (it contains the intervening main merges, including #11595). The PR's tested section also compares against older main heads (b99bbebacd/e02b43abef), rather than the current base.

Please rebase/update the branch to current main and refresh the tested-head/baseline description. The hosted Windows job already gives useful current-merge validation; after the update, please rerun the three affected CTest cases against the rebased head (and the focused baseline if available). This is to satisfy the repository's current-main rule and keep the evidence tied to the reviewed base; I found no issue in the CMake PATH modification itself.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5683746302 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12426#pullrequestreview-5683746302). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T13:52:55Z. **Review:** CHANGES_REQUESTED --- The CMake change is narrow and the Windows CI job passes. One repository-rule follow-up remains: this head's merge base with current `main` is `e02b43abef`, while current `main` is `750cf6cf48` (it contains the intervening main merges, including #11595). The PR's tested section also compares against older main heads (`b99bbebacd`/`e02b43abef`), rather than the current base. Please rebase/update the branch to current `main` and refresh the tested-head/baseline description. The hosted Windows job already gives useful current-merge validation; after the update, please rerun the three affected CTest cases against the rebased head (and the focused baseline if available). This is to satisfy the repository's current-main rule and keep the evidence tied to the reviewed base; I found no issue in the CMake PATH modification itself.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!12426
No description provided.