-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
cmake fail if enable DBUILD_OPTEL but disable DBUILD_OPTEL_OTLP_BENCHMARKS #3213
Comments
I've opened a PR for this, but im considering closing it now that I'm thinking about it more. The SDK interface does not require the json dependency. The sample only requires json because it uses the HTTP exporter. i.e. from open telemetry dependency page json is required for only the otlp/http exporter. When we build the SDK with If you are using the HTTP/OTLP exporter in your client code you should call heres an example dockerfile with it working as expected # Use the latest AL2022 image
FROM public.ecr.aws/amazonlinux/amazonlinux:2023
# Install dev tools
RUN yum groupinstall -y 'Development Tools' && \
yum install -y ninja-build cmake3 curl-devel openssl-devel
# Install otel
RUN git clone -b v1.18.0 https://github.com/open-telemetry/opentelemetry-cpp.git && \
cd opentelemetry-cpp && \
mkdir build && \
cd build && \
cmake3 -DCMAKE_CXX_STANDARD=14 -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON .. && \
cmake3 --build . && \
cmake3 --install .
# Build SDK
RUN git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp && \
cd aws-sdk-cpp && \
mkdir build && \
cd build && \
cmake3 -DCMAKE_CXX_STANDARD=14 -DBUILD_OPTEL=ON -DBUILD_OPTEL_OTLP_BENCHMARKS=OFF -DBUILD_ONLY="s3" -DAUTORUN_UNIT_TESTS=OFF .. && \
cmake3 --build . && \
cmake3 --install . Since we dont actually require the dependency to build the SDK, im against putting it as a dependency. |
When awssdk/opentelemetry-cpp/nlohmann_json all as extrenal project like this https://github.com/chuandew/dingofs/blob/add_opentele/third-party/CMakeLists.txt |
we are only dependent on the SDK and API, they do not have a If you plan on using dependencies that require The cmake error you post is a trace from the open telemetry projects cmake, not the SDK's. we are not responsible for finding a dependency that we are not dependent on. please remove us as being dependent nlohmann_json. We only happen to find it for our example, whoever is actually dependent it is responsible for calling |
Describe the bug
when I set BUILD_OPTEL=ON and BUILD_OPTEL_OTLP_BENCHMARKS=OFF, cmake configure fail
Regression Issue
Expected Behavior
when I set BUILD_OPTEL=ON and BUILD_OPTEL_OTLP_BENCHMARKS=OFF, cmake configure should success.
Current Behavior
cmake -DCMAKE_PREFIX_PATH=/home/chuande/workspace/dingofs/third-party/installed -DBUILD_OPTEL=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_TESTING=OFF -DAUTORUN_UNIT_TESTS=OFF -DBUILD_ONLY=s3 -DBUILD_OPTEL=ON -DBUILD_OPTEL_OTLP_BENCHMARKS=OFF ..
cmake -DCMAKE_PREFIX_PATH=/home/chuande/workspace/dingofs/third-party/installed -DBUILD_OPTEL=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_TESTING=OFF -DAUTORUN_UNIT_TESTS=OFF -DBUILD_ONLY=s3 -DBUILD_OPTEL=ON -DBUILD_OPTEL_OTLP_BENCHMARKS=ON ..
Reproduction Steps
In build dir run
Possible Solution
In external_dependencies.cmake,if BUILD_OPTEL enable, call
find_package(nlohmann_json REQUIRED)
Additional Information/Context
No response
AWS CPP SDK version used
1.11.399
Compiler and Version used
gcc (GCC) 13.1.1 20230614 (Red Hat 13.1.1-4) Copyright (C) 2023 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
Operating System and version
Rocky Linux release 8.9 (Green Obsidian)
The text was updated successfully, but these errors were encountered: