test(libs): load every patched library with its imports bound #1828

Merged
LeandroLP23 merged 1 commit from upstream-pr/1828 into main 2026-10-09 08:03:36 +00:00
LeandroLP23 commented 2026-10-08 20:41:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-08T20:41:50Z.


What

Closes #1827. patched_libraries loads each .prx in build/core/libs/libs, with LoadLibraryEx(LOAD_WITH_ALTERED_SEARCH_PATH) on Windows and dlopen(RTLD_NOW | RTLD_LOCAL) on Linux. It prints each library that fails to load and fails the test if any does.

  • The test depends on the libs target, so the patched files are current even when only the default target is built. CI already builds libs before ctest.
  • It doesn't link libc. With MinGW it is linked statically and built with -fasynchronous-unwind-tables, as nid_patcher and savedata_memory_metadata_tests are, so the unpatched libc.prx isn't already in the process under the same name when the patched libraries bind to theirs.

Tested

Windows 11, MinGW-w64 GCC 15.2.0, Release:

  • main 4b6ab6bb: passes, 122 patched libraries loaded, 0 failed, 0.25 s.
  • main + #1613: fails with libScePosixForWebKit.prx: LoadLibraryEx failed with error 127, 121 patched libraries loaded, 1 failed.
  • tools/check_test_registration.py and tools/check_conventions.py pass.

Linux: fork CI run https://github.com/LeandroLP23/AnyPS5/actions/runs/37838975025: all jobs pass, patched_libraries included (the failing case was checked on Windows only).

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 in TechnicalDebt
  • 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
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4792547612 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1828). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-08T20:41:50Z. --- ### What Closes #1827. `patched_libraries` loads each `.prx` in `build/core/libs/libs`, with `LoadLibraryEx(LOAD_WITH_ALTERED_SEARCH_PATH)` on Windows and `dlopen(RTLD_NOW | RTLD_LOCAL)` on Linux. It prints each library that fails to load and fails the test if any does. - The test depends on the `libs` target, so the patched files are current even when only the default target is built. CI already builds `libs` before ctest. - It doesn't link `libc`. With MinGW it is linked statically and built with `-fasynchronous-unwind-tables`, as `nid_patcher` and `savedata_memory_metadata_tests` are, so the unpatched `libc.prx` isn't already in the process under the same name when the patched libraries bind to theirs. ### Tested Windows 11, MinGW-w64 GCC 15.2.0, Release: - `main` 4b6ab6bb: passes, `122 patched libraries loaded, 0 failed`, 0.25 s. - `main` + #1613: fails with `libScePosixForWebKit.prx: LoadLibraryEx failed with error 127`, `121 patched libraries loaded, 1 failed`. - `tools/check_test_registration.py` and `tools/check_conventions.py` pass. Linux: fork CI run https://github.com/LeandroLP23/AnyPS5/actions/runs/37838975025: all jobs pass, `patched_libraries` included (the failing case was checked on Windows only). ### 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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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] AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-08 20:54:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-08T20:54:31Z.


Current-main check: head 942433e is based on merge base 4b6ab6b and diverges from upstream main aa277b3 (1 commit ahead, 2 behind). CONTRIBUTING requires PRs to be based on current main; please rebase now so the queued Linux/Windows checks validate the final head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6068868531 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1828#issuecomment-6068868531). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-08T20:54:31Z. --- Current-main check: head `942433e` is based on merge base `4b6ab6b` and diverges from upstream `main` `aa277b3` (1 commit ahead, 2 behind). CONTRIBUTING requires PRs to be based on current `main`; please rebase now so the queued Linux/Windows checks validate the final head.
LeandroLP23 commented 2026-10-08 20:57:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-08T20:57:11Z.


Rebased onto main aa277b38; the only new commits there are the CI change from #1821.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6068910260 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1828#issuecomment-6068910260). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-08T20:57:11Z. --- Rebased onto `main` aa277b38; the only new commits there are the CI change from #1821.
MarcZX10 commented 2026-10-08 21:47:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-08T21:47:42Z.


