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

feat(nodes): pass the library path in the context #247

Merged
merged 2 commits into from
Apr 17, 2024

Commits on Apr 17, 2024

  1. feat(nodes): pass the library path in the context

    Fixes #246.
    
    As explained in #246, providing the path of the library that Zenoh-Flow
    loads is a requirement for developing extensions. For instance, in
    Python, the `pyo3` library needs to load the script.
    
    This change adds the accessor method `library_path` to the `Context`
    structure, that returns a reference to the full path of the library
    being loaded.
    
    * zenoh-flow-nodes/src/context.rs:
      - add the library_path field to the Context structure,
      - update the constructor accordingly,
      - add the accessor method `library_path()`.
    * zenoh-flow-runtime/src/loader/mod.rs:
      - update the Loader structure to also store the path of the library
        that is being loaded,
      - update the code to account for the path of the library being also
        stored.
    * zenoh-flow-runtime/src/runtime/load.rs:
      - remove the `Context` in the arguments of the `try_load_*` methods as
        it cannot be created at that stage but only when the nodes are
        loaded,
      - create the `Context` where appropriate.
    
    Signed-off-by: Julien Loudet <[email protected]>
    J-Loudet committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    6fff8c3 View commit details
    Browse the repository at this point in the history
  2. fix: in case of extensions, expose path of extension

    The previous code was exposing the path of the rust library associated
    with the extension, not the path of the library that was "loaded".
    
    This code will load the rust library but keep track and expose the path
    of the library that is to load (be it an extension or not).
    
    * zenoh-flow-runtime/src/loader/mod.rs:
      - differentiate the rust library from the "library to load", that, in
        the case of extensions, are different,
      - keep in the hashmap the "library to load" as key.
    
    Signed-off-by: Julien Loudet <[email protected]>
    J-Loudet committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    86613f4 View commit details
    Browse the repository at this point in the history