opentelemetry-cpp
opentelemetry-cpp copied to clipboard
Issues compiling opentelemetry-cpp with Jaeger on Ubuntu 20.04 and 21.04 finding thrift
Describe your environment Ubuntu 20.04 (WSL) and 21.04 on a Virtual Machine
Steps to reproduce Build opentelemetry-cpp with the following CMAKE flags: -G "Ninja" -DCMAKE_TOOLCHAIN_FILE=${HOME}/alphadev/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DWITH_JAEGER=ON -DWITH_PROMETHEUS=OFF -DBUILD_TESTING=OFF -DJSON_Install=ON -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++
What is the expected behavior? Clean compile.
What is the actual behavior? Command error: Using external nlohmann::json Building with nostd types... CMake Error at exporters/jaeger/CMakeLists.txt:3 (find_package): asked CMake to find a package configuration file provided by "Thrift", but CMake did not find one. By not providing "FindThrift.cmake" in CMAKE_MODULE_PATH this project has Could not find a package configuration file provided by "Thrift" with any of the following names: ThriftConfig.cmake thrift-config.cmake Add the installation prefix of "Thrift" to CMAKE_PREFIX_PATH or set "Thrift_DIR" to a directory containing one of the above files. If "Thrift" provides a separate development package or SDK, be sure it has been installed.
Additional context
thrift is installed using vcpkg.
This is working on Windows, but fails on Linux.
It is probably something I have set wrong, but the upper case T at the beginning of Thrift made me wonder. since the package installs as "thrift".
Output of vcpkg list: thrift:x64-linux 0.13.0 Apache Thrift is a software project spanning a v...
vcpkg
toolchain configuration using CMAKE_TOOLCHAIN_FILE
is only supported for Windows. For Linux platforms, dependency should be already met externally before building opentelemetry-cpp.
Removing bug
label as this is expected behavior. Though this can be documented in Jagger Readme.md
.
By way of feedback, the sheer number of tools and configuration issues we have encountered in trying to build opentelemetry-cpp (and now adding the Jaeger collector), is somewhat overwhelming. Building across platforms (Win32, Win64, Linux-x64) has required that we literally create a meta-build system to get everything in place; and then we can think about building our own code.
We started using a purely CMake build script for our project, but quickly found that we needed Ninja, vcpkg (for some Linux packages too), Git modules and a whole host of nested project dependencies that never seem to work the first time because of some new build or packaging system.
While this is partly an open source ecosystem problem, having "yet another build and/or packaging system" has made a mess of the build process. gRPC has similar issues. They recommend using CMAKE's FetchContent_xxxx macros, but they fail on Abseil.
I would encourage a project-wide review of what it takes to build opentelemetry-cpp on each target from scratch, including dependencies; especially since it is early enough not to break existing installations. The CI/CD process is going to be quite painful for new adopters like us.
$0.02
@Kurt-Rayner-Alpha thanks for your feedback on the difficulty of managing dependence, this is a good topic for us to discuss.
Meanwhile, could you please try below file to install thrift on your Linux build machine?
https://github.com/open-telemetry/opentelemetry-cpp/blob/main/ci/setup_thrift.sh
Thanks Tom!
The script does install the needed requisites (most, if not all, of which were already installed) and build Thrift, so we are further.
Running CMake on opentelemetry-cpp still doesn’t find thrift.
It could still be something in my scripting. I’ll continue to look at it.
Thanks again!
Kurt
From: Tom Tan @.*** Sent: Tuesday, July 6, 2021 3:48 PM To: open-telemetry/opentelemetry-cpp Cc: Kurt-Rayner-Alpha; Mention Subject: Re: [open-telemetry/opentelemetry-cpp] Issues compiling opentelemetry-cpp with Jaeger on Ubuntu 20.04 and 21.04 finding thrift (#889)
@Kurt-Rayner-Alpha https://github.com/Kurt-Rayner-Alpha thanks for your feedback on the difficulty of managing dependence, this is a good topic for us to discuss.
Meanwhile, could you please try below file to install thrift on your Linux build machine?
https://github.com/open-telemetry/opentelemetry-cpp/blob/main/ci/setup_thrift.sh
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/open-telemetry/opentelemetry-cpp/issues/889#issuecomment-875035951 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN3GCNI5FTWPNL24J57QNTTWNMYHANCNFSM47XFKRXA . https://github.com/notifications/beacon/AAN3GCKTSXPWA6PR6WNLUF3TWNMYHA5CNFSM47XFKRXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGQT72LY.gif
It could still be something in my scripting. I’ll continue to look at it.
Thanks @Kurt-Rayner-Alpha . Seems we would need your help in troubleshooting, as I tested it locally on Linux, and cmake toolchain works fine after installing the thrift
package through vcpkg
root@513454c370ae:/opentelemetry-cpp/build# cmake .. -DWITH_JAEGER=ON -DBUILD_TESTING=OFF -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake ..
-- Building for architecture ARCH=x64
Using local nlohmann::json from submodule
-- Using the single-header code from /opentelemetry-cpp/third_party/nlohmann-json/single_include/
Building with nostd types...
/vcpkg/scripts/buildsystems/vcpkg.cmake
-- Found thrift: /vcpkg/installed/x64-linux
-- Configuring done
-- Generating done
-- Build files have been written to: /opentelemetry-cpp/build
root@513454c370ae:/opentelemetry-cpp/build#
root@513454c370ae:/opentelemetry-cpp/build#
root@513454c370ae:/opentelemetry-cpp/build#
root@513454c370ae:/opentelemetry-cpp/build#
root@513454c370ae:/opentelemetry-cpp/build#
root@513454c370ae:/opentelemetry-cpp/build#
root@513454c370ae:/opentelemetry-cpp/build# cmake .. -DWITH_JAEGER=ON -DBUILD_TESTING=OFF ..
-- Building for architecture ARCH=x64
Using local nlohmann::json from submodule
-- Using the single-header code from /opentelemetry-cpp/third_party/nlohmann-json/single_include/
Building with nostd types...
-- Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)
CMake Error at exporters/jaeger/CMakeLists.txt:3 (find_package):
Could not find a package configuration file provided by "Thrift" with any
of the following names:
ThriftConfig.cmake
thrift-config.cmake
Add the installation prefix of "Thrift" to CMAKE_PREFIX_PATH or set
"Thrift_DIR" to a directory containing one of the above files. If "Thrift"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!
See also "/opentelemetry-cpp/build/CMakeFiles/CMakeOutput.log".
See also "/opentelemetry-cpp/build/CMakeFiles/CMakeError.log".
root@513454c370ae:/opentelemetry-cpp/build#
@Kurt-Rayner-Alpha - Did you find anything further on this, as this is not reproducible for us locally ?
Hi,
Sorry for the delay in getting back to you, I’ve been off working on other projects.
Since upgrading Linux, I am now running into issues rebuilding nlohmann_json. I believe (based on searches) it is related to a Python dependency on libssl 1.0.0; which of course is ancient. Not absolutely sure. I get the message “no uesable version of libssl”
The thrift setup script seems to work, but now opentelemetry-cpp doesn’t build on Linux because it can’t find nlohmann_json again.
I think that to reproduce the issues you would have to start with a clean machine running Ubuntu 20.04 or 21.04 and walk through adding components – a big part of my project – as we are scripting configurations for dynamic cross-platform build machines (Windows or Linux).
We need to work through the issues on Linux once again (Windows is building fine right now). Unraveling all of the threads is quite tedious.
Best,
Kurt
From: Lalit Kumar Bhasin @.*** Sent: Tuesday, July 20, 2021 3:04 AM To: open-telemetry/opentelemetry-cpp Cc: Kurt-Rayner-Alpha; Mention Subject: Re: [open-telemetry/opentelemetry-cpp] Issues compiling opentelemetry-cpp with Jaeger on Ubuntu 20.04 and 21.04 finding thrift (#889)
@Kurt-Rayner-Alpha https://github.com/Kurt-Rayner-Alpha - Did you find anything further on this, as this is not reproducible for us locally ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/open-telemetry/opentelemetry-cpp/issues/889#issuecomment-883147413 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN3GCINL43B74FN3X5DXOLTYUNWZANCNFSM47XFKRXA . https://github.com/notifications/beacon/AAN3GCP74DDA5KCAH4D5F4DTYUNWZA5CNFSM47XFKRXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGSR4FFI.gif
This issue was marked as stale due to lack of activity. It will be closed in 7 days.
Closed as inactive. Feel free to reopen if this is still an issue.
FYI, had the same issue when trying to use opentelemetry-cpp as a submodule, and manage to circumvent by setting in my CMakeLists set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/opentelemetry-cpp/cmake/modules)
I'm not sure but it's possible that calling mark_as_advanced(CMAKE_TOOLCHAIN_FILE)
in the root CMakeLists make impossible to go into the if-branch that is suppose to set cmake module path
This issue was marked as stale due to lack of activity. It will be closed in 7 days if no furthur activity occurs.
This issue was marked as stale due to lack of activity. It will be closed in 7 days if no furthur activity occurs.
The Jaeger exporter is now deprecated, and is to be removed, see #1938
Closing this issue.