The full current-head Build and Conventions checks are green. One current-main follow-up: this head is 11 commits behind main (94b1eecb; merge base aa277b38). CONTRIBUTING asks branches to stay up to date; please rebase and rerun checks on the final head. The CMake overlap with #1627/#1686 remains visible in the overlap report, so resolve any actual conflict without duplicating their scope.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6069684147 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1828#issuecomment-6069684147). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-08T21:47:42Z. --- The full current-head Build and Conventions checks are green. One current-main follow-up: this head is 11 commits behind `main` (`94b1eecb`; merge base `aa277b38`). CONTRIBUTING asks branches to stay up to date; please rebase and rerun checks on the final head. The CMake overlap with #1627/#1686 remains visible in the overlap report, so resolve any actual conflict without duplicating their scope.
LeandroLP23 commented 2026-10-08 21:56:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-08T21:56:26Z.


Rebased onto main 94b1eecb; no conflicts.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6069804261 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1828#issuecomment-6069804261). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-08T21:56:26Z. --- Rebased onto `main` 94b1eecb; no conflicts.
LeandroLP23 commented 2026-10-08 22:13:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-08T22:13:24Z.


The Windows failure is guest_font_writing_line (reserve the guest arena range: Attempt to access invalid address, 0xc0000409), which this PR doesn't touch; patched_libraries passed. It doesn't reproduce here in 30 serial and 10 parallel runs on main ae91d978, so it looks like an intermittent arena reservation failure on the runner. Could someone re-run the job?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6070078421 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1828#issuecomment-6070078421). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-08T22:13:24Z. --- The Windows failure is `guest_font_writing_line` (`reserve the guest arena range: Attempt to access invalid address`, 0xc0000409), which this PR doesn't touch; `patched_libraries` passed. It doesn't reproduce here in 30 serial and 10 parallel runs on `main` ae91d978, so it looks like an intermittent arena reservation failure on the runner. Could someone re-run the job?
MarcZX10 commented 2026-10-09 01:43:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T01:43:16Z.


I checked whether I can rerun the failed Windows job. My repository permissions are pull-only, so GitHub does not let me rerun Actions on this upstream PR. The failure report is specific to guest_font_writing_line arena reservation (0xc0000409); the PR-specific patched_libraries test passed, per the author. Could an authorized maintainer rerun the failed Windows job so we can confirm whether it was transient?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6072538403 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1828#issuecomment-6072538403). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T01:43:16Z. --- I checked whether I can rerun the failed Windows job. My repository permissions are pull-only, so GitHub does not let me rerun Actions on this upstream PR. The failure report is specific to `guest_font_writing_line` arena reservation (`0xc0000409`); the PR-specific `patched_libraries` test passed, per the author. Could an authorized maintainer rerun the failed Windows job so we can confirm whether it was transient?
MarcZX10 commented 2026-10-09 05:53:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T05:53:00Z.


I reviewed the full two-file diff and current checks. The Linux job is green, and your report says patched_libraries passed on Windows; the current Windows failure is guest_font_writing_line, outside this change, and I previously asked for a maintainer rerun. Since that rebase, upstream main has moved to f1451396; the current PR head is 17 commits behind and 1 ahead. CONTRIBUTING asks branches to stay current, so please rebase onto current main and rerun both platform jobs before merge. I have not approved this head while it is stale and its Windows check is red.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6075186299 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1828#issuecomment-6075186299). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T05:53:00Z. --- I reviewed the full two-file diff and current checks. The Linux job is green, and your report says `patched_libraries` passed on Windows; the current Windows failure is `guest_font_writing_line`, outside this change, and I previously asked for a maintainer rerun. Since that rebase, upstream `main` has moved to `f1451396`; the current PR head is 17 commits behind and 1 ahead. CONTRIBUTING asks branches to stay current, so please rebase onto current `main` and rerun both platform jobs before merge. I have not approved this head while it is stale and its Windows check is red.
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!1828
No description provided.