fix(relinker): compare guest module directories by identity #6156
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6156"
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 MarcZX10 on 2026-10-14T23:45:53Z.
What
Fixes #6136. Compare guest module directories by filesystem identity when checking for duplicate module directories and when rejecting an executable inside one. This catches case aliases on case-insensitive filesystems and symlink aliases, while preserving distinct case-sensitive paths on Linux. Add regression coverage for both checks.
This PR carries Jota's commit from
jotitadev:fix/relinker-guest-module-path-identity, retaining Jota as its author. It follows the invitation in #6136 to open the prepared fix.Tested
Linux x86-64, GCC 12.2, Release, relinker-only build:
cmake --build /tmp/anyps5-path-identity-build --parallel 8passed.ctest --test-dir /tmp/anyps5-path-identity-build -R '^(guest_module_dir|guest_module_identity|relinker_executables)$' --output-on-failure: 3/3 passed. On this case-sensitive filesystem, the tests exercised symlink identity and confirmed different-case paths remain distinct.python3 tools/check_conventions.py --base upstream/mainpassed.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 repositoryImported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-15T00:31:41Z.
Review: COMMENTED
Thanks for carrying this. I checked that the diff at
006e17681is identical to my commit6e3b80d65apart from the rebase context (blob ids and hunk offsets), and ran it on the case-insensitive filesystem this fix is for.Machine: Apple M2 Max, macOS 27.2, APFS (case-insensitive), Xcode 27 toolchain, relinker-only Release build.
Head:
006e17681. Base:main@ab9a47684(the PR's files are unchanged onmainsince its base2559e9623).guest_module_dirandrelinker_executablesfail/usr/bin/python33.9.6(
guest_module_dir,guest_module_directories,relinker_executables.)Without the fix, on APFS the case-alias branches are the ones that fail, which is the point of the PR:
guest_module_dir:--module-dir SCE_MODULEnext to the defaultsce_moduleis accepted instead of rejected asDuplicate guest module directory.relinker_executables:--module-dir Picker --executable picker/picker.binis not refused asin a guest module directory; the relinker goes on to convert the module as an executable.So the insensitive paths of both tests do run and catch the regression on macOS; on Linux only the symlink paths can.
Full relinker-only suite with the PR: arm64 163/163; x86_64 + Python 3.9.6 159/163, with the same 4 failures as
main(pr_overlap_encoding,stubgen_stdout_newlines,release_package,linux_fixed_base).Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by ideabsassistenza on 2026-10-15T06:55:55Z.
Independent Windows validation of head
006e1768128d23f491e78d51c709ecf58d97ed2c, compared with its parent2559e96233b2c83bc412a621904a8d87e9e456f9.Windows 11 x64 (build 22631), case-insensitive filesystem, WinLibs GCC 15.2.0 UCRT r7, CMake 4.4.4/Ninja, CPython 3.12.14; Release relinker-only build.
guest_module_dir,relinker_executablesandguest_module_identitypass, 3/3, in 28.10 s total (slowest group 22.27 s).guest_module_dirfails at theSCE_MODULEduplicate assertion;relinker_executablesfails at--module-dir Picker --executable picker/picker.bin, reachingInvalid string or symbol tableinstead of the intended directory guard.guest_module_identitystill passes.os.path.samefile; these checks supplement the symlink branches the PR tests skip on Windows.Only the relinker was built. The upstream focused tests execute their tiny generated Windows fixtures; the additional matrix only converts/inspects files. No full-library build, full test suite, game/homebrew, GPU, Linux/macOS execution or current-main composition was tested.
windows_fixed_basewas not run.AI-assisted testing and reporting: OpenAI Codex.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T11:13:42Z.
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/main.cppL208-217Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T15:34:23Z.
Thanks for the independent Windows 11 validation. The comparison against the parent confirms the module-directory identity change on Windows as well.