facebook / mcrouter

Mcrouter is a memcached protocol router for scaling memcached deployments.
MIT License
3.26k stars 535 forks source link

std::string facebook::memcache::thrift::McGatsReply::message' is private within this context #364

Open cello86 opened 3 years ago

cello86 commented 3 years ago

Hi all, we tried to compile the latest version of mcrouter on a CentOS 7.9 VM and we compiled all the dependencies, but we found this error during the make action:

In file included from ../../mcrouter/lib/Reply.h:16:0,
                 from FailoverErrorsSettingsBase.h:16,
                 from FailoverErrorsSettingsBase.cpp:8:
../../mcrouter/lib/network/gen/MemcacheMessages.h: In member function 'const string& facebook::memcache::McGatsReply::message() const':
../../mcrouter/lib/network/gen/MemcacheMessages.h:3529:36: error: 'std::string facebook::memcache::thrift::McGatsReply::message' is private within this context
     return underlyingThriftStruct_.message;
                                    ^~~~~~~
In file included from ../../mcrouter/lib/network/gen/MemcacheMessages.h:33:0,
                 from ../../mcrouter/lib/Reply.h:16,
                 from FailoverErrorsSettingsBase.h:16,
                 from FailoverErrorsSettingsBase.cpp:8:
../../mcrouter/lib/network/gen/gen-cpp2/Memcache_types.h:8952:17: note: declared private here
   ::std::string message;
                 ^~~~~~~
In file included from ../../mcrouter/lib/Reply.h:16:0,
                 from FailoverErrorsSettingsBase.h:16,
                 from FailoverErrorsSettingsBase.cpp:8:
../../mcrouter/lib/network/gen/MemcacheMessages.h: In member function 'std::string& facebook::memcache::McGatsReply::message()':
../../mcrouter/lib/network/gen/MemcacheMessages.h:3532:36: error: 'std::string facebook::memcache::thrift::McGatsReply::message' is private within this context
     return underlyingThriftStruct_.message;
                                    ^~~~~~~

Could someone help us to sort the issue?

Thanks, Marcello

mszabo-wikia commented 3 years ago

What version of mcrouter and fbthrift are you compiling? You may be trying to compile mcrouter with an incompatible fbthrift version.

cello86 commented 3 years ago

@mszabo-wikia I'm using:

ARG GFLAGS_VERSION=2.2.2 ARG GLOG_VERSION=0.4.0 ARG FMT_VERSION=7.1.3 ARG BOOST_VERSION=1_65_1 ARG LIBSODIUM_VERSION=1.0.18 ARG FOLLY_VERSION=2019.11.04.00 ARG FIZZ_VERSION=2019.11.04.00 ARG WANGLE_VERSION=2019.11.04.00 ARG RSOCKET_CPP_VERSION=2021.02.08.00 ARG FBTHRIFT_VERSION=2019.11.04.00 ARG MCROUTER_VERSION=0.41.0

prabusd7 commented 3 years ago

Hi, Any update on this. I am facing an similar issue too.

andrejusc commented 3 years ago

Hi, I've tried with multiple dependencies from Sep 13th, but still same issue. Any plans to address it soon?

Seems to be within some generated code, so maybe some extra switch/option required to workaround in the meantime?

cello86 commented 2 years ago

HI @andrejusc could you provide the specific version used?

Thanks, Marcello

andrejusc commented 2 years ago

Hi @cello86 - at the date of that failure I was downloading such archives:

wget https://github.com/facebook/mcrouter/archive/refs/tags/v0.41.0-release.tar.gz
wget https://github.com/facebook/fbthrift/archive/refs/tags/v2021.09.13.00.tar.gz
wget https://github.com/facebook/folly/releases/download/v2021.09.13.00/folly-v2021.09.13.00.tar.gz
wget https://github.com/facebook/folly/archive/refs/tags/v2021.09.13.00.tar.gz
wget https://github.com/fmtlib/fmt/archive/refs/tags/8.0.1.tar.gz
wget https://github.com/facebookincubator/fizz/archive/refs/tags/v2021.09.13.00.tar.gz
wget https://github.com/facebook/wangle/archive/refs/tags/v2021.09.13.00.tar.gz

Hopefully that is helpful till some extent. But please let me know if you need any other lib/dependency for that set - I may still have some box with that somewhere.

