Skip to content
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

[v1.5.0] Can not build with external dependency package manager. #1538

Closed
owent opened this issue Aug 2, 2022 · 0 comments · Fixed by #1539
Closed

[v1.5.0] Can not build with external dependency package manager. #1538

owent opened this issue Aug 2, 2022 · 0 comments · Fixed by #1539
Labels
bug Something isn't working

Comments

@owent
Copy link
Member

owent commented Aug 2, 2022

Version: v1.5.0

Case 1: Using abseil-cpp 20211102.0 with std::variant

Compiler: GCC 8.4.1
OS: CentOS 8

D:\a\cmake-toolset\cmake-toolset\test\third_party\packages\opentelemetry-cpp-v1.5.0\exporters\otlp\src\otlp_http_client.cc: In member function 'opentelemetry::v1::nostd::variant<opentelemetry::v1::sdk::common::ExportResult, opentelemetry::v1::exporter::otlp::OtlpHttpClient::HttpSessionData> opentelemetry::v1::exporter::otlp::OtlpHttpClient::createSession(const google::protobuf::Message&, std::function<bool(opentelemetry::v1::sdk::common::ExportResult)>&&)':
D:\a\cmake-toolset\cmake-toolset\test\third_party\packages\opentelemetry-cpp-v1.5.0\exporters\otlp\src\otlp_http_client.cc:942:10: error: could not convert 'opentelemetry::v1::exporter::otlp::OtlpHttpClient::HttpSessionData((* & std::move<shared_ptr<opentelemetry::v1::ext::http::client::Session>&>(session)), std::shared_ptr<opentelemetry::v1::ext::http::client::EventHandler>((operator new(112), ((true, (((opentelemetry::v1::exporter::otlp::{anonymous}::ResponseHandler*)<anonymous>)->opentelemetry::v1::exporter::otlp::{anonymous}::ResponseHandler::ResponseHandler((* & std::move<function<bool(opentelemetry::v1::sdk::common::ExportResult)>&>((* & result_callback))), ((int)((bool)((opentelemetry::v1::exporter::otlp::OtlpHttpClient*)this)->opentelemetry::v1::exporter::otlp::OtlpHttpClient::options_.opentelemetry::v1::exporter::otlp::OtlpHttpClientOptions::console_debug))), (<anonymous> = false))), ((opentelemetry::v1::exporter::otlp::{anonymous}::ResponseHandler*)<anonymous>)))))' from 'opentelemetry::v1::exporter::otlp::OtlpHttpClient::HttpSessionData' to 'opentelemetry::v1::nostd::variant<opentelemetry::v1::sdk::common::ExportResult, opentelemetry::v1::exporter::otlp::OtlpHttpClient::HttpSessionData>' {aka 'std::variant<opentelemetry::v1::sdk::common::ExportResult, opentelemetry::v1::exporter::otlp::OtlpHttpClient::HttpSessionData>'}
  942 |   return HttpSessionData{
      |          ^~~~~~~~~~~~~~~~
      |          |
      |          opentelemetry::v1::exporter::otlp::OtlpHttpClient::HttpSessionData
  943 |       std::move(session),
      |       ~~~~~~~~~~~~~~~~~~~
  944 |       std::shared_ptr<opentelemetry::ext::http::client::EventHandler>{
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  945 |           new ResponseHandler(std::move(result_callback), options_.console_debug)}};
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mingw32-make[2]: *** [exporters\otlp\CMakeFiles\opentelemetry_exporter_otlp_http_client.dir\build.make:76: exporters/otlp/CMakeFiles/opentelemetry_exporter_otlp_http_client.dir/src/otlp_http_client.cc.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:786: exporters/otlp/CMakeFiles/opentelemetry_exporter_otlp_http_client.dir/all] Error 2
mingw32-make: *** [Makefile:135: all] Error 2
-- Could NOT find opentelemetry-cpp (missing: opentelemetry-cpp_DIR)
CMake Error at D:/a/cmake-toolset/cmake-toolset/ports/telemetry/opentelemetry-cpp.cmake:385 (message):
  Dependency(cmake-toolset-test): Build opentelemetry-cpp failed.
Call Stack (most recent call first):
  CMakeLists.txt:171 (include)

Case 2: Enable new metrics SDK and prometheus exporter

Compiler: GCC 4.8 & GCC 8.4.1
OS: Ubuntu 18.04 & CentOS 8

  [ 91%] Building CXX object exporters/prometheus/CMakeFiles/prometheus_exporter.dir/src/collector.cc.o
