fix(relinker): isolate imports between runtime plugins #21877
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/21877"
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 mihai1859 on 2026-11-16T20:10:05Z.
What
Addresses the plugin-import part of #5927. RetroArch ships unrelated cores exporting
getaddrinfo: an import can bind to the wrong sibling when there is one provider, or conversion fails as ambiguous when there are several.Plain named imports from runtime plugin folders now search the importing module, its declared transitive guest dependencies and the existing global startup/bundled modules. Unrelated runtime plugins cannot supply those imports. Windows startup lookup uses the same scope; Linux uses the existing provider aliases when duplicate names exist outside the selected scope. Genuine ambiguity within the scope still fails with the eligible providers listed.
Startup/bundled lookup, explicit library-qualified imports and legacy qualified console NIDs without module metadata retain their existing behavior. On Windows, a resolved legacy import is pinned to its selected guest provider. Tests cover these compatibility paths alongside unrelated providers, direct/transitive dependencies and host fallback.
This does not close all of #5927:
DF_SYMBOLICsupport is already on main, and Azahar independently exceeds the Windows PE export-count limit. Core execution/content loading remains unverified. The remaining macOS provider-specific binding limitation is recorded in technical debt.Tested
Windows, MinGW GCC 16.2:
LongPathsEnabledis disabled; optional symlink subcases skip without the Windows symlink privilege.9ba38f6608cb3b9c218135c1ba65ffe06da57e3a4a4d532fbf5aedb7663b7175. Main stops at ambiguousgetaddrinfo. With the fix, 32 cores, bundled libc and picker convert successfully with only Azahar set aside. All 33 advance past this ambiguity but stop at Azahar's separateToo many guest PE exportserror (90,704 exported ELF symbols). No game/core execution claim.Overlap review: #21728 changes the nearby macOS alias guard, but addresses module-qualified Mach-O bindings rather than plugin lookup scope. Neither implementation depends on the other; that guard may need a manual rebase when either lands. #15245 concerns explicit executable-module aliases. The other shared-file reports cover separate GS, RELRO, lowering, scanner or test-registration work; none supplies this import-scope fix.
Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositorySummary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T11:22:45Z.
Review: APPROVED
Reviewed — looks good
Nothing in the inspected changes shows a blocking defect; the import-scope resolution and compatibility paths are covered by targeted tests.
What I ran
Reviewed head
815b490f60414d73dbaaba2a206f102689eabba5. No commands or tests were run; no shell is available in this review session.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author reports Windows build/test checks and conversion checks, but these were not run here. Native Linux/macOS execution, console behavior, and RetroArch core execution remain unverified. Reviewed all files listed as changed in the manifest;
files.jsonwas not available in the prepared review folder.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-30T00:10:38Z.
Review: COMMENTED
Actionable comments posted: 2
Architecture findings (1)
Advisory architecture findings (1)
bcff2d12-498f-482d-896a-a76830b3bebeReviewing files that changed from the base of the PR and between
115a7036e2andd8bcbb5ebc.core/relinker/CMakeLists.txtcore/relinker/domain/include/domain/GuestRuntime.hppcore/relinker/elfpatcher/src/windows/WindowsEntryStubBuilder.cppcore/relinker/relinker/src/guest/GuestModuleBuilder.cppcore/relinker/relinker/tests/test_guest_import_scope.pydocs/dev/debt/changes/fix-5927-plugin-import-scope.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T00:18:40Z.
Review: COMMENTED
Reviewed — no blocking findings
The change appears consistent with its stated import-scoping goal, but I could not run the reported checks in this review environment.
What I ran
Reviewed head
d8bcbb5ebc08cc84d0fd7699fd4c80d9fc131c27and the prepared diff. No commands or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author reports a successful Windows relinker build and test batch, cross-platform converted-output checks, and a negative control; I did not independently run these. Native Linux and macOS execution, console interposition behavior, and RetroArch core execution were not verified. The six changed files listed in the prepared bundle were included and inspected; no excluded changed files were listed.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-02T14:37:23Z.
Review: COMMENTED
Reviewed — comments
The reviewed diff documents a remaining macOS limitation for duplicate guest exports; I also did not read head source for every changed file.
What I ran
At head
3e7256d619fa79e948f2a8eca2cb5c3b4ab1c505, I read the prepared diff and manifest, then usedrepo_read.pyto inspect targeted source ranges. I did not run tests or compile code.Results
Findings
Blocking
None identified in the inspected code.
Non-blocking
core/relinker/relinker/src/guest/GuestModuleBuilder.cpp:394Not verified
I read the prepared diff for all 11 changed files; all 11 have full text listed as included in the manifest, and none are listed as excluded. At the pinned head, I read targeted ranges from
GuestModuleBuilder.cpp,WindowsEntryStubBuilder.cpp, andWindowsGuestModuleWriter.cpp; I did not read the other changed files at the head. I did not independently verify the author-reported tests, platform behavior, or core execution.To get this to a good state
Nothing is required. Optional: address the documented macOS duplicate-provider limitation in a follow-up.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T11:55:22Z.
Review: COMMENTED
Built this head with
ANYPS5_RELINKER_ONLY=ONon Linux.guest_import_scope_windows,guest_import_scope_linux, andguest_import_scope_macosall passed their output checks. This run verified the emitted artifacts on Linux.AI-assisted: yes.