Skip to content

Commit

Permalink
fix(zenoh-flow-runtime): log wrapper path when failing to load it
Browse files Browse the repository at this point in the history
When the loading of a wrapper shared library failed, the path of the
library to wrap was displayed instead of that of the wrapper.

This commit fixes this error and adds debug information when a wrapper
shared library is about to be loaded.

* zenoh-flow-runtime/src/loader/mod.rs:
  - add debug logging information,
  - show wrapper path in error when loading it failed.

Signed-off-by: Julien Loudet <[email protected]>
  • Loading branch information
J-Loudet committed Jun 4, 2024
1 parent 843533d commit 2aba38f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion zenoh-flow-runtime/src/loader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,9 @@ impl Loader {
if extension == std::env::consts::DLL_EXTENSION {
&library_path
} else {
tracing::debug!(
"Loading wrapper for non native dynamic library extension < {extension} >"
);
self.extensions
.get_library_path(extension, node_symbol)
.ok_or_else(|| {
Expand All @@ -292,7 +295,7 @@ impl Loader {

let rust_library_path = std::fs::canonicalize(rust_library_path).context(format!(
"Failed to canonicalize path (did you put an absolute path?):\n{}",
library_path.display()
rust_library_path.display()
))?;

#[cfg(any(target_family = "unix", target_family = "windows"))]
Expand Down

0 comments on commit 2aba38f

Please sign in to comment.