test(libs): give the pwrite, process export and patched AvPlayer tests the MinGW runtime on their PATH #17014

Merged
JJenkx merged 1 commit from upstream-pr/17014 into main 2026-11-12 00:07:54 +00:00
JJenkx commented 2026-11-08 06:17:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-11-08T06:17:34Z.


What

On Windows, five tests fail when ctest runs from a shell whose PATH puts another MinGW runtime ahead of the toolchain's, such as Git Bash, where C:\Program Files\Git\mingw64\bin comes first:

  • guest_kernel_sys_pwrite
  • guest_kernel_sys_pwrite_patched
  • guest_kernel_process_exports
  • guest_kernel_process_exports_patched
  • avplayer_http_patched_modules

The cause is the one #12426 fixed for the guest_kernel_sys_threads and net_ipv6only_patched tests:

  • The pwrite and process-export test executables link the MinGW runtime statically, and they load libkernel.prx from libs/unpatched or libs with LoadLibraryExW(..., LOAD_WITH_ALTERED_SEARCH_PATH). Windows then looks for libstdc++-6.dll and libgcc_s_seh-1.dll next to the .prx and then on PATH, not in the test output directory, where the build copies the runtime. With Git's older libstdc++-6.dll first, the load fails and the test stops at Require(module != nullptr), exiting with 0xc0000409.
  • AvPlayerHttpModules.cmake copies the owner test into a staging directory and runs it with the stage prepended to the inherited PATH. That directory has no runtime either, so the run fails with Patched module ownership failed: Exit code 0xc0000139 (entry point not found).

On MinGW, this gives these tests the compiler's directory at the front of PATH, as #10101 and #12426 did for the other prx loader tests. guest_kernel_process_exports already prepended its library directory, so the runtime directory is added to that list.

Tested

Windows 11 Enterprise 22621, WinLibs GCC 15.2.0 UCRT r7, Release. ctest was run from Git Bash, where which libstdc++-6.dll gives /mingw64/bin/libstdc++-6.dll (Git's) before the toolchain's.

  • Full suite on main 988ee6d3db (ctest -j 16, Vulkan ICD hidden): 4604 of 4609 tests pass. The 5 failures are exactly the tests above.
  • Before, on main 4c12105e22 with the same build and shell: all 5 fail in 3 of 3 runs. The pwrite tests print Kernel sys pwrite check failed at line 38, the process-export tests print Kernel process export check failed at line 28, and avplayer_http_patched_modules prints Exit code 0xc0000139.
  • After, with this change: all 5 pass in 3 of 3 runs.
  • With the toolchain's bin put first on PATH, the same 5 tests pass on main too, which confirms the runtime lookup is the only cause.

I did not rerun the whole suite on this change; it only changes test properties for these five tests.

Validated by others

  • Ethan-Hainline reproduced the staging failure independently on windows-2022 (head a9d736ad, ycbuzi/AnyPS5 run 42965316284): the stage has no MinGW runtime, the owner exits 0xC0000135 with a clean PATH, and it passes when the compiler runtime directory is on PATH. They closed their own PR for the same fix in favour of this one. In that run's 41 failures, the five tests this PR fixes are the only ones it covers (closing note, suite breakdown).

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:5209184940 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17014). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-11-08T06:17:34Z. --- ### What On Windows, five tests fail when `ctest` runs from a shell whose PATH puts another MinGW runtime ahead of the toolchain's, such as Git Bash, where `C:\Program Files\Git\mingw64\bin` comes first: - `guest_kernel_sys_pwrite` - `guest_kernel_sys_pwrite_patched` - `guest_kernel_process_exports` - `guest_kernel_process_exports_patched` - `avplayer_http_patched_modules` The cause is the one #12426 fixed for the `guest_kernel_sys_threads` and `net_ipv6only_patched` tests: - The pwrite and process-export test executables link the MinGW runtime statically, and they load `libkernel.prx` from `libs/unpatched` or `libs` with `LoadLibraryExW(..., LOAD_WITH_ALTERED_SEARCH_PATH)`. Windows then looks for `libstdc++-6.dll` and `libgcc_s_seh-1.dll` next to the `.prx` and then on PATH, not in the test output directory, where the build copies the runtime. With Git's older `libstdc++-6.dll` first, the load fails and the test stops at `Require(module != nullptr)`, exiting with 0xc0000409. - `AvPlayerHttpModules.cmake` copies the owner test into a staging directory and runs it with the stage prepended to the inherited PATH. That directory has no runtime either, so the run fails with `Patched module ownership failed: Exit code 0xc0000139` (entry point not found). On MinGW, this gives these tests the compiler's directory at the front of PATH, as #10101 and #12426 did for the other prx loader tests. `guest_kernel_process_exports` already prepended its library directory, so the runtime directory is added to that list. ### Tested Windows 11 Enterprise 22621, WinLibs GCC 15.2.0 UCRT r7, Release. `ctest` was run from Git Bash, where `which libstdc++-6.dll` gives `/mingw64/bin/libstdc++-6.dll` (Git's) before the toolchain's. - Full suite on main `988ee6d3db` (`ctest -j 16`, Vulkan ICD hidden): 4604 of 4609 tests pass. The 5 failures are exactly the tests above. - Before, on main `4c12105e22` with the same build and shell: all 5 fail in 3 of 3 runs. The pwrite tests print `Kernel sys pwrite check failed at line 38`, the process-export tests print `Kernel process export check failed at line 28`, and `avplayer_http_patched_modules` prints `Exit code 0xc0000139`. - After, with this change: all 5 pass in 3 of 3 runs. - With the toolchain's `bin` put first on PATH, the same 5 tests pass on main too, which confirms the runtime lookup is the only cause. I did not rerun the whole suite on this change; it only changes test properties for these five tests. ### Validated by others - Ethan-Hainline reproduced the staging failure independently on `windows-2022` (head `a9d736ad`, ycbuzi/AnyPS5 run 42965316284): the stage has no MinGW runtime, the owner exits `0xC0000135` with a clean `PATH`, and it passes when the compiler runtime directory is on `PATH`. They closed their own PR for the same fix in favour of this one. In that run's 41 failures, the five tests this PR fixes are the only ones it covers ([closing note](https://github.com/boykopovar/AnyPS5/pull/17014#issuecomment-6808459106), [suite breakdown](https://github.com/boykopovar/AnyPS5/pull/17014#issuecomment-6808696611)). ### 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
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!17014
No description provided.