Skip to content

Commit

Permalink
bazel: fix opentelemetry-cpp warning (#32624)
Browse files Browse the repository at this point in the history
Fixes #32591

Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
  • Loading branch information
keith authored Feb 28, 2024
1 parent 50ed618 commit 6f76455
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
13 changes: 13 additions & 0 deletions bazel/io_opentelemetry_cpp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# TODO: Remove once https://github.com/open-telemetry/opentelemetry-cpp/issues/2556 is merged

--- a/api/include/opentelemetry/trace/span_context.h
+++ b/api/include/opentelemetry/trace/span_context.h
@@ -30,7 +30,7 @@ class SpanContext final
SpanContext(bool sampled_flag, bool is_remote) noexcept
: trace_id_(),
span_id_(),
- trace_flags_(trace::TraceFlags((uint8_t)sampled_flag)),
+ trace_flags_(trace::TraceFlags(static_cast<uint8_t>(sampled_flag))),
is_remote_(is_remote),
trace_state_(TraceState::GetDefault())
{}
6 changes: 5 additions & 1 deletion bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,11 @@ def _io_opentracing_cpp():
)

def _io_opentelemetry_api_cpp():
external_http_archive("io_opentelemetry_cpp")
external_http_archive(
name = "io_opentelemetry_cpp",
patch_args = ["-p1"],
patches = ["@envoy//bazel:io_opentelemetry_cpp.patch"],
)
native.bind(
name = "opentelemetry_api",
actual = "@io_opentelemetry_cpp//api:api",
Expand Down

0 comments on commit 6f76455

Please sign in to comment.