tools: import_audit.py reports a false FAIL for converted modules, because libX.prx is matched against the file name libX.prx.guest.prx #7174
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T14:54:05Z.
tools/import_audit.pymatches an import's library name against the module file names in--modules. Converted modules are namedlibX.prx.guest.prx, while the title's imports namelibX.prx, so the library is never found among the modules and is reported as missing, even though the module is there and the loader resolveslibX.prxtolibX.prx.guest.prx.On a Stray (PPSA02101) run this lists
libSceNpCppWebApi.prx: 942 importsand$ORIGIN/libSceFace.prx.guest.prxas missing. That is a false FAIL: both modules are present. Main and #7159 give identical JSON for this input, so it is not introduced by that PR. It comes fromclassify/audittestinglibrary in modulesagainst the file name.It is separate from #6378, which is about parsing a converted
.guest.prxfile on Windows (a PE, not an ELF). #7159 fixes that one, and once it lands, Windows users get past the crash and will hit this false FAIL on the same input. #4202 added the module-import checking this sits next to.Suggested fix: when building
modules, also record each*.guest.prxfile under its base name (libX.prx), so an import oflibX.prxfinds it. Keep the full file name too, so existing matches don't change.I haven't checked how many other titles are affected; any converted title with an import of a module that was converted would show it.
Imported from boykopovar/AnyPS5. Originally posted by LeandroSSB on 2026-10-17T15:02:27Z.
A branch that fixes this is ready for carry:
LeandroSSB/AnyPS5@fix/import-audit-guest-module-aliases(commit1a08c9c0a, base84b0d2f24= currentmain).The fix follows the suggested direction, at the call site:
main()now builds themodulesset with each*.guest.prxfile also recorded under its base name (libX.prx.guest.prx→libX.prx), whilemodule_importskeeps only the real files so the module's own imports are still audited exactly once and the conservation check is untouched. The full file name stays, so every existing match is unchanged;classifyand both missing-library checks now findlibX.prx, andaudit_host_dependenciespicks the aliases up through the same set.Regression test
test_converted_module_matches_imports_of_its_base_namereproduces the Stray shape: one game import naminglibSceFace.prx, onlylibSceFace.prx.guest.prxpresent. Without the fix it reports the library missing and exits 2; with it the import classifies asmodule,missing_librariesis empty and the run exits 0.Validated:
python3 tools/tests/test_import_audit.py— 99 tests pass with the fix, and the new test fails on unpatchedmain(checked both directions).python3 tools/check_conventions.py --base origin/mainpasses,python3 tools/pr_overlap.py --branch fix/import-audit-guest-module-aliasesreports no overlap with open pull requests.A maintainer is welcome to carry the commit.
AI-assisted: yes (Claude Code)