Skip to content

Conversation

@lsk567
Copy link
Contributor

@lsk567 lsk567 commented Jan 1, 2026

The overall goal of this PR is to support a new trace plugin that streams data to the Xronos dashboard.

The existing mechanism to link against a trace plugin library is through find_library, which requires the plugin library to be located at the root of the generated C project (i.e., LF_ROOT). This requires using the files target property to copy the trace plugin library to LF_ROOT.

While this approach works for a small, self-contained library, this approach would not work if a library has its own dependencies, as the library needs to link against them, which find_library does not do.

A more robust approach is to pull in the plugin library dependencies using a custom cmake file via the cmake-include target property.

This PR:

  1. removes find_library and adds a message for the user to provide the cmake file;
  2. makes the default plugin compilable using build.sh.

@lsk567 lsk567 added the enhancement Enhancement of existing feature label Jan 1, 2026
@lsk567 lsk567 added feature New feature and removed enhancement Enhancement of existing feature labels Jan 1, 2026
Copy link
Contributor

@edwardalee edwardalee left a comment

Choose a reason for hiding this comment

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

This looks good to me, although without an example, it is hard to see how a user could figure out how to use the trace plugin mechanism.

# We also link with libdl because it is needed for some platforms.
# TODO: Figure out why this is the case and how to avoid it.
target_link_libraries(reactor-c PRIVATE ${TRACE_LIB} dl)
message(STATUS "Trace plugin is set to TRUE. Expecting a cmake file for linking against the plugin via the `cmake-include` target property.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this possibly point to an example? Perhaps we could add a test in the lingua-franca repo that uses the default trace implementation as if it were an externally provided trace implementation?

@lhstrh
Copy link
Member

lhstrh commented Jan 2, 2026

Is it really true that the files target property must be used? I haven't seen that in examples. When you build a shared library and install it (i.e., put it in a location where find_library will find it, such as /usr/local/lib), no files need to be copied.

If transitive dependencies are the concern, would find_package do the trick?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants