From b4cff023374f4ebf82498eed94ae3451531c5e8f Mon Sep 17 00:00:00 2001 From: dbolduc Date: Fri, 17 Nov 2023 11:04:23 -0600 Subject: [PATCH] better workaround --- ci/cloudbuild/dockerfiles/centos-7.Dockerfile | 4 ++++ .../cloud/internal/grpc_opentelemetry_test.cc | 19 ------------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/ci/cloudbuild/dockerfiles/centos-7.Dockerfile b/ci/cloudbuild/dockerfiles/centos-7.Dockerfile index d1327be235654..a122753e2c757 100644 --- a/ci/cloudbuild/dockerfiles/centos-7.Dockerfile +++ b/ci/cloudbuild/dockerfiles/centos-7.Dockerfile @@ -164,9 +164,13 @@ RUN curl -fsSL https://github.com/google/benchmark/archive/v1.8.3.tar.gz | \ cmake --build cmake-out --target install && \ ldconfig && cd /var/tmp && rm -fr build +# We need to patch opentelemetry-cpp to work around a compiler bug in (at least) +# GCC 7.x. See https://github.com/open-telemetry/opentelemetry-cpp/issues/1014 +# for more details. WORKDIR /var/tmp/build/ RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.12.0.tar.gz | \ tar -xzf - --strip-components=1 && \ + sed -i 's/Stack &GetStack()/Stack \&GetStack() __attribute__((noinline, noclone))/' "api/include/opentelemetry/context/runtime_context.h" && \ cmake \ -DCMAKE_CXX_STANDARD=14 \ -DCMAKE_BUILD_TYPE=Release \ diff --git a/google/cloud/internal/grpc_opentelemetry_test.cc b/google/cloud/internal/grpc_opentelemetry_test.cc index 83dfbc67c1f24..9302f431aed07 100644 --- a/google/cloud/internal/grpc_opentelemetry_test.cc +++ b/google/cloud/internal/grpc_opentelemetry_test.cc @@ -13,7 +13,6 @@ // limitations under the License. #include "google/cloud/internal/grpc_opentelemetry.h" -#include "google/cloud/internal/compiler_info.h" #include "google/cloud/internal/make_status.h" #include "google/cloud/internal/trace_propagator.h" #include "google/cloud/testing_util/mock_completion_queue_impl.h" @@ -211,24 +210,6 @@ TEST(OpenTelemetry, TracedAsyncBackoffDisabled) { } TEST(OpenTelemetry, TracedAsyncBackoffPreservesContext) { - if (CompilerId() == "GNU" && CompilerVersion() == "7.3.1") { - // Skip this test because there is a compiler bug in gcc < ???, where active - // spans are not set as the parent of newly created spans. - // - // This problem exists in opentelemetry-cpp. It is outside of any types used - // in our repo. The following test reproduces the bug: - // - // @code - // auto parent = tracer->StartSpan("parent"); - // opentelemetry::trace::Scope parent_scope(parent); - // auto child = tracer->StartSpan("child"); - // child->End(); - // parent->End(); - // EXPECT_THAT(parent, IsParentOf(child)); - // @endcode - GTEST_SKIP(); - } - auto span_catcher = InstallSpanCatcher(); auto parent = MakeSpan("parent");