fix(tools): resolve $ORIGIN-prefixed converted module dependencies in import_audit #7454
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7454"
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 ggkouujere-debug on 2026-10-18T08:11:42Z.
What
Follow-up to #7179, which fixed the base-name half of #7174 (
libX.prxvslibX.prx.guest.prx). One mismatch remains: the relinker records converted modules' own dependencies as$ORIGIN/<file>(GuestModuleBuilder.cpp), where$ORIGINis the importing module's directory — buttools/import_audit.pymatches needed-library names verbatim, so e.g.$ORIGIN/libSceFace.prx.guest.prxis reported as a missing library even thoughlibSceFace.prx.guest.prxis present in--modules.The fix adds
strip_origin(), which strips the$ORIGIN/prefix before matching, and applies it inclassify(),audit()(all three missing-library checks) andaudit_host_dependencies(), mirroring how the loader expands$ORIGINto the importing module's directory. Plain names are untouched.Tested
test_converted_module_resolves_plain_and_origin_library_names: fails on currentmain(exit 1,$ORIGIN/libSceFace.prx.guest.prxreported missing), passes with the fix (exit 0, no missing libraries, import classifies asmodule).tools/tests/test_import_audit.py: 100 tests pass (2 pre-existing platform skips).python3 tools/check_conventions.py --base origin/main: pass.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 joedeangelis533-bot on 2026-10-19T14:32:50Z.
@ggkouujere-debug @johnohhh1 Following the order already recorded on #6171, I'll place our Windows host-library capitalization follow-up after #7454 and then #6171 and declare both dependencies. The standalone follow-up's rebase will preserve this PR's
$ORIGINcheck after Windows name resolution, plus #6171'shost_modulesargument and identity-side normalization.Our branch fixes PE host imports falsely reported missing when filename capitalization differs; ELF lookup remains case sensitive. Standalone validation on main
bcdee66d1passes 112 tests with 3 platform skips. An isolated combination with exact heads11840ad87(#7454) anda12828cf6(#6171), preserving upstream PE modules and normalizing requested names before identity lookup, passes 120 tests with 3 skips, plus eight SCE-identity/$ORIGIN resolution and ambiguity cases. Combined evidence uses main3686960c5; its audit/tool test blobs matchbcdee66d1exactly.Our follow-up stays a two-file Windows lookup change and will take its own rebase after the existing pair lands. No game runtime, full native build, Linux/macOS, or performance claim.
AI-assisted implementation, testing and communication: OpenAI Codex.
Imported from boykopovar/AnyPS5. Originally posted by johnohhh1 on 2026-10-20T18:29:47Z.
Independent validation of
11840ad87on Ubuntu and Windows Server 2025/Python 3.12 and 3.14. The original same-directory$ORIGIN/<file>case passes. I also found two directory-bearing forms emitted by the relinker that still produce false missing-library reports; reproducer below.Author-run CI and detailed artifacts, workflow commit
f97135c4b:11840ad87aa89b41d8on main78e398d6d35bf15c51, with its prepared identity-side normalization (70d98a029)Skips are the Windows-only replacement test on Linux and two POSIX permission tests on Windows. All three snapshots pass six subprocess CLI cases per platform. The new converted-module regression fails against both original and current main's tool, with one assertion failure and zero errors each. The combined preview also passes all four integration methods; omitting the identity-side normalization reproduces eight failed subcases with zero errors.
Rebase assistance: candidate commit
aa89b41d8preserves your authorship and resolves the two tool conflicts by retaining main's Windows host-importer matching andModuleNamessuffix/case rules alongside your prefix removal. The separate #6171 preview keeps our identity adjustment on our side. Both PR branches are unchanged; the agreed order stays #7454, then #6171. Candidate conventions and whitespace pass.Remaining path cases: stripping only
$ORIGIN/leaves a relative path that cannot match the audit's basename module set. With both module directories supplied and the referenced provider verified present:app0/sce_moduleneeding$ORIGIN/../Media/Modules/Provider.prx.guest.prxstill exits 1, reporting that dependency missing..needed.jsonentry$ORIGIN/app0/Media/Modules/Provider.prx.guest.prxalso still exits 1, reporting a missing needed library with zero import references.These correspond to guest dependency emission and executable dependency emission. On Linux, both fail on the exact PR, rebase candidate and combined preview; the same-directory control passes on all three. This additional path probe was not run on Windows.
Self-contained replay and pinned snapshots: check out the fork's
validation/pr-7454-windows-linux-20261020branch, then runpython validation-7454/probe_origin_layout.py. Could these emitted directory forms be covered when rebasing, while retaining ambiguity checks and the physical-file requirement for host dependencies?Synthetic Python/ELF/PE checks only; no native build, title/console replay, macOS result or performance claim. No maintainer-triggered upstream CI is claimed.
AI-assisted testing, rebase preparation and reporting: OpenAI Codex.
Imported from boykopovar/AnyPS5. Originally posted by ggkouujere-debug on 2026-10-21T10:44:18Z.
Thank you for the independent validation — great to see the exact PR commit pass on both Ubuntu and Windows Server 2025 across Python 3.12 and 3.14.
Agreed: #7454 stays first, then #6171. I'll rebase the PR branch onto latest main using the rebase assistance you prepared (authorship preserved), resolving the two tool conflicts as you suggested.
On the remaining path cases: yes, let's cover the two directory-bearing $ORIGIN forms in the rebase. After stripping $ORIGIN/, the audit will normalize the remaining relative path (resolving .. segments) and match on the resulting basename against the converted-module set, while keeping the ambiguity checks and the physical-file requirement for host dependencies. I'll add regression cases from your probe layout so the same-directory control and both new forms are covered.
Thanks again for the thorough validation and the rebase assistance.
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T00:14:31Z.
Real-title confirmation for the directory-bearing cases already discussed here: Darkest Dungeon II (
PPSA19591) produces both../Pluginsand../../sce_moduledependencies after conversion.I compared main
a6dcea9279b53b3a39c13695eac66f7c8b5b503cwith a private tool-only integration of this PR's unchanged head11840ad87c4065873cb2923b2367232d33bbe5ee. The one Windows host-matching conflict retains main's matching before the prefix check; main's newerlocate_missingand--strict-stubsbehavior are retained. This is an integration result, not a test of the exact standalone PR snapshot.All 17 registries and all three converted-module directories were supplied. A converted-only symlink view avoids scanning the original encrypted
.prxassets staged beside their converted counterparts. Both audits exit 1:$ORIGIN/PS5Util.prx.guest.prx$ORIGIN/libSceFace.prx.guest.prx$ORIGIN/libfmod.prx.guest.prx$ORIGIN/../../sce_module/libSceNpCppWebApi.prx.guest.prx$ORIGIN/../../sce_module/libc.prx.guest.prx$ORIGIN/../Plugins/NativePluginPS5Example.prx.guest.prxI independently parsed each importing ELF's
DT_NEEDED, expanded$ORIGINusing that importing file's physical parent, resolved the resulting path, and verified that all 14 references above point to existing files (with SHA-256 recorded locally). For example,app0/Media/Modules/Il2cppUserAssemblies.prx.guest.prxresolves its../Plugins/NativePluginPS5Example.prx.guest.prxdependency toapp0/Media/Plugins/NativePluginPS5Example.prx.guest.prx.Import classifications are unchanged: 6,617 references, 4,896 unique entries, 4,697 implemented / 47 stub / 152 module / 0 absent. The audit also reports
ld-linux-x86-64.so.2separately; that system-loader issue is outside the$ORIGINresult above. Host dependency failures are empty in both reports.Current-main Python suite: 122 tests run, 2 skipped; private integration plus this PR's regression: 123 run, 2 skipped, both successful. Command:
python3 -m unittest discover -s tools/tests -p test_import_audit.py. Static Linux/ELF evidence only; no game bring-up, native-loader, Windows or performance claim. This supports covering the nested forms in your planned rebase; no competing PR opened.AI-assisted testing and reporting: OpenAI Codex.
Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-29T06:07:29Z.
Review: COMMENTED
Reviewed
11840ad87c4065873cb2923b2367232d33bbe5eeagainstf6eeca4f5f0a6eee1eb884c1e8148a90d0d5d38f. The$ORIGIN/prefix is removed for converted-module availability checks while original dependency names remain in diagnostics. Plain module names still resolve; similarly named prefixes and nested names are not silently collapsed to a basename. No actionable defect found in this change.Windows/Python 3.11 validation: head 106 passed, 3 skipped; baseline 105 passed, 3 skipped. Skips cover two POSIX permission cases and one unavailable symlink privilege. The new regression fails against the old implementation (exit 1 rather than 0). Independent direct classification and host-dependency probes also reproduce the old false-missing result and pass with the fix, including plain, prefixed, lookalike-prefix and nested-name controls. No game execution was performed.
Publication-time checks: merge conflict with main. Please complete these checks before final approval; this status alone is not a demonstrated implementation defect.