/home/runner/work/cmake-toolset/cmake-toolset/test/third_party/packages/opentelemetry-cpp-v1.5.0/exporters/prometheus/src/collector.cc: In member function ‘void opentelemetry::v1::exporter::metrics::PrometheusCollector::AddMetricData(const opentelemetry::v1::sdk::metrics::ResourceMetrics&)’:
/home/runner/work/cmake-toolset/cmake-toolset/test/third_party/packages/opentelemetry-cpp-v1.5.0/exporters/prometheus/src/collector.cc:61:76: error: cannot convert ‘const opentelemetry::v1::sdk::metrics::ResourceMetrics’ to ‘const opentelemetry::v1::sdk::resource::Resource*’ in initialization
     metrics_to_collect_.emplace_back(new sdk::metrics::ResourceMetrics{data});
                                                                            ^
make[2]: *** [exporters/prometheus/CMakeFiles/prometheus_exporter.dir/src/collector.cc.o] Error 1

See https://github.com/atframework/cmake-toolset/runs/7624862850 for details.

Case 3: Using standalone external libcurl(curl in installed in a pat different from other dependencies)

Compiler: GCC 8.4.1
OS: CentOS 8

[ 99%] Building CXX object exporters/elasticsearch/CMakeFiles/opentelemetry_exporter_elasticsearch_logs.dir/src/es_log_exporter.cc.o
In file included from /data/home/owent/workspace/atframework/cmake-toolset/test/third_party/packages/opentelemetry-cpp-v1.5.0/ext/include/opentelemetry/ext/http/client/curl/http_client_curl.h:6,
                 from /data/home/owent/workspace/atframework/cmake-toolset/test/third_party/packages/opentelemetry-cpp-v1.5.0/exporters/elasticsearch/include/opentelemetry/exporters/elasticsearch/es_log_exporter.h:9,
                 from /data/home/owent/workspace/atframework/cmake-toolset/test/third_party/packages/opentelemetry-cpp-v1.5.0/exporters/elasticsearch/src/es_log_exporter.cc:9:
/data/home/owent/workspace/atframework/cmake-toolset/test/third_party/packages/opentelemetry-cpp-v1.5.0/ext/include/opentelemetry/ext/http/client/curl/http_operation_curl.h:23:10: fatal error: curl/curl.h: No such file or directory
 #include <curl/curl.h>
          ^~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [exporters/elasticsearch/CMakeFiles/opentelemetry_exporter_elasticsearch_logs.dir/build.make:76: exporters/elasticsearch/CMakeFiles/opentelemetry_exporter_elasticsearch_logs.dir/src/es_log_exporter.cc.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1096: exporters/elasticsearch/CMakeFiles/opentelemetry_exporter_elasticsearch_logs.dir/all] Error 2

Case 4: Linking error with new metrics SDK and OTLP exporter

Compiler: GCC 8.4.1
OS: CentOS 8

Consolidate compiler generated dependencies of target cmake-toolset-test
[  5%] Linking CXX executable bin/cmake-toolset-test
/usr/bin/ld: ../third_party/install/linux-x86_64-gnu/lib64/libopentelemetry_exporter_otlp_grpc_metrics.so: undefined reference to `opentelemetry::v1::exporter::otlp::OtlpGrpcMetricExporter::isShutdown() const'
/usr/bin/ld: ../third_party/install/linux-x86_64-gnu/lib64/libopentelemetry_exporter_otlp_grpc_metrics.so: undefined reference to `opentelemetry::v1::exporter::otlp::OtlpGrpcMetricExporter::ForceFlush(std::chrono::duration<long, std::ratio<1l, 1000000l> >)'
/usr/bin/ld: ../third_party/install/linux-x86_64-gnu/lib64/libopentelemetry_exporter_otlp_grpc_metrics.so: undefined reference to `opentelemetry::v1::exporter::otlp::OtlpGrpcMetricExporter::Shutdown(std::chrono::duration<long, std::ratio<1l, 1000000l> >)'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/cmake-toolset-test.dir/build.make:232: bin/cmake-toolset-test] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:106: CMakeFiles/cmake-toolset-test.dir/all] Error 2
gmake: *** [Makefile:101: all] Error 2
[owent@VM-144-59-centos cmake-toolset]$ 
@owent owent added the bug Something isn't working label Aug 2, 2022
@owent owent changed the title Can not build with external dependency package manager. [v1.5.0] Can not build with external dependency package manager. Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant