Title: Attempt to use opentelemetry_api headers cause envoy build fails
Description:
I need a help regarding using opentelemetry_api in envoy project. The otel api was added in Envoy in this commit.
/source/extensions/tracers/opentelemetry has opentelemetry_api as external_deps, in opentelemetry_tracer_impl.h file I have included a otel header file as:
#include "opentelemetry/logs/provider.h"
I used to build envoy with docker-clang option, but this time it fails:
$ bazel build envoy --config=docker-clang
INFO: Analyzed target //:envoy (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
INFO: Docker sandboxing is supported
ERROR: /home/matin/envoy-build/envoy/source/extensions/tracers/opentelemetry/BUILD:14:19: Compiling source/extensions/tracers/opentelemetry/config.cc failed: (Exit 1): clang-14 failed: error executing command (from target //source/extensions/tracers/opentelemetry:config) /opt/llvm/bin/clang-14 -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer '-std=c++0x' ... (remaining 246 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from source/extensions/tracers/opentelemetry/config.cc:8:
In file included from ./source/extensions/tracers/opentelemetry/opentelemetry_tracer_impl.h:16:
In file included from bazel-out/k8-fastbuild/bin/external/io_opentelemetry_cpp/api/_virtual_includes/api/opentelemetry/trace/provider.h:11:
In file included from bazel-out/k8-fastbuild/bin/external/io_opentelemetry_cpp/api/_virtual_includes/api/opentelemetry/trace/noop.h:16:
In file included from bazel-out/k8-fastbuild/bin/external/io_opentelemetry_cpp/api/_virtual_includes/api/opentelemetry/trace/span.h:13:
bazel-out/k8-fastbuild/bin/external/io_opentelemetry_cpp/api/_virtual_includes/api/opentelemetry/trace/span_context.h:33:40: error: use of old-style cast [-Werror,-Wold-style-cast]
trace_flags_(trace::TraceFlags((uint8_t)sampled_flag)),
^ ~~~~~~~~~~~~
1 error generated.
Target //source/exe:envoy-static failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 15.400s, Critical Path: 14.38s
INFO: 4 processes: 4 internal.
FAILED: Build did NOT complete successfully
Title: Attempt to use opentelemetry_api headers cause envoy build fails
Description:
I need a help regarding using opentelemetry_api in envoy project. The otel api was added in Envoy in this commit.
/source/extensions/tracers/opentelemetryhasopentelemetry_apias external_deps, inopentelemetry_tracer_impl.hfile I have included a otel header file as:I used to build envoy with docker-clang option, but this time it fails: