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
166 stars 87 forks source link

RPATH for installed bundle #607

Closed PengZheng closed 1 year ago

PengZheng commented 1 year ago

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.

_Originally posted by @pnoltes in https://github.com/apache/celix/issues/606