fix(tools): match import_audit module names like the relinker #8124

Merged
xXPBSXx merged 1 commit from upstream-pr/8124 into main 2026-10-20 05:34:11 +00:00
xXPBSXx commented 2026-10-19 22:53:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-19T22:53:21Z.


What

tools/import_audit.py decides whether an import is served by a title module with library in modules, an exact file-name match. The relinker identifies modules by the name without its .prx, .sprx, .suprx or .debug_prx suffix, and on Windows ignoring case (GuestModuleBuilder.cpp ModuleStem, ImportModule.hpp ModuleSuffixes). A title whose eboot imports from EOSSDK-PS5-Shipping.debug_prx while the dump holds prx/eossdk-ps5-shipping.prx therefore gets every import reported as absent ("the loader fails") and exit code 1, although the converted title starts. ModuleNames now compares title module names by that stem, case-folded when the built libraries are Windows PE files; audit and the missing-library check use it unchanged. Two tests: a module file shipping.prx serves an import from shipping.debug_prx (CLI, JSON report class module), and ModuleNames folds case only when asked.

Overlap with #6171: measured on the same inputs, #6171 (SCE module identity) already turns the Coral-Island case from absent 236 into 0 (exit 0). This change covers the relinker's file-name rule (suffix ignored, case folded on Windows) for modules without a matching SCE identity; the CLI test (module shipping.prx, import from shipping.debug_prx) still fails with #6171 alone. I have no title evidence for that second case. Both change main() in import_audit.py (lines 731-733) and are independent; if the maintainers prefer one, #6171 first and this one rebased or closed.

Tested

Windows 10, WinLibs GCC 15.2.0 toolchain, Python 3.12: python -I tools/tests/test_import_audit.py passes (117 tests, 3 skipped); both new tests fail without the change (AttributeError: ... no attribute 'ModuleNames' and exit code 1 for the CLI case). Real data: the audit of one converted Unreal title (236 imports from EOSSDK-PS5-Shipping.debug_prx, module file eossdk-ps5-shipping.prx, Windows libs) reported absent 236 and exit 1 before, absent 0 and exit 0 after; the same title ran 560 s without a load error. A second title (Palworld, 289 such imports) had the same report. No title run for this change. tools/check_conventions.py --base upstream/main --head HEAD reports only the empty template sections.

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

AI-assisted (Claude Code).

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4928476710 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8124). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-19T22:53:21Z. --- ### What `tools/import_audit.py` decides whether an import is served by a title module with `library in modules`, an exact file-name match. The relinker identifies modules by the name without its `.prx`, `.sprx`, `.suprx` or `.debug_prx` suffix, and on Windows ignoring case (`GuestModuleBuilder.cpp` `ModuleStem`, `ImportModule.hpp` `ModuleSuffixes`). A title whose eboot imports from `EOSSDK-PS5-Shipping.debug_prx` while the dump holds `prx/eossdk-ps5-shipping.prx` therefore gets every import reported as `absent` ("the loader fails") and exit code 1, although the converted title starts. `ModuleNames` now compares title module names by that stem, case-folded when the built libraries are Windows PE files; `audit` and the missing-library check use it unchanged. Two tests: a module file `shipping.prx` serves an import from `shipping.debug_prx` (CLI, JSON report class `module`), and `ModuleNames` folds case only when asked. Overlap with #6171: measured on the same inputs, #6171 (SCE module identity) already turns the Coral-Island case from `absent` 236 into 0 (exit 0). This change covers the relinker's file-name rule (suffix ignored, case folded on Windows) for modules without a matching SCE identity; the CLI test (module `shipping.prx`, import from `shipping.debug_prx`) still fails with #6171 alone. I have no title evidence for that second case. Both change `main()` in `import_audit.py` (lines 731-733) and are independent; if the maintainers prefer one, #6171 first and this one rebased or closed. ### Tested Windows 10, WinLibs GCC 15.2.0 toolchain, Python 3.12: `python -I tools/tests/test_import_audit.py` passes (117 tests, 3 skipped); both new tests fail without the change (`AttributeError: ... no attribute 'ModuleNames'` and exit code 1 for the CLI case). Real data: the audit of one converted Unreal title (236 imports from `EOSSDK-PS5-Shipping.debug_prx`, module file `eossdk-ps5-shipping.prx`, Windows libs) reported `absent` 236 and exit 1 before, `absent` 0 and exit 0 after; the same title ran 560 s without a load error. A second title (Palworld, 289 such imports) had the same report. No title run for this change. `tools/check_conventions.py --base upstream/main --head HEAD` reports only the empty template sections. ### 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 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 AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-19 23:01:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T23:01:29Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6171 tools/import_audit.py L731-733

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 7454 tools/import_audit.py
tools/tests/test_import_audit.py
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6279238932 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8124#issuecomment-6279238932). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T23:01:29Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6171](https://www.github.com/boykopovar/AnyPS5/pull/6171) | `tools/import_audit.py` [L731-733](https://github.com/boykopovar/AnyPS5/blob/0393728fd32fbb2cb1f7840fbaa98aac46f2ba25/tools/import_audit.py#L731-L733) | | | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 7454](https://www.github.com/boykopovar/AnyPS5/pull/7454) | `tools/import_audit.py`<br>`tools/tests/test_import_audit.py` |
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!8124
No description provided.