feat(relinker): support explicit CLI help #2117

Merged
krishalivaibhav merged 1 commit from upstream-pr/2117 into main 2026-10-10 05:54:10 +00:00
krishalivaibhav commented 2026-10-09 09:07:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by krishalivaibhav on 2026-10-09T09:07:48Z.


What

relinker --help currently fails with an unknown-option error. Recognize --help, print the shared usage text to stdout, and exit successfully before opening input files, writing output or registries, or running the converted executable. A help request does not require input/output paths. Unknown options, missing option values, and incompatible options still fail normally; --help consumed as an option value retains its literal meaning.

Add a CTest process-level regression test covering the success status/output, existing-output preservation, absence of registry/conversion side effects, and retained parser errors. Short -h remains a positional argument.

Related: #1856 adds parser unit tests but does not implement help. Its existing test source was compiled against this parser and passed. No dependency on #1856.

Tested

Latest publication head 0cdc9988 incorporates upstream main 745b775e without conflicts. Relinker-only Release build and all 38 local CTest tests passed on Apple M2 (5.81 seconds, 30-second per-test timeout), including the merged parser tests and cli_help. Conventions, test registration and whitespace checks passed. Both independent reviewers rechecked the final diff with no actionable findings. Hosted results below apply to the earlier CLI commit, not this updated head.

Open overlaps #2119 and #2154 implement separate features and are not dependencies. When integrating those branches, retain centralized usage text with both CLI switches and preserve both independent Python test registrations.

Apple M2 / 16 GB, macOS 27.2, AppleClang 17, CMake 4.4.4, Ninja 1.13.2; based on main 6cc0503d.

  • Relinker-only Release configure/build succeeded.
  • 35/35 registered CTest tests passed with a 30-second per-test timeout (6.59 seconds total).
  • The new CLI help test fails against the baseline executable with unknown option: --help and passes after the change.
  • Parser tests from #1856 head f765b27c compiled against this parser and passed.
  • Conventions, test registration and git diff --check passed.
  • Exact CLI commit 6e2e076: GitHub-hosted standalone relinker builds/tests passed on macOS, Linux and Windows (run). Full Linux/Windows builds at this commit hit the existing missing SPIR-V header include error, also observed on the upstream baseline.
  • Separate integration branch combines this CLI commit with the two CMake include-path fixes from existing PR #2093; those fixes are not included in this PR. Integration run: full Linux passed (479 passed, 26 skipped); Windows compiled successfully (303 passed, 191 skipped, 1 failed). The CLI help test passed on both platforms.
  • Remaining Windows failure: guest_video_out_wqhd_detection reports missing VK_KHR_surface, prints a skip message, but CTest reports failure despite configured skip return code 77. Its exit behavior remains unresolved. This is a separate executable with no CLI parser/main dependency; no passing full Windows suite is claimed.
  • Two independent agent reviews found no actionable CLI correctness or test coverage issues. No game execution was tested.

Checklist

  • Updated with main at 745b775e; overlapping open PRs checked
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no runtime exports or silent stubs changed
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source; none added
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes, prepared with Codex; the submitting author is responsible for the code
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4798381423 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2117). Originally posted by [krishalivaibhav](https://github.com/krishalivaibhav) on 2026-10-09T09:07:48Z. --- ### What `relinker --help` currently fails with an unknown-option error. Recognize `--help`, print the shared usage text to stdout, and exit successfully before opening input files, writing output or registries, or running the converted executable. A help request does not require input/output paths. Unknown options, missing option values, and incompatible options still fail normally; `--help` consumed as an option value retains its literal meaning. Add a CTest process-level regression test covering the success status/output, existing-output preservation, absence of registry/conversion side effects, and retained parser errors. Short `-h` remains a positional argument. Related: #1856 adds parser unit tests but does not implement help. Its existing test source was compiled against this parser and passed. No dependency on #1856. ### Tested Latest publication head `0cdc9988` incorporates upstream main `745b775e` without conflicts. Relinker-only Release build and all 38 local CTest tests passed on Apple M2 (5.81 seconds, 30-second per-test timeout), including the merged parser tests and `cli_help`. Conventions, test registration and whitespace checks passed. Both independent reviewers rechecked the final diff with no actionable findings. Hosted results below apply to the earlier CLI commit, not this updated head. Open overlaps #2119 and #2154 implement separate features and are not dependencies. When integrating those branches, retain centralized usage text with both CLI switches and preserve both independent Python test registrations. Apple M2 / 16 GB, macOS 27.2, AppleClang 17, CMake 4.4.4, Ninja 1.13.2; based on main `6cc0503d`. - Relinker-only Release configure/build succeeded. - 35/35 registered CTest tests passed with a 30-second per-test timeout (6.59 seconds total). - The new CLI help test fails against the baseline executable with `unknown option: --help` and passes after the change. - Parser tests from #1856 head `f765b27c` compiled against this parser and passed. - Conventions, test registration and `git diff --check` passed. - Exact CLI commit `6e2e076`: GitHub-hosted standalone relinker builds/tests passed on macOS, Linux and Windows ([run](https://github.com/krishalivaibhav/AnyPS5/actions/runs/37910199660)). Full Linux/Windows builds at this commit hit the existing missing SPIR-V header include error, also observed on the upstream baseline. - Separate integration branch combines this CLI commit with the two CMake include-path fixes from existing PR #2093; those fixes are not included in this PR. [Integration run](https://github.com/krishalivaibhav/AnyPS5/actions/runs/37913142153): full Linux passed (479 passed, 26 skipped); Windows compiled successfully (303 passed, 191 skipped, 1 failed). The CLI help test passed on both platforms. - Remaining Windows failure: `guest_video_out_wqhd_detection` reports missing `VK_KHR_surface`, prints a skip message, but CTest reports failure despite configured skip return code 77. Its exit behavior remains unresolved. This is a separate executable with no CLI parser/main dependency; no passing full Windows suite is claimed. - Two independent agent reviews found no actionable CLI correctness or test coverage issues. No game execution was tested. ### Checklist - [x] Updated with `main` at `745b775e`; overlapping open PRs checked - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; no runtime exports or silent stubs changed - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source; none added - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes, prepared with Codex; the submitting author is responsible for the code
MarcZX10 commented 2026-10-09 10:16:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T10:16:37Z.


FYI, #2154 adds an independent Windows diagnostic fixture-isolation CTest in the same Python-enabled block of core/relinker/CMakeLists.txt. A sequential merge of the two PRs currently conflicts in that file. When rebasing, keep both the cli_help and windows_diagnostic_fixture_isolation registrations; they cover separate behaviors.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6078911542 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2117#issuecomment-6078911542). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T10:16:37Z. --- FYI, #2154 adds an independent Windows diagnostic fixture-isolation CTest in the same Python-enabled block of `core/relinker/CMakeLists.txt`. A sequential merge of the two PRs currently conflicts in that file. When rebasing, keep both the `cli_help` and `windows_diagnostic_fixture_isolation` registrations; they cover separate behaviors.
oneandonlydean commented 2026-10-10 03:19:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T03:19:13Z.


This conflicts with main after today's merges; could you rebase? It passed testing and is otherwise ready.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6093234217 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2117#issuecomment-6093234217). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T03:19:13Z. --- This conflicts with main after today's merges; could you rebase? It passed testing and is otherwise ready.
github-actions[bot] commented 2026-10-10 05:41:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T05:41:36Z.


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.

Pull request Conflicting files (lines on main) Same exports Same new files
#2561 core/relinker/cli/tests/test_help.py
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6094304344 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2117#issuecomment-6094304344). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T05:41:36Z. --- <!-- pr-overlap --> 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**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #2561 | | | `core/relinker/cli/tests/test_help.py` |
nyavana commented 2026-10-10 08:47:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by nyavana on 2026-10-10T08:47:50Z.


The usage guide still says there is no --help flag. This small documentation follow-up corrects that and the help/no-argument exit codes: github.com/nyavana/AnyPS5@609a1c397c

Verified with a Linux relinker build, cli_help, and direct CLI checks. Sharing for consideration. AI-assisted.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095822773 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2117#issuecomment-6095822773). Originally posted by [nyavana](https://github.com/nyavana) on 2026-10-10T08:47:50Z. --- The usage guide still says there is no --help flag. This small documentation follow-up corrects that and the help/no-argument exit codes: https://github.com/nyavana/AnyPS5/commit/609a1c397c914e3fb7d17fd96d26db1fa9037054 Verified with a Linux relinker build, cli_help, and direct CLI checks. Sharing for consideration. AI-assisted.
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!2117
No description provided.