Skip to content

Commit

Permalink
fix compilation error with protobuf 3.5 (#1289)
Browse files Browse the repository at this point in the history
  • Loading branch information
esigo authored Mar 25, 2022
1 parent 2c9ce39 commit 91b0572
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
14 changes: 8 additions & 6 deletions docker/Dockerfile.centos
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
FROM centos:7

ARG TOOLSET_VER=11

RUN yum update -y && yum install -y centos-release-scl epel-release
RUN yum install -y devtoolset-11 \
RUN yum install -y devtoolset-${TOOLSET_VER} \
cmake3 git \
openssl-devel \
libcurl-devel \
&& source /opt/rh/devtoolset-11/enable
&& source /opt/rh/devtoolset-${TOOLSET_VER}/enable

RUN echo "source /opt/rh/devtoolset-11/enable" >> /etc/bashrc
RUN echo "source /opt/rh/devtoolset-${TOOLSET_VER}/enable" >> /etc/bashrc
RUN echo "BOOST_LIBRARYDIR=/usr/lib64/boost169" >> /etc/bashrc
RUN echo "BOOST_INCLUDEDIR=/usr/include/boost169" >> /etc/bashrc

Expand All @@ -17,7 +19,7 @@ ARG GRPC_VERSION=v1.43.2
RUN git clone --depth=1 -b $GRPC_VERSION https://github.com/grpc/grpc.git \
&& cd grpc && git submodule update --init \
&& mkdir -p "third_party/abseil-cpp/build" && cd "third_party/abseil-cpp/build" \
&& source /opt/rh/devtoolset-11/enable \
&& source /opt/rh/devtoolset-${TOOLSET_VER}/enable \
&& cmake3 -DCMAKE_CXX_STANDARD=17 -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE .. \
&& make -j${nproc} install && cd ../../.. \
&& mkdir build && cd build \
Expand All @@ -40,7 +42,7 @@ RUN yum install -y \
&& wget https://github.com/apache/thrift/archive/refs/tags/v$THRIFT_VERSION.tar.gz \
&& tar -xvf v$THRIFT_VERSION.tar.gz \
&& mkdir -p thrift-$THRIFT_VERSION/build && cd thrift-$THRIFT_VERSION/build \
&& source /opt/rh/devtoolset-11/enable \
&& source /opt/rh/devtoolset-${TOOLSET_VER}/enable \
&& export BOOST_INCLUDEDIR=/usr/include/boost169 \
&& export BOOST_LIBRARYDIR=/usr/lib64/boost169 \
&& cmake3 \
Expand All @@ -66,7 +68,7 @@ RUN yum install -y \
RUN git clone --depth=1 https://github.com/open-telemetry/opentelemetry-cpp.git \
&& cd opentelemetry-cpp && git submodule update --init \
&& mkdir -p build && cd build \
&& source /opt/rh/devtoolset-11/enable \
&& source /opt/rh/devtoolset-${TOOLSET_VER}/enable \
&& export BOOST_INCLUDEDIR=/usr/include/boost169 \
&& export BOOST_LIBRARYDIR=/usr/lib64/boost169 \
&& cmake3 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ inline const std::string GetOtlpDefaultHttpEndpoint()
return endpoint.size() ? endpoint : kOtlpEndpointDefault;
}

inline const bool GetOtlpDefaultIsSslEnable()
inline bool GetOtlpDefaultIsSslEnable()
{
constexpr char kOtlpTracesIsSslEnableEnv[] = "OTEL_EXPORTER_OTLP_TRACES_SSL_ENABLE";
constexpr char kOtlpIsSslEnableEnv[] = "OTEL_EXPORTER_OTLP_SSL_ENABLE";
Expand Down
1 change: 1 addition & 0 deletions exporters/otlp/src/otlp_http_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "google/protobuf/message.h"
#include "google/protobuf/reflection.h"
#include "google/protobuf/stubs/common.h"
#include "google/protobuf/stubs/stringpiece.h"
#include "nlohmann/json.hpp"

#if defined(GOOGLE_PROTOBUF_VERSION) && GOOGLE_PROTOBUF_VERSION >= 3007000
Expand Down

2 comments on commit 91b0572

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp sdk Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 91b0572 Previous: 2c9ce39 Ratio
BM_AlwaysOffSamplerConstruction 2.9843452013723075 ns/iter 1.4364650806542605 ns/iter 2.08
BM_AlwaysOnSamplerConstruction 3.0926627921244765 ns/iter 1.4360437367958228 ns/iter 2.15
BM_BaselineBuffer/2 9339716.43447876 ns/iter 3542239.189147949 ns/iter 2.64
BM_LockFreeBuffer/1 2905284.881591797 ns/iter 395869.838436587 ns/iter 7.34

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp api Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 91b0572 Previous: 2c9ce39 Ratio
BM_ExtractBaggageHavingTenEntries 3.879768237499005 ns/iter 1.6284719084825245 ns/iter 2.38
BM_SpanIdIsValid 5.326691212422497 ns/iter 1.7079519629041526 ns/iter 3.12

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.