Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zenohd's directory is the last searched path for plugin loading #1236

Closed
fuzzypixelz opened this issue Jul 10, 2024 · 1 comment
Closed

zenohd's directory is the last searched path for plugin loading #1236

fuzzypixelz opened this issue Jul 10, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@fuzzypixelz
Copy link
Member

fuzzypixelz commented Jul 10, 2024

Describe the bug

/example/path/to/zenohd searches for plugins in the following order:

  1. $PWD
  2. $HOME/.zenoh/lib
  3. /opt/homebrew/lib
  4. /usr/local/lib
  5. /usr/lib
  6. /example/path/to

This is because the search path Vec is ordered from first to last searched path, but (6) is inserted at the end here:

fn _new(mut search_paths: Vec<PathBuf>, exe_parent_dir: bool) -> Self {
if exe_parent_dir {
match std::env::current_exe() {
Ok(path) => match path.parent() {
Some(p) => if p.is_dir() {
search_paths.push(p.canonicalize().unwrap())
},
None => warn!("Can't search for plugins in executable parent directory: no parent directory for {}.", path.to_string_lossy()),
},
Err(e) => warn!("Can't search for plugins in executable parent directory: {}.", e),
}
}
LibLoader { search_paths }
}

To reproduce

  1. touch libzenoh_plugin_rest.dylib
  2. cargo run --bin zenohd

System info

@fuzzypixelz
Copy link
Member Author

Resolved in #1278.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant