fix(tools): ignore non-module sidecars in import audit #5519
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5519"
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 Zinebyte on 2026-10-13T22:11:23Z.
What
The documented import-audit workflow fails when a title's module directory contains a README or other metadata. The relinker accepts that directory, but
import_audit.py --modulesattempts to parse every file as ELF and exits 2 before reporting the imports.Select ELF module candidates by their header, regardless of filename. Ignore ordinary non-module sidecars; retain errors for malformed named module files, unsupported ELF, PE and SELF containers. Metadata cannot become a module provider or satisfy a missing dependency. The usage documentation states this selection policy.
Reproduced with the repository's existing
main_fixture()andmodule_with_symbol(True)fixtures: conversion with--registrysucceeds withsce_module/provider.prxand a 22-byteREADME.txt; auditing those generated registries fails on README's ELF header. Removing only README makes the baseline audit succeed. With this patch the same audit succeeds with README present. No title files were used.Tested
Zorin OS 18.1 x86-64, Python 3.12.3, GCC 13.3.0, CMake 3.28.3; final branch based on
bf8dc610e665a7547d027418e31ddcbb3261b3e0. Original regression baseline:c7601b797119da8e81191dd7d31bdfffd77d9f3b; the two audit files are unchanged between those upstream revisions..DS_Storeand empty metadata; real imports, exports and dependencies in an ELF with a nonstandard extension; missing imports named after metadata; malformed/PE/SELF refusal without creating or replacing the JSON report.27e5a6d75d96eab58175451938b43b14f42cc34aapplies cleanly with Git's three-way merge; all 52 combined audit tests pass. An additional control with different README contents beside identical modules audits the module once and still reports its real missing import.Hosted relinker CI passed on Linux, Windows and macOS at final head
3b2601daa348a7953bd90a1ed9ca71d99fad9070; eligibility and conventions also passed. The original submission passed intake. The implementation and tests are unchanged by the documentation clarification and rebase.Related work
#5273 adds duplicate-module identity checks inside
read_modules; it does not select module candidates. This patch changes the iterator through a separate helper, so duplicate checks run only for actual modules in the tested composition. Neither patch requires the other. The repository's overlap checker reports no conflict at currentmainwith both dependency lists empty.Checklist
main; no equivalent module-selection fix foundImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T21:38:55Z.
Checked
module_files()selection by ELF header, the sidecar/malformed/PE/SELF cases and the USAGE.md change.test_import_auditpasses (79 OK) and the new tests fail without the fix; relinker CI is green on Linux, Windows and macOS. Merging.