launcher: add opt-in portable settings #1260

Closed
github-bot wants to merge 2 commits from gh-pr/1260/head into gh-pr/1260/base
Owner

@⁠popeee99 on GitHub · 2026-10-08 21:25 UTC · original
popeee99:fix/portable-launcher-settings → main · +171 −25 · 5 files · 2 commits · closed without merging

Adds the launcher portion of the portable mode requested in #151 (#151).

With an empty portable.txt beside the launcher, settings are read from and written to the adjacent Kyty.ini, including first launch when that file does not yet exist. Launcher startup selects the executable directory as its working directory so the existing relative compatibility database also stays there. Without the marker, the existing current-directory and platform-scoped settings precedence is preserved.

The underlying problem is that both settings paths previously chose only between a current-directory INI and platform-scoped settings; neither recognized the requested marker. The compatibility database also used the caller's working directory. A shared settings factory keeps read and write selection consistent.

This intentionally does not close #151: emulator data paths and explicitly configured output paths are outside this launcher change. Existing settings are not migrated. The launcher directory must be writable. I checked the open portable-related PRs and #740 (Linux emulator data paths); #740 does not modify these launcher files.

Validation:

  • Added a regression executable using the real ConfigurationListWidget and Qt implementation, in an isolated copied executable directory containing spaces. It checks marker location/type, first-run creation, persistence, working-directory changes, legacy precedence, and preservation of existing nonportable settings. It runs offline with --local.

  • Against upstream 2f4b8a335d5e27a5153bdea670bd877a061e37b1, the new test fails because the selected file is working/Kyty.ini instead of the executable-adjacent Kyty.ini; the three selected existing tests pass.

  • With the fix, launcher_settings, controller_settings, bit_array, and lru_cache pass (4/4).

  • The launcher regression passes with Clang 21.1.8 AddressSanitizer and UndefinedBehaviorSanitizer, with leak detection enabled. Launcher sources in the test were instrumented; external Qt/common libraries were not rebuilt with sanitizer instrumentation.

  • git diff --check passes.

  • Full local launcher build, including kyty_emulator, succeeds on WSL Ubuntu with Clang 21.1.8 and Qt 6.10.2.

  • All four existing emulator CLI integration tests pass. The four focused regressions pass again after the final CMake change; the launcher test remains sanitizer-instrumented.

  • An isolated offscreen smoke test of the real launcher confirms normal mode retains the caller's working directory and portable mode switches to the executable directory and creates adjacent Kyty.ini.

  • The new regression is included in the documented kyty_tests aggregate target. Existing CI selects specific test targets, so it does not run this new Qt regression automatically.

  • Windows, macOS, and Linux CI passed the full build, selected existing regression tests, installation, and artifact upload on the production-fix commit be85a14: https://github.com/popeee99/KytyPS5/actions/runs/37844397510. The subsequent commit only adds the aggregate test dependency, verified by local CMake generation and the final test run.

No proprietary game files were used. Game execution and GPU rendering were not validated; the available WSL software Vulkan device lacks required features. The full registered CTest suite was not run locally. This is launcher storage behavior, not a game compatibility or performance improvement.

CodeRabbit reviewed the final commit fa2dd2d and reported no actionable code findings. Its linked-issue warning correctly notes the intentionally partial scope above; its docstring-coverage warning is not addressed with redundant comments. Upstream Actions requires maintainer approval; the fork CI results above are independently available.

AI assistance: Codex investigated, implemented, reviewed, and ran the validation for this change at the contributor's request. No independent human code review is claimed.

