fix(tools): reject ambiguous guest modules in import audit #5273
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5273"
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 Ondra97 on 2026-10-13T16:13:51Z.
What
Different guest modules with the same filename in repeated
--modulesdirectories silently replaced each other's imports and combined their exports. Depending on directory order, an audit could report success despite a missing import and needed library.Reject differing module contents with both paths in the error, using the same SHA-256 identity policy as built libraries. Identical copies are audited once. Input conflicts are rejected before creating or replacing the JSON report.
Checked all 548 open PRs before publication and inspected the five that change the audit files: #5269, #4951, #4916, #4825 and #4425. None changes
read_modulesor implements this validation.Tested
Windows, Python 3.14, synthetic ELF fixtures. CTest
import_audit: 48/48 tests passed. The new regressions cover both directory orders, absent and existing JSON output, identical copies, repeated directories, imports, dependencies and export providers. Before the fix, all four conflicting-input cases failed with exit codes 0 or 1 instead of 2.Local conventions check against
origin/mainandgit diff --checkpassed. Python-only change; no title or runtime-library behavior is claimed.CI Build passed the relinker build and CTest suite on Linux (155 tests), Windows (150 tests) and macOS (146 tests), with no failures.
import_auditpassed on all three platforms. Conventions and PR intake also passed. Full runtime-library jobs were skipped by the repository's automatic PR policy.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T18:10:58Z.
Checked
read_modules(SHA-256 per file name, conflicting contents raiseAuditErrorwith both paths, identical copies audited once), and the new tests cover both directory orders, existing/absent JSON output and repeated directories.import_auditpasses on the merged tree and fails when the fix is reverted; merging.