apache / celix

Apache Celix is a framework for C and C++14 to develop dynamic modular software applications using component and in-process service-oriented programming.
https://celix.apache.org/
Apache License 2.0
162 stars 86 forks source link

Add to BUILD_PATH #606

Closed pnoltes closed 1 year ago

pnoltes commented 1 year ago

This hotfix adds the $ORIGIN (loader_path) to the RPATH for bundle activator libraries during build.

Note that previously RPATH was set to $ORIGIN with target property BUILD_WITH_INSTALL_RPATH (see https://github.com/apache/celix/blob/rel/celix-2.3.0/cmake/cmake_celix/BundlePackaging.cmake#L341). But this brings issues while building and testing celix.

WIth BUILD_WITH_INSTALL_RPATH removed and because the bundle activator libs in Apache Celix bundles are never install (they are added into zip during build) the current used RPATH contains build paths and no $ORIGIN path. If $ORIGIN in not part of the RPATH, libraries inside the bundles cannot be successfully loaded on targets, but this is not apparent during build (because the build paths set in RPATH do exist).

Adding $ORIGIN to the build RPATH solve the bundle loading issues, but is not an ideal solution because the build specific paths are also still in the RPATH for installed bundles.