cello86 commented 2 years ago

@andrejusc I tried to compile with the version provide but I had these errors:

/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp: In member function 'folly::symbolizer::detail::Attribute folly::symbolizer::Dwarf::readAttribute(const folly::symbolizer::detail::CompilationUnit&, const folly::symbolizer::detail::Die&, folly::symbolizer::detail::AttributeSpec, folly::StringPiece&) const':
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:954:10: error: 'DW_FORM_implicit_const' was not declared in this scope
     case DW_FORM_implicit_const: // form is explicitly specified
          ^~~~~~~~~~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:954:10: note: suggested alternative: 'DW_OP_implicit_value'
     case DW_FORM_implicit_const: // form is explicitly specified
          ^~~~~~~~~~~~~~~~~~~~~~
          DW_OP_implicit_value
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:961:10: error: 'DW_FORM_addrx' was not declared in this scope
     case DW_FORM_addrx:
          ^~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:961:10: note: suggested alternative: 'DW_FORM_addr'
     case DW_FORM_addrx:
          ^~~~~~~~~~~~~
          DW_FORM_addr
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:963:10: error: 'DW_FORM_addrx1' was not declared in this scope
     case DW_FORM_addrx1:
          ^~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:963:10: note: suggested alternative: 'DW_FORM_addr'
     case DW_FORM_addrx1:
          ^~~~~~~~~~~~~~
          DW_FORM_addr
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:965:10: error: 'DW_FORM_addrx2' was not declared in this scope
     case DW_FORM_addrx2:
          ^~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:965:10: note: suggested alternative: 'DW_FORM_addr'
     case DW_FORM_addrx2:
          ^~~~~~~~~~~~~~
          DW_FORM_addr
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:967:10: error: 'DW_FORM_addrx3' was not declared in this scope
     case DW_FORM_addrx3:
          ^~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:967:10: note: suggested alternative: 'DW_FORM_addr'
     case DW_FORM_addrx3:
          ^~~~~~~~~~~~~~
          DW_FORM_addr
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:969:10: error: 'DW_FORM_addrx4' was not declared in this scope
     case DW_FORM_addrx4:
          ^~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:969:10: note: suggested alternative: 'DW_FORM_addr'
     case DW_FORM_addrx4:
          ^~~~~~~~~~~~~~
          DW_FORM_addr
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:972:10: error: 'DW_FORM_line_strp' was not declared in this scope
     case DW_FORM_line_strp:
          ^~~~~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:972:10: note: suggested alternative: 'DW_FORM_strp'
     case DW_FORM_line_strp:
          ^~~~~~~~~~~~~~~~~
          DW_FORM_strp
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:979:10: error: 'DW_FORM_strx' was not declared in this scope
     case DW_FORM_strx:
          ^~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:979:10: note: suggested alternative: 'DW_FORM_strp'
     case DW_FORM_strx:
          ^~~~~~~~~~~~
          DW_FORM_strp
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:981:10: error: 'DW_FORM_strx1' was not declared in this scope
     case DW_FORM_strx1:
          ^~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:981:10: note: suggested alternative: 'DW_FORM_strp'
     case DW_FORM_strx1:
          ^~~~~~~~~~~~~
          DW_FORM_strp
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:983:10: error: 'DW_FORM_strx2' was not declared in this scope
     case DW_FORM_strx2:
          ^~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:983:10: note: suggested alternative: 'DW_FORM_strp'
     case DW_FORM_strx2:
          ^~~~~~~~~~~~~
          DW_FORM_strp
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:985:10: error: 'DW_FORM_strx3' was not declared in this scope
     case DW_FORM_strx3:
          ^~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:985:10: note: suggested alternative: 'DW_FORM_strp'
     case DW_FORM_strx3:
          ^~~~~~~~~~~~~
          DW_FORM_strp
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:987:10: error: 'DW_FORM_strx4' was not declared in this scope
     case DW_FORM_strx4:
          ^~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:987:10: note: suggested alternative: 'DW_FORM_strp'
     case DW_FORM_strx4:
          ^~~~~~~~~~~~~
          DW_FORM_strp
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:990:10: error: 'DW_FORM_rnglistx' was not declared in this scope
     case DW_FORM_rnglistx: {
          ^~~~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:990:10: note: suggested alternative: 'DW_FORM_ref1'
     case DW_FORM_rnglistx: {
          ^~~~~~~~~~~~~~~~
          DW_FORM_ref1
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1002:10: error: 'DW_FORM_loclistx' was not declared in this scope
     case DW_FORM_loclistx: {
          ^~~~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1002:10: note: suggested alternative: 'DW_FORM_block1'
     case DW_FORM_loclistx: {
          ^~~~~~~~~~~~~~~~
          DW_FORM_block1
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1014:10: error: 'DW_FORM_data16' was not declared in this scope
     case DW_FORM_data16:
          ^~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1014:10: note: suggested alternative: 'DW_FORM_data1'
     case DW_FORM_data16:
          ^~~~~~~~~~~~~~
          DW_FORM_data1
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1017:10: error: 'DW_FORM_ref_sup4' was not declared in this scope
     case DW_FORM_ref_sup4:
          ^~~~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1017:10: note: suggested alternative: 'DW_FORM_ref_sig8'
     case DW_FORM_ref_sup4:
          ^~~~~~~~~~~~~~~~
          DW_FORM_ref_sig8
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1018:10: error: 'DW_FORM_ref_sup8' was not declared in this scope
     case DW_FORM_ref_sup8:
          ^~~~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1018:10: note: suggested alternative: 'DW_FORM_ref_sig8'
     case DW_FORM_ref_sup8:
          ^~~~~~~~~~~~~~~~
          DW_FORM_ref_sig8
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1019:10: error: 'DW_FORM_strp_sup' was not declared in this scope
     case DW_FORM_strp_sup:
          ^~~~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1019:10: note: suggested alternative: 'DW_FORM_strp'
     case DW_FORM_strp_sup:
          ^~~~~~~~~~~~~~~~
          DW_FORM_strp
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp: In member function 'bool folly::symbolizer::Dwarf::isAddrInRangeList(const folly::symbolizer::detail::CompilationUnit&, uint64_t, folly::Optional<long unsigned int>, size_t, uint8_t) const':
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1113:14: error: 'DW_RLE_end_of_list' was not declared in this scope
         case DW_RLE_end_of_list:
              ^~~~~~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1113:14: note: suggested alternative: 'DW_TAG_namelist'
         case DW_RLE_end_of_list:
              ^~~~~~~~~~~~~~~~~~
              DW_TAG_namelist
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1115:14: error: 'DW_RLE_base_addressx' was not declared in this scope
         case DW_RLE_base_addressx: {
              ^~~~~~~~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1115:14: note: suggested alternative: 'DW_LNE_set_address'
         case DW_RLE_base_addressx: {
              ^~~~~~~~~~~~~~~~~~~~
              DW_LNE_set_address
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1122:14: error: 'DW_RLE_startx_endx' was not declared in this scope
         case DW_RLE_startx_endx: {
              ^~~~~~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1122:14: note: suggested alternative: 'DW_AT_start_scope'
         case DW_RLE_startx_endx: {
              ^~~~~~~~~~~~~~~~~~
              DW_AT_start_scope
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1137:14: error: 'DW_RLE_startx_length' was not declared in this scope
         case DW_RLE_startx_length: {
              ^~~~~~~~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1137:14: note: suggested alternative: 'DW_AT_string_length'
         case DW_RLE_startx_length: {
              ^~~~~~~~~~~~~~~~~~~~
              DW_AT_string_length
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1152:14: error: 'DW_RLE_offset_pair' was not declared in this scope
         case DW_RLE_offset_pair: {
              ^~~~~~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1152:14: note: suggested alternative: 'DW_CFA_offset'
         case DW_RLE_offset_pair: {
              ^~~~~~~~~~~~~~~~~~
              DW_CFA_offset
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1161:14: error: 'DW_RLE_base_address' was not declared in this scope
         case DW_RLE_base_address:
              ^~~~~~~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1161:14: note: suggested alternative: 'DW_LNE_set_address'
         case DW_RLE_base_address:
              ^~~~~~~~~~~~~~~~~~~
              DW_LNE_set_address
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1165:14: error: 'DW_RLE_start_end' was not declared in this scope
         case DW_RLE_start_end: {
              ^~~~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1165:14: note: suggested alternative: 'DW_ATE_signed'
         case DW_RLE_start_end: {
              ^~~~~~~~~~~~~~~~
              DW_ATE_signed
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1173:14: error: 'DW_RLE_start_length' was not declared in this scope
         case DW_RLE_start_length: {
              ^~~~~~~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1173:14: note: suggested alternative: 'DW_AT_string_length'
         case DW_RLE_start_length: {
              ^~~~~~~~~~~~~~~~~~~
              DW_AT_string_length
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp: In lambda function:
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1216:35: error: 'DW_FORM_addrx' was not declared in this scope
                 attr.spec.form == DW_FORM_addrx || //
                                   ^~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1216:35: note: suggested alternative: 'DW_FORM_addr'
                 attr.spec.form == DW_FORM_addrx || //
                                   ^~~~~~~~~~~~~
                                   DW_FORM_addr
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1217:35: error: 'DW_FORM_addrx1' was not declared in this scope
                 attr.spec.form == DW_FORM_addrx1 || //
                                   ^~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1217:35: note: suggested alternative: 'DW_FORM_addr'
                 attr.spec.form == DW_FORM_addrx1 || //
                                   ^~~~~~~~~~~~~~
                                   DW_FORM_addr
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1218:35: error: 'DW_FORM_addrx2' was not declared in this scope
                 attr.spec.form == DW_FORM_addrx2 || //
                                   ^~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1218:35: note: suggested alternative: 'DW_FORM_addr'
                 attr.spec.form == DW_FORM_addrx2 || //
                                   ^~~~~~~~~~~~~~
                                   DW_FORM_addr
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1219:35: error: 'DW_FORM_addrx3' was not declared in this scope
                 attr.spec.form == DW_FORM_addrx3 || //
                                   ^~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1219:35: note: suggested alternative: 'DW_FORM_addr'
                 attr.spec.form == DW_FORM_addrx3 || //
                                   ^~~~~~~~~~~~~~
                                   DW_FORM_addr
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1220:35: error: 'DW_FORM_addrx4' was not declared in this scope
                 attr.spec.form == DW_FORM_addrx4;
                                   ^~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1220:35: note: suggested alternative: 'DW_FORM_addr'
                 attr.spec.form == DW_FORM_addrx4;
                                   ^~~~~~~~~~~~~~
                                   DW_FORM_addr
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp: In lambda function:
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1312:33: error: 'DW_FORM_addrx' was not declared in this scope
               attr.spec.form == DW_FORM_addrx || //
                                 ^~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1312:33: note: suggested alternative: 'DW_FORM_addr'
               attr.spec.form == DW_FORM_addrx || //
                                 ^~~~~~~~~~~~~
                                 DW_FORM_addr
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1313:33: error: 'DW_FORM_addrx1' was not declared in this scope
               attr.spec.form == DW_FORM_addrx1 || //
                                 ^~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1313:33: note: suggested alternative: 'DW_FORM_addr'
               attr.spec.form == DW_FORM_addrx1 || //
                                 ^~~~~~~~~~~~~~
                                 DW_FORM_addr
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1314:33: error: 'DW_FORM_addrx2' was not declared in this scope
               attr.spec.form == DW_FORM_addrx2 || //
                                 ^~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1314:33: note: suggested alternative: 'DW_FORM_addr'
               attr.spec.form == DW_FORM_addrx2 || //
                                 ^~~~~~~~~~~~~~
                                 DW_FORM_addr
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1315:33: error: 'DW_FORM_addrx3' was not declared in this scope
               attr.spec.form == DW_FORM_addrx3 || //
                                 ^~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1315:33: note: suggested alternative: 'DW_FORM_addr'
               attr.spec.form == DW_FORM_addrx3 || //
                                 ^~~~~~~~~~~~~~
                                 DW_FORM_addr
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1316:33: error: 'DW_FORM_addrx4' was not declared in this scope
               attr.spec.form == DW_FORM_addrx4;
                                 ^~~~~~~~~~~~~~
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:1316:33: note: suggested alternative: 'DW_FORM_addr'
               attr.spec.form == DW_FORM_addrx4;
                                 ^~~~~~~~~~~~~~
                                 DW_FORM_addr

This is the dockerfile used:

FROM registry.access.redhat.com/rhel7:7.9

ARG GFLAGS_VERSION=2.2.2
ARG GLOG_VERSION=0.5.0
ARG FMT_VERSION=8.0.1
ARG BOOST_VERSION=1_77_0
ARG LIBSODIUM_VERSION=1.0.18
ARG FOLLY_VERSION=2021.09.13.00

RUN export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH \
&& source scl_source enable devtoolset-7 \
&& wget --no-check-certificate -P /tmp/ https://proxy.local/gflags/gflags/archive/refs/tags/v$GFLAGS_VERSION.tar.gz \
&& tar xfz /tmp/v$GFLAGS_VERSION.tar.gz -C /tmp \
&& mkdir -p /tmp/gflags-$GFLAGS_VERSION/_build \
&& cd /tmp/gflags-$GFLAGS_VERSION/_build \
&& cmake3  -Wno-dev .. \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DBUILD_SHARED_LIBS=ON \
&& make -j4 \
&& make install \
&& wget --no-check-certificate -P /tmp/ https://proxy.local/google/glog/archive/refs/tags/v$GLOG_VERSION.tar.gz \
&& tar xfz /tmp/v$GLOG_VERSION.tar.gz -C /tmp \
&& mkdir -p /tmp/glog-$GLOG_VERSION/_build \
&& cd /tmp/glog-$GLOG_VERSION/_build \
&& export CXXFLAGS="$CXXFLAGS -fPIC" \
&& cmake3  -Wno-dev .. \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DBUILD_SHARED_LIBS=ON \
&& make -j4 \
&& make install \
&& wget --no-check-certificate -P /tmp/ https://proxy.local/fmtlib/fmt/archive/refs/tags/$FMT_VERSION.tar.gz \
&& tar xfz /tmp/$FMT_VERSION.tar.gz -C /tmp \
&& mkdir -p /tmp/fmt-$FMT_VERSION/_build \
&& cd /tmp/fmt-$FMT_VERSION/_build \
&& export CXXFLAGS="$CXXFLAGS -fPIC" \
&& cmake3  -Wno-dev .. \
-DCMAKE_INSTALL_PREFIX=/usr/local \
&& make -j4 \
&& make install \
&& wget --no-check-certificate -P /tmp/ https://proxy.local/artifactory/main/release/1.77.0/source/boost_$BOOST_VERSION.tar.gz \
&& tar xfz /tmp/boost_$BOOST_VERSION.tar.gz -C /tmp \
&& cd /tmp/boost_$BOOST_VERSION \
&& sh bootstrap.sh \
--with-libraries=all \
--prefix=/usr/local  \
&& ./b2 install -j4 \
link=static,shared \
threading=multi \
&&  wget --no-check-certificate -P /tmp/ https://proxy.local/libsodium/releases/libsodium-$LIBSODIUM_VERSION.tar.gz \
&& tar xfz /tmp/libsodium-$LIBSODIUM_VERSION.tar.gz -C /tmp/ \
&& cd /tmp/libsodium-$LIBSODIUM_VERSION \
&& ./configure \
&& make -j4 \
&& make install \
&& wget --no-check-certificate -P /tmp/ https://proxy.local/facebook/folly/archive/refs/tags/v$FOLLY_VERSION.tar.gz \
&& export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH \
&& source scl_source enable devtoolset-7 \
&& mkdir -p /tmp/v$FOLLY_VERSION \
&& ls -latr /tmp/ \
&& tar xfz /tmp/v$FOLLY_VERSION.tar.gz -C /tmp/ \
&& cd /tmp/folly-$FOLLY_VERSION/folly/ \
&& export LDFLAGS="-ljemalloc $LDFLAGS" \
&& export CXXFLAGS="$CXXFLAGS -fPIC" \
&& cmake3 -Wno-dev .. \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_INCLUDE_PATH="/usr/local/include" \
-DCMAKE_LIBRARY_PATH="/usr/local/lib:/usr/local/lib64:/usr/lib64:/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/" \
-DCMAKE_CXX_FLAGS='-Wno-local-type-template-args' \
-DFOLLY_CPP_ATOMIC_BUILTIN=1 \
-DFOLLY_HAVE_RECVMMSG=1 \
-DFOLLY_HAVE_CLOCK_GETTIME=1 \
-DFOLLY_HAVE_WEAK_SYMBOLS=1 \
&& make -j4 \
&& make install 
andrejusc commented 2 years ago

@cello86 - not sure. Looking at this file: folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp It contains such pre-processor directives: #if FOLLY_HAVE_DWARF && FOLLY_HAVE_ELF and I think in my case that overall condition evaluates to false and so overall compilation ignores related code block and goes further till mentioned error above.

In some of mine make/config logs I have such:

-- Could NOT find LIBDWARF (missing: LIBDWARF_LIBRARY LIBDWARF_INCLUDE_DIR)
...
-- Setting FOLLY_HAVE_ELF: 1
-- Setting FOLLY_HAVE_DWARF: FALSE

Are you trying to reproduce error in this issue on your Env and suggest some fix or anything else?

cello86 commented 2 years ago

@andrejusc I tested on my local env and the library DWARF has been found and enabled during the build:

-- Found LIBDWARF: /usr/lib64/libdwarf.so
...
-- Setting FOLLY_HAVE_ELF: 1
-- Setting FOLLY_HAVE_DWARF: TRUE

The libdwarf installed are:

sh-4.2# rpm  -qa | grep dwarf
libdwarf-20130207-4.el7.x86_64
libdwarf-devel-20130207-4.el7.x86_64
andrejusc commented 2 years ago

@cello86 - but then your faced issue is not the same as this original one about and so I'd suggest raise separate one for this case or find maybe it's already open:

/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp: In member function 'folly::symbolizer::detail::Attribute folly::symbolizer::Dwarf::readAttribute(const folly::symbolizer::detail::CompilationUnit&, const folly::symbolizer::detail::Die&, folly::symbolizer::detail::AttributeSpec, folly::StringPiece&) const':
/tmp/folly-2021.09.13.00/folly/experimental/symbolizer/Dwarf.cpp:954:10: error: 'DW_FORM_implicit_const' was not declared in this scope
     case DW_FORM_implicit_const: // form is explicitly specified
          ^~~~~~~~~~~~~~~~~~~~~~

Unless you want to temporary rename/move your present /usr/lib64/libdwarf.so library, so you could get closer to original issue reproduction here.

cello86 commented 2 years ago

@andrejusc I solved removing the libdwarf-devel package because it's used only for debugging pourpose. I updated all the version with you example but I noticed:

In file included from ../../mcrouter/lib/network/gen/MemcacheMessages.h:35:0,
                 from ../../mcrouter/lib/Reply.h:16,
                 from FailoverErrorsSettingsBase.h:16,
                 from FailoverErrorsSettingsBase.cpp:8:
../../mcrouter/lib/network/gen/CommonMessages.h: In constructor 'facebook::memcache::McVersionRequest::McVersionRequest(folly::StringPiece)':
../../mcrouter/lib/network/gen/CommonMessages.h:56:29: error: 'carbon::thrift::IOBufKey facebook::memcache::thrift::McVersionRequest::key' is private within this context
     underlyingThriftStruct_.key = sp;
                             ^~~
In file included from ../../mcrouter/lib/network/gen/gen-cpp2/Memcache_types.h:14:0,
                 from ../../mcrouter/lib/network/gen/MemcacheMessages.h:33,
                 from ../../mcrouter/lib/Reply.h:16,
                 from FailoverErrorsSettingsBase.h:16,
                 from FailoverErrorsSettingsBase.cpp:8:
../../mcrouter/lib/network/gen/gen-cpp2/Common_types.h:212:30: note: declared private here
   ::carbon::thrift::IOBufKey key;
                              ^~~
In file included from ../../mcrouter/lib/network/gen/MemcacheMessages.h:35:0,
                 from ../../mcrouter/lib/Reply.h:16,
                 from FailoverErrorsSettingsBase.h:16,
                 from FailoverErrorsSettingsBase.cpp:8:
../../mcrouter/lib/network/gen/CommonMessages.h: In constructor 'facebook::memcache::McVersionRequest::McVersionRequest(folly::IOBuf&&)':
../../mcrouter/lib/network/gen/CommonMessages.h:59:29: error: 'carbon::thrift::IOBufKey facebook::memcache::thrift::McVersionRequest::key' is private within this context
     underlyingThriftStruct_.key = std::move(carbonKey);
                             ^~~
In file included from ../../mcrouter/lib/network/gen/gen-cpp2/Memcache_types.h:14:0,
                 from ../../mcrouter/lib/network/gen/MemcacheMessages.h:33,
                 from ../../mcrouter/lib/Reply.h:16,
                 from FailoverErrorsSettingsBase.h:16,
                 from FailoverErrorsSettingsBase.cpp:8:
../../mcrouter/lib/network/gen/gen-cpp2/Common_types.h:212:30: note: declared private here
   ::carbon::thrift::IOBufKey key;
                              ^~~
In file included from ../../mcrouter/lib/network/gen/MemcacheMessages.h:35:0,
                 from ../../mcrouter/lib/Reply.h:16,
                 from FailoverErrorsSettingsBase.h:16,
                 from FailoverErrorsSettingsBase.cpp:8:
../../mcrouter/lib/network/gen/CommonMessages.h: In member function 'const carbon::Keys<folly::IOBuf>& facebook::memcache::McVersionRequest::key() const':
../../mcrouter/lib/network/gen/CommonMessages.h:63:36: error: 'carbon::thrift::IOBufKey facebook::memcache::thrift::McVersionRequest::key' is private within this context
     return underlyingThriftStruct_.key;
                                    ^~~
In file included from ../../mcrouter/lib/network/gen/gen-cpp2/Memcache_types.h:14:0,
                 from ../../mcrouter/lib/network/gen/MemcacheMessages.h:33,
                 from ../../mcrouter/lib/Reply.h:16,
                 from FailoverErrorsSettingsBase.h:16,
                 from FailoverErrorsSettingsBase.cpp:8:
../../mcrouter/lib/network/gen/gen-cpp2/Common_types.h:212:30: note: declared private here
   ::carbon::thrift::IOBufKey key;
                              ^~~
In file included from ../../mcrouter/lib/network/gen/MemcacheMessages.h:35:0,
                 from ../../mcrouter/lib/Reply.h:16,
                 from FailoverErrorsSettingsBase.h:16,
                 from FailoverErrorsSettingsBase.cpp:8:
../../mcrouter/lib/network/gen/CommonMessages.h: In member function 'carbon::Keys<folly::IOBuf>& facebook::memcache::McVersionRequest::key()':
../../mcrouter/lib/network/gen/CommonMessages.h:67:36: error: 'carbon::thrift::IOBufKey facebook::memcache::thrift::McVersionRequest::key' is private within this context
     return underlyingThriftStruct_.key;
                                    ^~~
In file included from ../../mcrouter/lib/network/gen/gen-cpp2/Memcache_types.h:14:0,
                 from ../../mcrouter/lib/network/gen/MemcacheMessages.h:33,
                 from ../../mcrouter/lib/Reply.h:16,
                 from FailoverErrorsSettingsBase.h:16,
                 from FailoverErrorsSettingsBase.cpp:8:
../../mcrouter/lib/network/gen/gen-cpp2/Common_types.h:212:30: note: declared private here
   ::carbon::thrift::IOBufKey key;
                              ^~~
In file included from ../../mcrouter/lib/network/gen/MemcacheMessages.h:35:0,
                 from ../../mcrouter/lib/Reply.h:16,
                 from FailoverErrorsSettingsBase.h:16,
                 from FailoverErrorsSettingsBase.cpp:8:
../../mcrouter/lib/network/gen/CommonMessages.h: In constructor 'facebook::memcache::McVersionReply::McVersionReply(carbon::Result)':
../../mcrouter/lib/network/gen/CommonMessages.h:136:29: error: 'carbon::Result facebook::memcache::thrift::McVersionReply::result' is private within this context
     underlyingThriftStruct_.result = carbonResult;
                             ^~~~~~
In file included from ../../mcrouter/lib/network/gen/gen-cpp2/Memcache_types.h:14:0,
                 from ../../mcrouter/lib/network/gen/MemcacheMessages.h:33,
                 from ../../mcrouter/lib/Reply.h:16,
                 from FailoverErrorsSettingsBase.h:16,
                 from FailoverErrorsSettingsBase.cpp:8:
../../mcrouter/lib/network/gen/gen-cpp2/Common_types.h:332:20: note: declared private here
   ::carbon::Result result;
                    ^~~~~~