Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Jaeger's shared lib links to the opentracing static lib #40

Closed
ringerc opened this issue Jan 24, 2018 · 3 comments
Closed

Jaeger's shared lib links to the opentracing static lib #40

ringerc opened this issue Jan 24, 2018 · 3 comments

Comments

@ringerc
Copy link
Contributor

ringerc commented Jan 24, 2018

Opentracing builds its shared lib with -fPIC and its static lib without (see opentracing/opentracing-cpp#49).

Jaeger links to the opentracing static lib from the Jaeger shared lib. That's a very weird thing to do in the first place, and becomes a problem when building against a local default opentracing install that has a non-PIC static lib.

Jaeger should really just link to the opentracing shared lib from its own shared lib and let the dynamic loader take care of the opentracing lib on demand. Please.

@ringerc
Copy link
Contributor Author

ringerc commented Jan 24, 2018

I just did

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d6c99c9..66539b1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -60,7 +60,7 @@ hunter_add_package(opentracing-cpp)
 # Not `${hunter_config}` because OpenTracing provides its own
 # OpenTracingConfig.cmake file
 find_package(OpenTracing CONFIG REQUIRED)
-list(APPEND LIBS OpenTracing::opentracing-static)
+list(APPEND LIBS OpenTracing::opentracing)
 list(APPEND package_deps opentracing-cpp)
 
 hunter_add_package(nlohmann_json)

but haven't checked whether that's sane with the jaeger static lib. The Jaeger static lib should probably not link to the opentracing static lib directly anyway; the app should be linking both.

@isaachier
Copy link
Contributor

I think I originally envisioned the user deciding whether Jaeger would be a shared lib or static lib so I wanted all dependencies to be the same. Nonetheless, I have changed my mind since then and this makes more sense so will fix it.

@isaachier
Copy link
Contributor

This can be resolved using -DHUNTER_BUILD_SHARED_LIBS=ON. See https://docs.hunter.sh/en/latest/reference/user-variables.html#hunter-build-shared-libs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants