fix(rsaccounts): locate the data directory relative to the executable on Linux - #360
Open
jolavillette wants to merge 1 commit into
Open
fix(rsaccounts): locate the data directory relative to the executable on Linux#360jolavillette wants to merge 1 commit into
jolavillette wants to merge 1 commit into
Conversation
RS_DATA_DIR is baked in at compile time, so a self contained tree (an AppImage, a portable directory, a staged install) could never find its own data: the binary kept reading the system wide path of the host, or nothing at all. Prefer <exedir>/../share/retroshare when that directory exists and fall back to RS_DATA_DIR otherwise, which leaves regular system installs and build trees untouched. This covers every file served from the data directory, the web UI in particular, which p3webui resolves as PathDataDirectory() + "/webui/".
jolavillette
force-pushed
the
fix/relocatable-data-dir
branch
from
August 6, 2026 23:17
e739c55 to
62700ff
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RS_DATA_DIRis baked in at compile time, so a relocatable tree (AppImage, portable directory, staged install) can never find its own data: the binary reads the host's system-wide path instead, or nothing at all.On Linux (excluding Android) prefer
<exedir>/../share/retrosharewhen that directory exists, and fall back toRS_DATA_DIRotherwise. System-wide installs and build trees are unaffected.This covers every file served from the data directory; the web UI in particular, which
p3webuiresolves asPathDataDirectory() + "/webui/".Verified on Linux: a binary placed in a relocated tree resolves its own data directory, while the same binary in a build tree still reports
RS_DATA_DIR. Full Qt5 build green.