fix(libkernel): create per-title data directory #4648

Closed
likecrank-dotcom wants to merge 2 commits from upstream-pr/4648 into main
likecrank-dotcom commented 2026-10-12 17:48:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by likecrank-dotcom on 2026-10-12T17:48:46Z.


What

Fixes #4643.

Create a data directory inside each title's per-run working directory during libkernel startup. This provides the empty /data mount point expected by homebrew titles, independently of param.json or download-data metadata.

Tested

Windows native, MinGW GCC 15.2, Release:

  • cmake --build D:\anyps5_work\build-bda-collision --target download_data_mount_tests -j 8
  • ctest --test-dir D:\anyps5_work\build-bda-collision -R '^download_data_mount_' --output-on-failure — 3/3 passed.
  • python tools/check_conventions.py --base origin/main and git diff --check passed.

No title runtime was run. The empty directory addresses ProsperoEden's reported directory probe; PS5CEMU-HAR's later need for installed files under /data/homebrew/

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4833048384 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4648). Originally posted by [likecrank-dotcom](https://github.com/likecrank-dotcom) on 2026-10-12T17:48:46Z. --- ### What Fixes #4643. Create a data directory inside each title's per-run working directory during libkernel startup. This provides the empty /data mount point expected by homebrew titles, independently of param.json or download-data metadata. ### Tested Windows native, MinGW GCC 15.2, Release: - cmake --build D:\anyps5_work\build-bda-collision --target download_data_mount_tests -j 8 - ctest --test-dir D:\anyps5_work\build-bda-collision -R '^download_data_mount_' --output-on-failure — 3/3 passed. - python tools/check_conventions.py --base origin/main and git diff --check passed. No title runtime was run. The empty directory addresses ProsperoEden's reported directory probe; PS5CEMU-HAR's later need for installed files under /data/homebrew/<title> remains separate. ### Checklist - [x] Based on current main; no other open PR implements the same behavior - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; silent stubs are listed in TechnicalDebt - [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 behavior, not specific to one title - [x] Depends on: none - [x] Unblocks: PS5CEMU-HAR and ProsperoEden (#4643; title IDs not provided) - [x] AI-assisted: yes (OpenAI Codex); the human account holder is responsible for the submission
MarcZX10 commented 2026-10-12 17:54:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T17:54:15Z.


I independently tested this behavior on Linux x86-64 with GCC 12.2 Release using an equivalent candidate patch: download_data_mount_tests built and all 3/3 matching CTest cases passed; the conventions check and git diff --check also passed. This run used the candidate checkout, not this PR head, so this is supporting evidence rather than a report of testing this exact commit. The PR checks are still running.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6129658087 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4648#issuecomment-6129658087). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-12T17:54:15Z. --- I independently tested this behavior on Linux x86-64 with GCC 12.2 Release using an equivalent candidate patch: `download_data_mount_tests` built and all 3/3 matching CTest cases passed; the conventions check and `git diff --check` also passed. This run used the candidate checkout, not this PR head, so this is supporting evidence rather than a report of testing this exact commit. The PR checks are still running.
MarcZX10 commented 2026-10-12 18:15:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T18:15:57Z.

Review: COMMENTED


One test-repeatability issue:

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5494494672 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4648#pullrequestreview-5494494672). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-12T18:15:57Z. **Review:** COMMENTED --- One test-repeatability issue:
MarcZX10 commented 2026-10-12 18:15:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T18:15:58Z.

Code review location: core/libs/tests/GuestDownloadDataMount.cpp; line 14

@@ -10,6 +10,7 @@ static void Require(bool value) { if (!value) std::abort(); }
 int main(int argc, char** argv) {
     Require(argc == 2);
     const std::string_view mode = argv[1];
+    Require(std::filesystem::is_directory("data"));
     Require(std::filesystem::is_directory("download0") == (mode == "declared"));

The invalid case returns without removing data. CMake reuses this case's working directory, so after one successful run a later run can pass this assertion using the stale directory even if startup stops creating it. Please remove data before the early return (or otherwise reset this fixture before each run).

<!-- greyfinch-sync:boykopovar/AnyPS5:review-comment:4251060265 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4648#discussion_r4251060265). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-12T18:15:58Z. **Code review location:** `core/libs/tests/GuestDownloadDataMount.cpp`; line 14 ~~~~diff @@ -10,6 +10,7 @@ static void Require(bool value) { if (!value) std::abort(); } int main(int argc, char** argv) { Require(argc == 2); const std::string_view mode = argv[1]; + Require(std::filesystem::is_directory("data")); Require(std::filesystem::is_directory("download0") == (mode == "declared")); ~~~~ --- The `invalid` case returns without removing `data`. CMake reuses this case's working directory, so after one successful run a later run can pass this assertion using the stale directory even if startup stops creating it. Please remove `data` before the early return (or otherwise reset this fixture before each run).
xXPBSXx commented 2026-10-12 23:08:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T23:08:28Z.


Windows test: head 23fa23ff5 merged onto current main 0428328b7 (clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release, -j2: full build 0 errors; ctest with the filter download_data_mount: download_data_mount_declared passed, download_data_mount_none passed, download_data_mount_invalid passed (3 test(s), 0 failed); python tools/check_conventions.py --base upstream/main passed. I did not run the new tests against main without the change.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6134349618 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4648#issuecomment-6134349618). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T23:08:28Z. --- Windows test: head `23fa23ff5` merged onto current `main` `0428328b7` (clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release, `-j2`: full build 0 errors; ctest with the filter `download_data_mount`: download_data_mount_declared passed, download_data_mount_none passed, download_data_mount_invalid passed (3 test(s), 0 failed); `python tools/check_conventions.py --base upstream/main` passed. I did not run the new tests against `main` without the change. AI-assisted (Claude Code).
oneandonlydean commented 2026-10-13 02:43:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T02:43:58Z.


Closing: #4690, now merged, creates the same data directory, but only where app0/sce_sys/param.json marks a run folder, and was run on two titles from #4643. Created unconditionally, it also appears wherever a test loads libkernel, including the source tree.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6137049667 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4648#issuecomment-6137049667). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T02:43:58Z. --- Closing: #4690, now merged, creates the same `data` directory, but only where `app0/sce_sys/param.json` marks a run folder, and was run on two titles from #4643. Created unconditionally, it also appears wherever a test loads libkernel, including the source tree.

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!4648
No description provided.