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

[BUILD] Old style cast warnings in opentelemetry_api headers #2556

Closed
shiponcs opened this issue Feb 27, 2024 · 2 comments · Fixed by #2567 or malkia/opentelemetry-cpp#13
Closed

[BUILD] Old style cast warnings in opentelemetry_api headers #2556

shiponcs opened this issue Feb 27, 2024 · 2 comments · Fixed by #2567 or malkia/opentelemetry-cpp#13
Labels
bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@shiponcs
Copy link

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
@shiponcs shiponcs added the bug Something isn't working label Feb 27, 2024
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Feb 27, 2024
@keith
Copy link
Contributor

keith commented Feb 28, 2024

i submitted #2567 for this

@marcalff marcalff changed the title Attempt to use opentelemetry_api headers in Envoy project cause build fails [BUILD] Old style cast warnings in opentelemetry_api headers Feb 28, 2024
@marcalff marcalff added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 28, 2024
marcalff pushed a commit that referenced this issue Feb 28, 2024
@tamalsaha
Copy link

Thanks @keith ! Such quick response is much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
4 participants