**@⁠popeee99** on GitHub · 2026-10-08 21:25 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1260) `popeee99:fix/portable-launcher-settings` → `main` · +171 −25 · 5 files · 2 commits · closed without merging Adds the launcher portion of the portable mode requested in #151 (https://git.gtahub.st/github/KytyPS5--KytyPS5/issues/151). With an empty `portable.txt` beside the launcher, settings are read from and written to the adjacent `Kyty.ini`, including first launch when that file does not yet exist. Launcher startup selects the executable directory as its working directory so the existing relative compatibility database also stays there. Without the marker, the existing current-directory and platform-scoped settings precedence is preserved. The underlying problem is that both settings paths previously chose only between a current-directory INI and platform-scoped settings; neither recognized the requested marker. The compatibility database also used the caller's working directory. A shared settings factory keeps read and write selection consistent. This intentionally does not close #151: emulator data paths and explicitly configured output paths are outside this launcher change. Existing settings are not migrated. The launcher directory must be writable. I checked the open portable-related PRs and #740 (Linux emulator data paths); #740 does not modify these launcher files. Validation: - Added a regression executable using the real `ConfigurationListWidget` and Qt implementation, in an isolated copied executable directory containing spaces. It checks marker location/type, first-run creation, persistence, working-directory changes, legacy precedence, and preservation of existing nonportable settings. It runs offline with `--local`. - Against upstream `2f4b8a335d5e27a5153bdea670bd877a061e37b1`, the new test fails because the selected file is `working/Kyty.ini` instead of the executable-adjacent `Kyty.ini`; the three selected existing tests pass. - With the fix, `launcher_settings`, `controller_settings`, `bit_array`, and `lru_cache` pass (4/4). - The launcher regression passes with Clang 21.1.8 AddressSanitizer and UndefinedBehaviorSanitizer, with leak detection enabled. Launcher sources in the test were instrumented; external Qt/common libraries were not rebuilt with sanitizer instrumentation. - `git diff --check` passes. - Full local `launcher` build, including `kyty_emulator`, succeeds on WSL Ubuntu with Clang 21.1.8 and Qt 6.10.2. - All four existing emulator CLI integration tests pass. The four focused regressions pass again after the final CMake change; the launcher test remains sanitizer-instrumented. - An isolated offscreen smoke test of the real launcher confirms normal mode retains the caller's working directory and portable mode switches to the executable directory and creates adjacent `Kyty.ini`. - The new regression is included in the documented `kyty_tests` aggregate target. Existing CI selects specific test targets, so it does not run this new Qt regression automatically. - Windows, macOS, and Linux CI passed the full build, selected existing regression tests, installation, and artifact upload on the production-fix commit `be85a14`: https://github.com/popeee99/KytyPS5/actions/runs/37844397510. The subsequent commit only adds the aggregate test dependency, verified by local CMake generation and the final test run. No proprietary game files were used. Game execution and GPU rendering were not validated; the available WSL software Vulkan device lacks required features. The full registered CTest suite was not run locally. This is launcher storage behavior, not a game compatibility or performance improvement. CodeRabbit reviewed the final commit `fa2dd2d` and reported no actionable code findings. Its linked-issue warning correctly notes the intentionally partial scope above; its docstring-coverage warning is not addressed with redundant comments. Upstream Actions requires maintainer approval; the fork CI results above are independently available. AI assistance: Codex investigated, implemented, reviewed, and ran the validation for this change at the contributor's request. No independent human code review is claimed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:50:29 +00:00
github-bot closed this pull request 2026-11-26 09:50:29 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-08 21:28 UTC · original · edited 2026-10-08 21:36 UTC

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c8508b65-d0da-459b-bb8e-14e7dce316ed
📥 Commits

Reviewing files that changed from the base of the PR and between 2f4b8a335d and fa2dd2df2f.

📒 Files selected for processing (5)
  • README.md
  • src/launcher/CMakeLists.txt
  • src/launcher/src/configurationListWidget.cpp
  • src/launcher/src/main.cpp
  • tests/LauncherSettingsTests.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

When portable.txt exists beside the launcher, startup attempts to use the application directory as its working directory. Settings reads and writes use a shared selection: portable Kyty.ini, an existing current-directory Kyty.ini, or platform-scope settings. The change adds tests for these choices and documents portable settings behavior.

Suggested reviewers: nmzik

Priority: ⬇️ Low

Change: Feature

Merge Risk: ⚪ Minimal · up to fa2dd

