fix(import-audit): parse export aliases as C++ tokens #4196
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4196"
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 Lorkydey on 2026-10-12T01:06:35Z.
What
import_audit.pycan report a throwing export as implemented solely because itsAPS5_EXPORTdeclaration contains whitespace, comments or a line continuation. A commented-out declaration or a raw-string example can also replace the real alias in the audit's map.Reuse the existing C++ token parser in
nid_names.source_aliasesfor the audit. It now yields known and unknown aliases; the unknown-name filter stays incollect_unknowns, preserving the NID inventory CLI's behavior.Reproduction on
main7a84b222: keep a builtlibkernel.prxunchanged and, in a source copy ofUnimplemented.cpp, reformatAPS5_EXPORT("AC1FtjqMCL0", sceKernelUnknown03)across lines. The command-line audit changes fromstubtoimplementedon main. With this fix it remainsstub, with the correct function name.Tested
Windows 11 Pro, Python 3.12.4:
python -m unittest tools.tests.test_import_audit tools.tests.test_nid_names: 59 tests pass, including a check that known aliases do not enter the unknown-NID inventory.libkernel.prxand the source-copy reproduction above: main/original declaration =stub; main/reformatted declaration =implemented; fix/reformatted declaration =stub.This validates the diagnostic tool. No game run, full native build or Linux/macOS run was performed for this Python-only change.
Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T02:06:41Z.
I opened #4243 carrying the separate #4202 change that audits imports inside --modules files. It touches tools/import_audit.py and tools/tests/test_import_audit.py as this PR does, but the behavior is independent. I merged the current PR heads locally and they combined without conflicts; #4243 notes that a rebase may still be needed depending on merge order.