fix(relinker): validate guest run paths for the target OS #5302

Closed
Ondra97 wants to merge 1 commit from upstream-pr/5302 into main
Ondra97 commented 2026-10-13 16:46:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-13T16:46:13Z.


Closed as a duplicate of #4801. The earlier claim that no other open PR implemented this fix was incorrect. The shared production fix should land in #4801; the verified test-only supplement and validation details preserve the additional Mach-O coverage.

What

On a Windows host, Linux and macOS guest conversion rejected a valid absolute run path such as /absolute libs because std::filesystem::is_absolute used Windows syntax. Conversely it accepted drive and UNC paths that are not Unix absolute paths. Validate Unix target paths by their leading slash, while preserving the existing $ORIGIN forms and Windows-target behavior. The regression uses target paths rather than host temporary-directory paths.

Tested

Windows, supported WinLibs GCC 15.2, Release full relinker-only build and 150/150 CTest tests passed. The Unix absolute-path regression failed before the fix. Actual Linux dynamic strings and Mach-O executable/guest run paths are checked, together with rejection of Windows drive and UNC paths before output. No title run is claimed.

Local conventions and whitespace checks passed. Current open PRs were checked for overlapping files, lines and functions.

CI relinker builds and test suites passed on Linux, Windows and macOS for 446a5893b (Build). Full runtime-library jobs were skipped by the automatic PR policy.

Combined local validation of #5283, #5286, #5298, #5302, #5305, #5308 and #5310 on main 61b8742b6: all seven patches merge without conflicts; the full relinker-only build and 150/150 CTest tests passed.

Checklist

  • Based on main at publication; superseded by #4801
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4846502206 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5302). Originally posted by [Ondra97](https://github.com/Ondra97) on 2026-10-13T16:46:13Z. --- Closed as a duplicate of #4801. The earlier claim that no other open PR implemented this fix was incorrect. The shared production fix should land in #4801; the [verified test-only supplement and validation details](https://github.com/boykopovar/AnyPS5/pull/4801#issuecomment-6152428159) preserve the additional Mach-O coverage. ### What On a Windows host, Linux and macOS guest conversion rejected a valid absolute run path such as /absolute libs because std::filesystem::is_absolute used Windows syntax. Conversely it accepted drive and UNC paths that are not Unix absolute paths. Validate Unix target paths by their leading slash, while preserving the existing $ORIGIN forms and Windows-target behavior. The regression uses target paths rather than host temporary-directory paths. ### Tested Windows, supported WinLibs GCC 15.2, Release full relinker-only build and 150/150 CTest tests passed. The Unix absolute-path regression failed before the fix. Actual Linux dynamic strings and Mach-O executable/guest run paths are checked, together with rejection of Windows drive and UNC paths before output. No title run is claimed. Local conventions and whitespace checks passed. Current open PRs were checked for overlapping files, lines and functions. CI relinker builds and test suites passed on Linux, Windows and macOS for `446a5893b` ([Build](https://github.com/boykopovar/AnyPS5/actions/runs/38434807218)). Full runtime-library jobs were skipped by the automatic PR policy. Combined local validation of #5283, #5286, #5298, #5302, #5305, #5308 and #5310 on main `61b8742b6`: all seven patches merge without conflicts; the full relinker-only build and 150/150 CTest tests passed. ### Checklist - [x] Based on `main` at publication; superseded by #4801 - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!5302
No description provided.