The portable settings change is mergeable after normal checks; no outstanding behavior issue is established.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Issue [#151] requests a fully portable emulator and launcher that keep all files and configurations in the application folder. This PR implements the launcher subset: an adjacent portable.txt select… Extend the portable-mode implementation to keep the emulator data paths and explicitly configured output paths in the application folder when portable.txt is present, and add automated coverage for those paths.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 3 files. (2 skipped: 2 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed The changed source, README text, CMake test integration, and LauncherSettingsTests.cpp all support the launcher portable-settings behavior described for [#151]. The working-directory change also sup…
Title check ✅ Passed The title clearly and concisely identifies the main change: adding opt-in portable settings to the launcher.
Description check ✅ Passed The description directly explains the portable settings behavior, scope, implementation, and validation for the changeset.
Full details: Linked Issues check

Explanation

Issue [#151] requests a fully portable emulator and launcher that keep all files and configurations in the application folder. This PR implements the launcher subset: an adjacent portable.txt selects adjacent Kyty.ini, launcher startup changes to the executable directory, and the regression test covers selection and persistence. The PR documentation states that emulator data paths and explicitly configured output paths retain their prior behavior. Therefore, the full coding requirement in [#151] remains unmet.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 3 files. (2 skipped: 2 unsupported.)

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-08 21:28 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1260#issuecomment-6069390470) · edited 2026-10-08 21:36 UTC <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/1260?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=2" alt="Review in Change Stack →" width="220" height="32"></a> <!-- review_stack_entry_end --> <!-- recent_review_start --> No actionable comments were generated in the recent review. 🎉 <details> <summary>ℹ️ Recent review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `c8508b65-d0da-459b-bb8e-14e7dce316ed` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 2f4b8a335d5e27a5153bdea670bd877a061e37b1 and fa2dd2df2f8526e0a0614ae25ac39f7b0d7f36c5. </details> <details> <summary>📒 Files selected for processing (5)</summary> * `README.md` * `src/launcher/CMakeLists.txt` * `src/launcher/src/configurationListWidget.cpp` * `src/launcher/src/main.cpp` * `tests/LauncherSettingsTests.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. </details> --- <!-- recent_review_end --> <!-- walkthrough_start --> <details> <summary>📝 Walkthrough</summary> ## Walkthrough When `portable.txt` exists beside the launcher, startup attempts to use the application directory as its working directory. Settings reads and writes use a shared selection: portable `Kyty.ini`, an existing current-directory `Kyty.ini`, or platform-scope settings. The change adds tests for these choices and documents portable settings behavior. **Suggested reviewers:** `nmzik` </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ⬇️ Low <!-- change_assessment_commit:"fa2dd2df2f8526e0a0614ae25ac39f7b0d7f36c5" --> **Change:** Feature <!-- change_assessment_end --> <!-- final_review_risk_start --> **Merge Risk:** **⚪ Minimal** · up to `fa2dd` <!-- final_review_risk_coverage:{"sourceCommitId":"fa2dd2df2f8526e0a0614ae25ac39f7b0d7f36c5","coveredCommitId":"fa2dd2df2f8526e0a0614ae25ac39f7b0d7f36c5","kind":"reviewed"} --> The portable settings change is mergeable after normal checks; no outstanding behavior issue is established. <!-- final_review_risk_end --> <!-- pre_merge_checks_walkthrough_start --> <details> <summary>🚥 Pre-merge checks | ✅ 3 | ❌ 2</summary> ### ❌ Failed checks (2 warnings) | Check name | Status | Explanation | Resolution | | :----------------- | :--------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Linked Issues check | ⚠️ Warning | Issue [`#151`] requests a fully portable emulator and launcher that keep all files and configurations in the application folder. This PR implements the launcher subset: an adjacent `portable.txt` select… | Extend the portable-mode implementation to keep the emulator data paths and explicitly configured output paths in the application folder when `portable.txt` is present, and add automated coverage for those paths. | | Docstring Coverage | ⚠️ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 3 files. (2 skipped: 2 … | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary>✅ Passed checks (3 passed)</summary> | Check name | Status | Explanation | | :------------------------ | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Out of Scope Changes check | ✅ Passed | The changed source, README text, CMake test integration, and `LauncherSettingsTests.cpp` all support the launcher portable-settings behavior described for [`#151`]. The working-directory change also sup… | | Title check | ✅ Passed | The title clearly and concisely identifies the main change: adding opt-in portable settings to the launcher. | | Description check | ✅ Passed | The description directly explains the portable settings behavior, scope, implementation, and validation for the changeset. | </details> <details> <summary>Full details: Linked Issues check</summary> **Explanation** Issue [`#151`] requests a fully portable emulator and launcher that keep all files and configurations in the application folder. This PR implements the launcher subset: an adjacent `portable.txt` selects adjacent `Kyty.ini`, launcher startup changes to the executable directory, and the regression test covers selection and persistence. The PR documentation states that emulator data paths and explicitly configured output paths retain their prior behavior. Therefore, the full coding requirement in [`#151`] remains unmet. </details> <details> <summary>Full details: Docstring Coverage</summary> **Explanation** Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 3 files. (2 skipped: 2 unsupported.) </details> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- autopilot:start --> - [ ] <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autopilot</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts <!-- autopilot:end --> <!-- tips_start --> --- Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=1260)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary>❤️ Share</summary> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </details> <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.