Skip to content

feature/relative-plugin-paths - #302

Open
jolavillette wants to merge 5 commits into
RetroShare:masterfrom
jolavillette:feature/relative-plugin-paths
Open

feature/relative-plugin-paths#302
jolavillette wants to merge 5 commits into
RetroShare:masterfrom
jolavillette:feature/relative-plugin-paths

Conversation

@jolavillette

Copy link
Copy Markdown
Contributor

feature/relative-plugin-paths

Useful for testing environments. When running this branch, RetroShare will dynamically resolve the executable's directory and first look for plugins in ../lib/retroshare/extensions6/ and ./lib/retroshare/extensions6/ (relative to the binary's location) before falling back to the hardcoded system path.

@csoler

csoler commented May 28, 2026

Copy link
Copy Markdown
Contributor

I assume that this PR is for testing purposes only so it is not intended to be merged, right?

Also why don't you just do
plugins_directories.push_back("../lib/retroshare/extensions6/") ;
in rsinit.cc ??

@jolavillette
jolavillette force-pushed the feature/relative-plugin-paths branch 3 times, most recently from 93980be to 8088acf Compare June 7, 2026 12:43
@jolavillette
jolavillette force-pushed the feature/relative-plugin-paths branch 3 times, most recently from e91d354 to fb2e4f5 Compare June 16, 2026 21:16
@jolavillette
jolavillette force-pushed the feature/relative-plugin-paths branch 4 times, most recently from 92fc559 to a01ed69 Compare July 8, 2026 20:10
@jolavillette
jolavillette force-pushed the feature/relative-plugin-paths branch 4 times, most recently from d8636bc to c5fa7b9 Compare July 24, 2026 10:45
@jolavillette
jolavillette force-pushed the feature/relative-plugin-paths branch 4 times, most recently from e412ad0 to fe82fc3 Compare July 31, 2026 20:10
@jolavillette

Copy link
Copy Markdown
Contributor Author

@csoler correct, it targets testers (typically running several versions side by side) — a normal install is unaffected: the relative dirs simply don't exist there and the system path is still searched. About the plain push_back: a relative path would be resolved against the current working directory, not the executable's location — resolving the exe path (and its symlinks) is the whole point.

@jolavillette
jolavillette force-pushed the feature/relative-plugin-paths branch 2 times, most recently from 6a8124f to b7d709c Compare August 3, 2026 10:20

@csoler csoler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that this PR is quite a lot of code as compared to what it wants to do, especially that it complicates a lot rsinit.cc and this file it is already pretty long:

  • removing duplicate paths is not useful because the plugin manager can easily remove duplicate files by replacing the member std::vector with a std::map<RsFileHash,PluginInfo> (or use some temporary std::map that is later converted to std::vector, in order to avoid changing too much code). It's way simpler indeed to remove duplicates based on hash of the plugins rather than based on expanded directory names (which is system-dependent).

  • I don't see the need for a special treatment for relative paths. Just append them to currentExecutablePath() and that's all.

Comment thread src/rsserver/rsinit.cc
#include <vector>

namespace {
std::string resolvePathTextually(const std::string& path)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a function doing exactly this already: canonicalize_file_name() in glibc. See how it's used in rsdir.cc. It can be called using RsDirUtil::removeSymLinks() which also...removes the symbolic links in the path.

@jolavillette
jolavillette force-pushed the feature/relative-plugin-paths branch 2 times, most recently from 50484a8 to 1f8ae24 Compare August 4, 2026 18:29
@jolavillette
jolavillette force-pushed the feature/relative-plugin-paths branch from 1f8ae24 to 1b4f397 Compare August 6, 2026 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants