-
Notifications
You must be signed in to change notification settings - Fork 558
mac shlib dependencies fixes #1891
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,8 @@ target_include_directories( | |
| set(OPENTELEMETRY_OTLP_TARGETS opentelemetry_otlp_recordable) | ||
| target_link_libraries( | ||
| opentelemetry_otlp_recordable | ||
| PUBLIC opentelemetry_trace opentelemetry_resources opentelemetry_proto) | ||
| PUBLIC opentelemetry_common opentelemetry_trace opentelemetry_resources | ||
| opentelemetry_proto) | ||
|
|
||
| if(WITH_LOGS_PREVIEW) | ||
| target_link_libraries(opentelemetry_otlp_recordable PUBLIC opentelemetry_logs) | ||
|
|
@@ -33,7 +34,8 @@ if(WITH_OTLP_GRPC) | |
| PROPERTIES EXPORT_NAME otlp_grpc_client) | ||
| target_link_libraries( | ||
| opentelemetry_exporter_otlp_grpc_client | ||
| PUBLIC opentelemetry_sdk opentelemetry_ext opentelemetry_proto) | ||
| PUBLIC opentelemetry_common opentelemetry_sdk opentelemetry_ext | ||
| opentelemetry_proto) | ||
|
|
||
| target_link_libraries(opentelemetry_exporter_otlp_grpc_client | ||
| PRIVATE gRPC::grpc++) | ||
|
|
@@ -60,8 +62,8 @@ if(WITH_OTLP_GRPC) | |
|
|
||
| target_link_libraries( | ||
| opentelemetry_exporter_otlp_grpc | ||
| PUBLIC opentelemetry_otlp_recordable | ||
| opentelemetry_exporter_otlp_grpc_client) | ||
| PUBLIC opentelemetry_otlp_recordable opentelemetry_exporter_otlp_grpc_client | ||
| PRIVATE gRPC::grpc++) | ||
|
|
||
| list(APPEND OPENTELEMETRY_OTLP_TARGETS opentelemetry_exporter_otlp_grpc) | ||
|
|
||
|
|
@@ -75,8 +77,8 @@ if(WITH_OTLP_GRPC) | |
|
|
||
| target_link_libraries( | ||
| opentelemetry_exporter_otlp_grpc_log | ||
| PUBLIC opentelemetry_otlp_recordable | ||
| opentelemetry_exporter_otlp_grpc_client) | ||
| PUBLIC opentelemetry_otlp_recordable opentelemetry_exporter_otlp_grpc_client | ||
| PRIVATE gRPC::grpc++) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we link
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @owent For the static linking: here is my understanding: when linking shared libs on linux, linker first attempts to resolve referenced symbols to one of linked in shared libraries & if that fails to one of linked in static libraries -- in a later case code from the static library is copied into the output. With that in mind, in the weird scenario of static gRPC/dynamic OTEL libraries mix, what happens is - bulk of gPRC library code is embedded into There is a potential issue if, say, both
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can not link static gRPC into more than one dynamic libraries and executable. There will be more than one copy of some global variables in gRPC and some of them will be initialized more than once and some will not be initialized for ever.So the solution is just link gRPC into one dynamic library, that is
|
||
|
|
||
| list(APPEND OPENTELEMETRY_OTLP_TARGETS opentelemetry_exporter_otlp_grpc_log) | ||
|
|
||
|
|
@@ -89,8 +91,8 @@ if(WITH_OTLP_GRPC) | |
|
|
||
| target_link_libraries( | ||
| opentelemetry_exporter_otlp_grpc_metrics | ||
| PUBLIC opentelemetry_otlp_recordable | ||
| opentelemetry_exporter_otlp_grpc_client) | ||
| PUBLIC opentelemetry_otlp_recordable opentelemetry_exporter_otlp_grpc_client | ||
| PRIVATE gRPC::grpc++) | ||
|
owent marked this conversation as resolved.
|
||
|
|
||
| list(APPEND OPENTELEMETRY_OTLP_TARGETS | ||
| opentelemetry_exporter_otlp_grpc_metrics) | ||
|
|
@@ -102,8 +104,8 @@ if(WITH_OTLP_HTTP) | |
| PROPERTIES EXPORT_NAME otlp_http_client) | ||
| target_link_libraries( | ||
| opentelemetry_exporter_otlp_http_client | ||
| PUBLIC opentelemetry_sdk opentelemetry_proto opentelemetry_http_client_curl | ||
| nlohmann_json::nlohmann_json) | ||
| PUBLIC opentelemetry_common opentelemetry_sdk opentelemetry_proto | ||
| opentelemetry_http_client_curl nlohmann_json::nlohmann_json) | ||
| if(nlohmann_json_clone) | ||
| add_dependencies(opentelemetry_exporter_otlp_http_client | ||
| nlohmann_json::nlohmann_json) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.