Skip to content

Commit

Permalink
fix compilation error with protobuf 3.5 (open-telemetry#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

0 comments on commit 91b0572

Please sign in to comment.