Fix Linux file locations #740
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!740
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/740/head"
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?
@Kody-Schram on GitHub · 2026-09-20 20:37 UTC · original
Kody-Schram:main→main· +127 −65 · 5 files · 17 commits · closed without mergingDefines "_SaveData", "_Textures" and similar paths in a single spot and implements an enum and getter function for other code to use instead of copying the string literals all over and being more mistake prone.
Doesn't change MacOS or Windows, this does however change Linux
_TempData is now routed to /tmp/kyty
_DownloadData, _SaveData, _PipelineCache, _Textures are now at ~/.local/share/kyty
These changes are made to follow standard linux application file conventions
@coderabbitai[bot] on GitHub · 2026-09-20 20:50 UTC · original · edited 2026-10-07 16:36 UTC
📝 Walkthrough
Walkthrough
Added
PathUtilwith platform-specific resolution for save, temporary, pipeline-cache, download, and texture directories. Updated emulator sandbox mounts and texture cleanup to use resolved paths. Updated pipeline-cache storage and save-data directory operations to use centralized paths. Shader compilation options now receive the fullparams.user_datavalue. Removed an unused declaration and reformatted other code.Suggested reviewers:
nmzikMerge Risk: 🔴 Critical · up to
26877This change moves emulator data to standard Linux locations, but the save-data code currently does not compile, so the build breaks. A transfer mount can also claim a second slot for a save that is already mounted. Shader compilation now sees more user-data registers than the pipeline cache key accounts for. Existing Linux saves are not carried over to the new location, and path resolution with an unset HOME variable remains unresolved. This is not mergeable until at least the compile error is fixed.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 helpto get the list of available commands.@coderabbitai[bot] on GitHub · 2026-09-20 20:51 UTC · original
On
src/common/path_util.cppline 17 (outdated):🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Handle an unset
HOMEvariable.If
HOMEis unset,std::getenv("HOME")returnsnullptr. Constructingstd::filesystem::pathfrom that pointer has undefined behavior. This can terminate startup when the emulator resolves a save, texture, download, or pipeline-cache path.Check for a non-empty value and use a reliable home-directory fallback or fail with a controlled error.
@coderabbitai[bot] on GitHub · 2026-09-20 20:51 UTC · original · reviewed
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
413f3ae5-36ed-4578-aeab-88a939d57ebb📥 Commits
Reviewing files that changed from the base of the PR and between
fe4f9423e3and755b439306.📒 Files selected for processing (5)
src/common/path_util.cppsrc/common/path_util.hsrc/emulator.cppsrc/graphics/host_gpu/renderer/pipeline/pipelineCache.cppsrc/libs/libSaveData.cppIncluded review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
@ -352,3 +354,2 @@options.shader_hash = params.hash;options.user_data = user_data;options.back_code = params.back_code;options.user_data = params.user_data;@coderabbitai[bot] on GitHub · 2026-09-23 17:39 UTC · original
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 19121
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 16109
Pass the bounded user-data span to the compiler.
options.user_datadeterminesTranslateOptions::user_data_count. Passing the full array makes the compiler handle entries beyondparams.user_data_count. Resource materialization uses the shorter runtime span and can reject those accesses.Suggested fix
📝 Committable suggestion
@ -303,3 +303,3 @@static std::filesystem::path save_directory(std::string_view title_id, std::string_view dir_name,int32_t user_id) {const auto directory = std::filesystem::path(SAVE_DATA_DIR) / title_id / dir_name;const auto directory = PathUtil::GetPath(PathUtil::SAVE_DIR) / title_id / dir_name;@coderabbitai[bot] on GitHub · 2026-09-23 17:39 UTC · original
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Preserve access to existing Linux saves.
After this root moves from
_SaveData, existing saves remain at the old location.save_directoryandSaveDataDirNameSearchboth use the new root, so an upgrade can report an existing save as missing and create a separate save. Add a migration or an old-root fallback that moves the save before normal access. The PR objective identifies the Linux location change.@coderabbitai[bot] on GitHub · 2026-09-23 17:39 UTC · original · reviewed
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
e17aac28-fc8c-4f81-8e7f-5fc8392056a1📥 Commits
Reviewing files that changed from the base of the PR and between
b97054ec5fand8ea2bdb1de.📒 Files selected for processing (2)
src/graphics/host_gpu/renderer/pipeline/pipelineCache.cppsrc/libs/libSaveData.cppIncluded review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
@coderabbitai[bot] on GitHub · 2026-09-23 20:06 UTC · original
On
src/libs/libSaveData.cppline 676 (outdated):🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Keep
mount_diras a filesystem path.Line 706 uses
mount_dir / "sce_sys". The new.string()makesmount_dirastd::string, which does not support that operator.SaveDataMount3will not compile. Remove the conversion.Proposed fix
📝 Committable suggestion
@ -916,2 +914,2 @@const auto mount_dir = save_directory(mount->title_id->data, dir_name, mount->user_id);const int slot = g_mount_slots.FindAvailable(mount_dir);const auto mount_dir = save_directory(mount->title_id->data, dir_name, mount->user_id).string();const int slot = g_mount_slots.FindAvailable(dir_name);@coderabbitai[bot] on GitHub · 2026-09-23 20:06 UTC · original
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Check the full directory for an occupied mount slot.
FindAvailablecompares its argument with mounted filesystem paths. If the requested save is already mounted,dir_nameusually does not match its full path. The transfer mount can then take a second slot instead of returningSAVE_DATA_ERROR_BUSY. Passmount_dir, asSaveDataMount3does.Proposed fix
📝 Committable suggestion
@coderabbitai[bot] on GitHub · 2026-09-23 20:06 UTC · original · reviewed
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
dcd14536-3d96-47a9-a8f7-28cdb66cc5b1📥 Commits
Reviewing files that changed from the base of the PR and between
8ea2bdb1deand26877fc1cf.📒 Files selected for processing (1)
src/libs/libSaveData.cppIncluded review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
@awsms on GitHub · 2026-10-02 10:37 UTC · original
can this be reviewed?
@C0rn3j on GitHub · 2026-10-06 10:53 UTC · original
I see you attempted that by following XDG but then tossed it.
"XDG_SHARE_HOME" does not exist in the spec - was that an LLM imagining it?
You should use
$XDG_DATA_HOMEand default to$HOME/.local/shareif it is not set.https://wiki.archlinux.org/title/XDG_Base_Directory#User_directories
@Kody-Schram on GitHub · 2026-10-07 15:38 UTC · original
No, I did test XDG_SHARE_HOME as I similarily assumed that was the obvious solution. However if I remember correctly it wasn't set on my environment for some odd reason.
Doing a nullptr check for that environment var does make sense tho. I guess i just didnt do that because it basically always defaults to $HOME/.local/share
@lovemymobilewebsite-dotcom on GitHub · 2026-10-07 15:44 UTC · original · approved these changes
Pull request closed