feat(relinker): strict sce module search #2708
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2708"
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 boykopovar on 2026-10-10T11:48:14Z.
What
Add
--sce-module-pathfor the parent directory of bundled modules. Default to the input ELF directory. Resolve explicit relative paths from the working directory. Reject combination with--skip-sce-module. Document path resolution.The removal of recursive search is intentional. We want the behavior to be consistent every time, instead of trying to find missing files elsewhere. I'm currently fixing the tests; their failure is expected.
Tested
Windows: relinker build, DS
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs).mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T11:51:57Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/relinker/relinker/src/guest/GuestModuleBuilder.cppL94-135, L143-174core/relinker/cli/src/CliArgs.cppL9core/relinker/main.cppL102core/relinker/relinker/include/relinker/guest/GuestImage.hppL60core/relinker/relinker/src/guest/GuestModuleBuilder.cppL52-53docs/user/USAGE.mdL44-60Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-10T12:06:05Z.
Follow-up from issue #2663 and current relinker checks
I traced the new
right.sprxreport against the current discovery code and corrected my earlier issue comment. When a direct dependency is unresolved, the identity fallback scans the whole input tree for.prx/.sprx/.suprxfiles and callsReadModuleNamesbefore it knows whether a candidate matches. A malformedPT_DYNAMICin an unrelatedsce_sys/about/right.sprxtherefore aborts discovery. This is concrete evidence for limiting the scan to the configured module root; the bounds check itself should remain strict.I also checked the failures on this PR head. The same five relinker tests fail on Linux, Windows, and macOS:
linux_load_alignment--skip-sce-modulepath is checked.guest_runpathneeded.prx.guest.prxartifacts are absent for modules inMedia/ModulesandMedia/Modules/runtime.guest_needed_modulesMedia/Modulesis no longer discovered.guest_module_identityrenamed.sprxprovider inMedia/Modulesis no longer discovered.guest_needed_nested_modulesprx/shippingand nestedsce_module/sce_modulesdirectories are no longer emitted.The latest relinker matrix reports these failures on all three OSes (run 38049698989). Conventions also still fails on the PR head: run 38049712502 reports the unchecked “Based on current
main” template item; the earlier run additionally reported the non-Conventional title, which appears fixed since then.The scoped module-root approach looks relevant to #2663, but the current head needs the existing test suite reconciled with the new discovery contract before its results establish that the change is ready.
Imported from boykopovar/AnyPS5. Originally posted by DavidSamir on 2026-10-10T12:18:19Z.
Checked this head (
f756225f) against a synthetic reproducer of #2663: an executable that needs a library the title does not bundle, plussce_sys/about/right.sprxwithPT_DYNAMICpast the end of the file.main197ffac9stops withDynamic segment out of bounds; this branch converts it, for Linux and Windows output (macOS host, relinker-only build). A malformed.sprxinsidesce_moduleis still rejected with its path.Details and the reproducer cases are in #2663. If nested discovery is kept after all,
DavidSamir:fix/relinker-module-search-skips-sce-sysis the smaller change for the same report: it only leavessce_sysout of the walks, with tests, 90/90.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-10T12:34:46Z.
Update after the author clarified the intended discovery contract
I saw the updated PR description: recursive discovery is intentionally removed, with
--sce-module-pathdefining the module parent. That resolves my compatibility question; the rewritten tests now reflect the intended contract.The narrower #2663 change still provides a useful comparison for reviewers: excluding
sce_sysalso fixes the reported malformedright.sprx, while retaining recursive discovery. The reporter's native Windows 11 run passed 93/93 relinker tests and launched the original game; my Linux current-main red/green regression and 97/97 suite are summarized in issue #2663. The two proposals therefore have different intended behavior, not merely different implementations of the same contract.0bd2e4cThe broader module-root change now has the intended behavior documented and its eligible CI checks pass. The full Linux/Windows Build still needs the collaborator-triggered run described in
CONTRIBUTING.md.Imported from boykopovar/AnyPS5. Originally posted by boykopovar on 2026-10-10T12:35:48Z.
The decision to abandon recursive search is intentional. I want the behavior to be consistent every time. I'm currently fixing the tests; their failure is expected.