fix(relinker): print the Windows stub's ' -> FAILED' only with dependency diagnostics #3325

Merged
reyani-dev merged 2 commits from upstream-pr/3325 into main 2026-10-11 07:58:26 +00:00
reyani-dev commented 2026-10-11 07:43:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T07:43:10Z.


What

Carries @Jnbla6's fix from #3307 (their #3312 was closed by the intake check). The fix commit is theirs, with authorship kept. I only reworded its message to the conventional-commit form; the code change is unchanged. I added a regression test as a separate commit.

When LoadLibraryExW fails in the Windows entry stub without --dependency-diagnostics, the stub printed a bare -> FAILED line before Failed to load module: …. The Loading PRX: <path> prefix and the -> OK suffix were already guarded by dependencyDiagnostics, but the failure suffix was not:

 -> FAILED
Failed to load module: …\libs\missing.prx
GetLastError: 126 - The specified module could not be found.

The failure suffix now follows the same guard. With diagnostics on, the output is still Loading PRX: <path> -> FAILED; without them it starts with Failed to load module:. Since #3282's anyps5.log work, this orphan line would also be the first line of the log in GUI starts.

test_windows_import_modules.py now checks that the console missing-dependency case's stderr starts with Failed to load module:.

Closes #3307.

Tested

Windows 11 (10.0.26200), WinLibs GCC 15.2.0 r7, relinker-only Release build (ANYPS5_RELINKER_ONLY=ON), on main 2bb78d2c:

  • Relinker ctest: 104/104. It builds without warnings.
  • The updated test_windows_import_modules.py run against a relinker built from main fails at the new check (AssertionError: -> FAILED); with the fix it passes.
  • check_conventions.py passes, and pr_overlap.py reports no overlap.

The change only affects the Windows entry stub, so there's nothing to run on Linux.

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

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4817484143 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3325). Originally posted by [reyani-dev](https://github.com/reyani-dev) on 2026-10-11T07:43:10Z. --- ### What Carries @Jnbla6's fix from #3307 (their #3312 was closed by the intake check). The fix commit is theirs, with authorship kept. I only reworded its message to the conventional-commit form; the code change is unchanged. I added a regression test as a separate commit. When `LoadLibraryExW` fails in the Windows entry stub without `--dependency-diagnostics`, the stub printed a bare ` -> FAILED` line before `Failed to load module: …`. The `Loading PRX: <path>` prefix and the ` -> OK` suffix were already guarded by `dependencyDiagnostics`, but the failure suffix was not: ``` -> FAILED Failed to load module: …\libs\missing.prx GetLastError: 126 - The specified module could not be found. ``` The failure suffix now follows the same guard. With diagnostics on, the output is still `Loading PRX: <path> -> FAILED`; without them it starts with `Failed to load module:`. Since #3282's `anyps5.log` work, this orphan line would also be the first line of the log in GUI starts. `test_windows_import_modules.py` now checks that the console `missing-dependency` case's stderr starts with `Failed to load module:`. Closes #3307. ### Tested Windows 11 (10.0.26200), WinLibs GCC 15.2.0 r7, relinker-only Release build (`ANYPS5_RELINKER_ONLY=ON`), on `main` `2bb78d2c`: - Relinker `ctest`: 104/104. It builds without warnings. - The updated `test_windows_import_modules.py` run against a relinker built from `main` fails at the new check (`AssertionError: -> FAILED`); with the fix it passes. - `check_conventions.py` passes, and `pr_overlap.py` reports no overlap. The change only affects the Windows entry stub, so there's nothing to run on Linux. ### Checklist - [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 🤖 Generated with [Claude Code](https://claude.com/claude-code)
adriadam10 commented 2026-10-11 07:58:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T07:58:23Z.


Checked: the loadFailed suffix now follows the same dependencyDiagnostics guard as loading/loaded (WindowsEntryStubBuilder.cpp:394), so without diagnostics the output starts with Failed to load module:; with them it is still Loading PRX: <path> -> FAILED. The new assert in test_windows_import_modules.py:332 only runs on Windows, so I relied on the Windows relinker CI job (green) and your before/after run on main. Relinker build and ctest on Linux: 98/98. Merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106905014 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3325#issuecomment-6106905014). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T07:58:23Z. --- Checked: the `loadFailed` suffix now follows the same `dependencyDiagnostics` guard as `loading`/`loaded` (`WindowsEntryStubBuilder.cpp:394`), so without diagnostics the output starts with `Failed to load module:`; with them it is still `Loading PRX: <path> -> FAILED`. The new assert in `test_windows_import_modules.py:332` only runs on Windows, so I relied on the Windows relinker CI job (green) and your before/after run on `main`. Relinker build and ctest on Linux: 98/98. Merging.
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!3325
No description provided.