opentelemetry-cpp-contrib
opentelemetry-cpp-contrib copied to clipboard
CMake Warning at /usr/lib/cmake/grpc/modules/Findre2.cmake:64
Describe your environment Describe any aspect of your environment relevant to the problem, including your platform, build system, version numbers of installed dependencies, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on main branch.
- This is related to https://github.com/kubernetes/ingress-nginx/issues/8381
- This problem blocked our attempt at building a new base image for the ingress-nginx project
- As mentioned, building opentelemetry with alpine:3.14.X works but failed with alpine:3.15.X .
Steps to reproduce
- clone https://github.com/kubernetes/ingress-nginx/
- Run
cd /images/opentelemetry/rootfs - run
docker build -t myimage .
What is the expected behavior?
- build should succeed
What is the actual behavior?
- build fails
Additional context
- The linked issue has the details
Hi @longwuyuan thanks for reaching out to us. Any reason for not installing re2?
I could get the build working by installing re2 and re2-dev.
You may consider upgrading to the latest version of opentelemetry 1.2.0.
Also clone was slow, you may consider using
git clone --branch v$OPENTELEMETRY_CPP_VERSION --depth=1 --recursive https://github.com/open-telemetry/opentelemetry-cpp opentelemetry-cpp-$OPENTELEMETRY_CPP_VERSION
@esigo thanks a lot. I added re2 and re2-dev to the apk add command in build.sh and that error was resolved.
However I am curious you had a working build. I get below error when I run docker build -t my image . ;
...
...
#9 151.2 nginx http fastcgi temporary files: "fastcgi_temp"
#9 151.2 nginx http uwsgi temporary files: "uwsgi_temp"
#9 151.2 nginx http scgi temporary files: "scgi_temp"
#9 151.2
#9 151.2 make -f objs/Makefile modules
#9 151.2 make[1]: Entering directory '/tmp/build/nginx-1.19.10'
#9 151.2 cc -c -fPIC -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
#9 151.2 -o objs/addon/src/agent_config.o \
#9 151.2 /tmp/build/opentelemetry-cpp-contrib-f48500884b1b32efc456790bbcdc2e6cf7a8e630/instrumentation/nginx/src/agent_config.cpp
#9 151.2 cc -c -fPIC -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
#9 151.2 -o objs/addon/src/nginx_config.o \
#9 151.2 /tmp/build/opentelemetry-cpp-contrib-f48500884b1b32efc456790bbcdc2e6cf7a8e630/instrumentation/nginx/src/nginx_config.cpp
#9 151.3 cc -c -fPIC -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
#9 151.3 -o objs/addon/src/otel_ngx_module.o \
#9 151.3 /tmp/build/opentelemetry-cpp-contrib-f48500884b1b32efc456790bbcdc2e6cf7a8e630/instrumentation/nginx/src/otel_ngx_module.cpp
#9 151.7 cc -c -fPIC -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
#9 151.7 -o objs/addon/src/propagate.o \
#9 151.7 /tmp/build/opentelemetry-cpp-contrib-f48500884b1b32efc456790bbcdc2e6cf7a8e630/instrumentation/nginx/src/propagate.cpp
#9 153.4 In file included from /usr/include/absl/synchronization/mutex.h:73,
#9 153.4 from /usr/include/grpcpp/impl/codegen/sync.h:32,
#9 153.4 from /usr/include/grpcpp/impl/codegen/client_context.h:55,
#9 153.4 from /usr/include/grpcpp/impl/codegen/call_op_set.h:34,
#9 153.4 from /usr/include/grpcpp/impl/codegen/server_context.h:35,
#9 153.4 from /usr/include/grpcpp/impl/codegen/async_stream.h:26,
#9 153.4 from /usr/include/grpcpp/impl/codegen/async_generic_service.h:26,
#9 153.4 from /usr/local/include/opentelemetry/proto/collector/trace/v1/trace_service.grpc.pb.h:25,
#9 153.4 from /usr/local/include/opentelemetry/exporters/otlp/otlp_grpc_exporter.h:11,
#9 153.4 from /tmp/build/opentelemetry-cpp-contrib-f48500884b1b32efc456790bbcdc2e6cf7a8e630/instrumentation/nginx/src/otel_ngx_module.cpp:21:
#9 153.4 /usr/include/absl/synchronization/internal/per_thread_sem.h:84:10: error: reference to 'base_internal' is ambiguous
#9 153.4 84 | friend absl::base_internal::ThreadIdentity* CreateThreadIdentity();
#9 153.4 | ^~~~
...
...
Looks like the alpine 3.15 package repository comes with a newer abseil library. This can be causing conflict between the abseil library used internally in opentelemetry-cpp sdk and one coming from the repository. This can be resolved by changing the order of header includes in nginx instrumentation as described here.
As this change would be required in nginx instrumentation, would let @seemk to further reply on that :)
Thanks @lalitb , will wait for @seemk comments
@longwuyuan Just to add, if you don't want to wait for fix in nginx instrumentation, the alternate solution would be to build opentelemetry-cpp using externally installed abseil library. This can be achieved by adding -DWITH_ABSEIL=ON cmake option in opentelemetry-cpp build here.
@lalitb thank you very much for the update. We have, for now, used alpine v3.14.4 to release ingress-nginx-controller v1.1.3, to get the openssl & libxml CVE patches.
After this activity settles, I expect that an attempt at moving to alpine v3.15.X+ will occur in near future .
@dmathieu is working on https://github.com/kubernetes/ingress-nginx/pull/7621 so tagging here @rikatz
All done by "@esigo" in ingress-nginx