envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
24.95k stars 4.8k forks source link

build error in external/com_google_cel_cpp/eval/public/containers/container_backed_map_impl.cc in Envoy 1.19.1 release #19083

Closed mramakrishnaprasad closed 2 years ago

mramakrishnaprasad commented 2 years ago

Title: Build error in external/com_google_cel_cpp/eval/public/containers/container_backed_map_impl.cc for v1.19.1 branch.

build command: bazel build -c opt --strip=always //source/exe:envoy

Description: I have cloned the envoy 1.19.1 release using the below command: git clone -b v1.19.1 https://github.com/envoyproxy/envoy

My environment is ubuntu 18.04.1. When I try to the build the code using the mentioned build command, I see the build failure which is as follows: 2021/11/23 04:34:34 Downloading https://releases.bazel.build/4.1.0/release/bazel-4.1.0-linux-x86_64... Extracting Bazel installation... Starting local Bazel server and connecting to it... DEBUG: /home/ubuntu/.cache/bazel/_bazel_ubuntu/201dace3fe891a3f02bfdb4cf508e497/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:68:14: Current running Bazel is ahead of bazel-toolchains repo. Please update your pin to bazel-toolchains repo in your WORKSPACE file. DEBUG: /home/ubuntu/.cache/bazel/_bazel_ubuntu/201dace3fe891a3f02bfdb4cf508e497/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:68:14: Current running Bazel is ahead of bazel-toolchains repo. Please update your pin to bazel-toolchains repo in your WORKSPACE file. DEBUG: /home/ubuntu/.cache/bazel/_bazel_ubuntu/201dace3fe891a3f02bfdb4cf508e497/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:68:14: Current running Bazel is ahead of bazel-toolchains repo. Please update your pin to bazel-toolchains repo in your WORKSPACE file. DEBUG: /home/ubuntu/.cache/bazel/_bazel_ubuntu/201dace3fe891a3f02bfdb4cf508e497/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:68:14: Current running Bazel is ahead of bazel-toolchains repo. Please update your pin to bazel-toolchains repo in your WORKSPACE file. DEBUG: /home/ubuntu/.cache/bazel/_bazel_ubuntu/201dace3fe891a3f02bfdb4cf508e497/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:68:14: Current running Bazel is ahead of bazel-toolchains repo. Please update your pin to bazel-toolchains repo in your WORKSPACE file. INFO: SHA256 (https://golang.org/dl/?mode=json&include=all) = 1c53e7c14eab06063ca7335859192fc63ad549b74c74473a218a69ca3f293231 INFO: Analyzed target //source/exe:envoy (766 packages loaded, 42811 targets configured). INFO: Found 1 target... INFO: From Executing genrule @com_lightstep_tracer_cpp//:generate_version_h: CMake Warning at CMakeLists.txt:74 (message): WITH_GRPC is not set; building without dynamic loading support.

-- The C compiler identification is GNU 7.5.0 -- The CXX compiler identification is GNU 7.5.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /tmp/tmp.5mdOTvfLjM -- Cache values BUILD_SHARED_LIBS:BOOL=ON BUILD_STATIC_LIBS:BOOL=ON CMAKE_BUILD_TYPE:STRING= CMAKE_INSTALL_PREFIX:PATH=/usr/local DEFAULT_SSL_ROOTS_PEM:STRING= HEADERS_ONLY:BOOL=ON WITH_CARES:BOOL=OFF WITH_DYNAMIC_LOAD:BOOL=ON WITH_GRPC:BOOL=OFF WITH_LIBEVENT:BOOL=OFF INFO: From Executing genrule @io_opentracing_cpp//:generate_version_h: -- The C compiler identification is GNU 7.5.0 -- The CXX compiler identification is GNU 7.5.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- clang-tidy not found. -- Configuring done -- Generating done -- Build files have been written to: /tmp/tmp.Y5A9jFm44d -- Cache values BUILD_DYNAMIC_LOADING:BOOL=ON BUILD_MOCKTRACER:BOOL=OFF BUILD_SHARED_LIBS:BOOL=ON BUILD_STATIC_LIBS:BOOL=ON BUILD_TESTING:BOOL=OFF CLANG_TIDY_EXE:FILEPATH=CLANG_TIDY_EXE-NOTFOUND CMAKE_BUILD_TYPE:STRING= CMAKE_INSTALL_PREFIX:PATH=/usr/local ENABLE_LINTING:BOOL=ON INFO: From CcCmakeMakeRule external/envoy/bazel/foreign_cc/zlib/include [for host]:

INFO: From CcCmakeMakeRule external/envoy/bazel/foreign_cc/zlib/include:

INFO: From CcCmakeMakeRule external/envoy/bazel/foreign_cc/zlib/include:

INFO: From CcConfigureMakeRule external/envoy/bazel/foreign_cc/luajit/include/luajit-2.1:

INFO: From CcCmakeMakeRule external/envoy/bazel/foreign_cc/nghttp2/include:

INFO: From Compiling opencensus/trace/internal/local_span_store_impl.cc: external/io_opencensus_cpp/opencensus/trace/internal/local_span_store_impl.cc: In member function 'std::vector opencensus::trace::exporter::LocalSpanStoreImpl::GetLatencySampledSpans(const LatencyFilter&) const': external/io_opencensus_cpp/opencensus/trace/internal/local_span_store_impl.cc:130:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (out.size() >= filter.max_spans_to_return) break;


external/io_opencensus_cpp/opencensus/trace/internal/local_span_store_impl.cc: In member function 'std::vector<opencensus::trace::exporter::SpanData> opencensus::trace::exporter::LocalSpanStoreImpl::GetErrorSampledSpans(const ErrorFilter&) const':
external/io_opencensus_cpp/opencensus/trace/internal/local_span_store_impl.cc:144:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (out.size() >= filter.max_spans_to_return) break;
         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
INFO: From Compiling opencensus/trace/internal/b3.cc:
external/io_opencensus_cpp/opencensus/trace/internal/b3.cc: In function 'bool opencensus::trace::propagation::{anonymous}::IsHexDigits(absl::string_view)':
external/io_opencensus_cpp/opencensus/trace/internal/b3.cc:36:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < s.length(); ++i) {
                   ~~^~~~~~~~~~~~
INFO: From Compiling source/utils/random_generator.cc:
external/com_github_skyapm_cpp2sky/source/utils/random_generator.cc: In member function 'void cpp2sky::RandomGeneratorImpl::randomBuffer(char*, size_t)':
external/com_github_skyapm_cpp2sky/source/utils/random_generator.cc:92:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (auto i = 0; i < len; ++i) {
                    ~~^~~~~
INFO: From Compiling src/exports.cc:
In file included from external/proxy_wasm_cpp_host/include/proxy-wasm/wasm_vm.h:24:0,
                 from external/proxy_wasm_cpp_host/include/proxy-wasm/exports.h:21,
                 from external/proxy_wasm_cpp_host/include/proxy-wasm/wasm.h:28,
                 from external/proxy_wasm_cpp_host/src/exports.cc:16:
external/proxy_wasm_cpp_host/include/proxy-wasm/word.h: In function 'proxy_wasm::Word proxy_wasm::exports::get_header_map_pairs(void*, proxy_wasm::Word, proxy_wasm::Word, proxy_wasm::Word)':
external/proxy_wasm_cpp_host/include/proxy-wasm/word.h:28:28: warning: 'ptr' may be used uninitialized in this function [-Wmaybe-uninitialized]
   Word(uint64_t w) : u64_(w) {}                          // Implicit conversion into Word.
                            ^
external/proxy_wasm_cpp_host/src/exports.cc:78:12: note: 'ptr' was declared here
   uint64_t ptr;
            ^~~
INFO: From Compiling opencensus/trace/internal/span_exporter_impl.cc:
external/io_opencensus_cpp/opencensus/trace/internal/span_exporter_impl.cc: In member function 'bool opencensus::trace::exporter::SpanExporterImpl::IsBatchFull() const':
external/io_opencensus_cpp/opencensus/trace/internal/span_exporter_impl.cc:68:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   return spans_.size() >= cached_batch_size_;
          ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
INFO: From Compiling runtime/Cpp/runtime/src/NoViableAltException.cpp:
In file included from external/antlr4_runtimes/runtime/Cpp/runtime/src/NoViableAltException.cpp:8:0:
external/antlr4_runtimes/runtime/Cpp/runtime/src/NoViableAltException.h: In constructor 'antlr4::NoViableAltException::NoViableAltException(antlr4::Parser*, antlr4::TokenStream*, antlr4::Token*, antlr4::Token*, antlr4::atn::ATNConfigSet*, antlr4::ParserRuleContext*, bool)':
external/antlr4_runtimes/runtime/Cpp/runtime/src/NoViableAltException.h:39:12: warning: 'antlr4::NoViableAltException::_startToken' will be initialized after [-Wreorder]
     Token *_startToken;
            ^~~~~~~~~~~
external/antlr4_runtimes/runtime/Cpp/runtime/src/NoViableAltException.h:33:10: warning:   'bool antlr4::NoViableAltException::_deleteConfigs' [-Wreorder]
     bool _deleteConfigs;
          ^~~~~~~~~~~~~~
external/antlr4_runtimes/runtime/Cpp/runtime/src/NoViableAltException.cpp:17:1: warning:   when initialized here [-Wreorder]
 NoViableAltException::NoViableAltException(Parser *recognizer, TokenStream *input,Token *startToken,
 ^~~~~~~~~~~~~~~~~~~~
INFO: From Compiling runtime/Cpp/runtime/src/RuleContext.cpp:
In file included from external/antlr4_runtimes/runtime/Cpp/runtime/src/RuleContext.cpp:10:0:
external/antlr4_runtimes/runtime/Cpp/runtime/src/atn/ATNState.h:73:26: warning: type attributes ignored after type is already defined [-Wattributes]
   class ANTLR4CPP_PUBLIC ATN;
                          ^~~
INFO: From Compiling opencensus/trace/internal/cloud_trace_context.cc:
external/io_opencensus_cpp/opencensus/trace/internal/cloud_trace_context.cc: In function 'bool opencensus::trace::propagation::{anonymous}::IsHexDigits(absl::string_view)':
external/io_opencensus_cpp/opencensus/trace/internal/cloud_trace_context.cc:38:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < s.length(); ++i) {
                   ~~^~~~~~~~~~~~
INFO: From Compiling opencensus/trace/internal/trace_context.cc:
external/io_opencensus_cpp/opencensus/trace/internal/trace_context.cc: In function 'bool opencensus::trace::propagation::{anonymous}::IsLowercaseHexDigits(absl::string_view)':
external/io_opencensus_cpp/opencensus/trace/internal/trace_context.cc:34:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < s.length(); ++i) {
                   ~~^~~~~~~~~~~~
INFO: From Compiling opencensus/trace/internal/running_span_store_impl.cc:
external/io_opencensus_cpp/opencensus/trace/internal/running_span_store_impl.cc: In member function 'std::vector<opencensus::trace::exporter::SpanData> opencensus::trace::exporter::RunningSpanStoreImpl::GetRunningSpans(const opencensus::trace::exporter::RunningSpanStore::Filter&) const':
external/io_opencensus_cpp/opencensus/trace/internal/running_span_store_impl.cc:86:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (running_spans.size() >= filter.max_spans_to_return) break;
         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
INFO: From CcCmakeMakeRule bazel/foreign_cc/nghttp2/include:

INFO: From CcCmakeMakeRule external/envoy/bazel/foreign_cc/ares/include:

INFO: From Compiling hessian2/basic_codec/date_codec.cc:
In file included from external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/date_codec.cc:1:0:
external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/date_codec.hpp:23:5: warning: "_LIBCPP_STD_VER" is not defined, evaluates to 0 [-Wundef]
 #if _LIBCPP_STD_VER > 17
     ^~~~~~~~~~~~~~~
external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/date_codec.hpp:49:5: warning: "_LIBCPP_STD_VER" is not defined, evaluates to 0 [-Wundef]
 #if _LIBCPP_STD_VER > 17
     ^~~~~~~~~~~~~~~
external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/date_codec.cc:68:5: warning: "_LIBCPP_STD_VER" is not defined, evaluates to 0 [-Wundef]
 #if _LIBCPP_STD_VER > 17
     ^~~~~~~~~~~~~~~
external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/date_codec.cc:122:5: warning: "_LIBCPP_STD_VER" is not defined, evaluates to 0 [-Wundef]
 #if _LIBCPP_STD_VER > 17
     ^~~~~~~~~~~~~~~
INFO: From Compiling hessian2/basic_codec/class_instance_codec.cc:
In file included from external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/object_codec.hpp:11:0,
                 from external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/class_instance_codec.hpp:5,
                 from external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/class_instance_codec.cc:1:
external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/date_codec.hpp:23:5: warning: "_LIBCPP_STD_VER" is not defined, evaluates to 0 [-Wundef]
 #if _LIBCPP_STD_VER > 17
     ^~~~~~~~~~~~~~~
external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/date_codec.hpp:49:5: warning: "_LIBCPP_STD_VER" is not defined, evaluates to 0 [-Wundef]
 #if _LIBCPP_STD_VER > 17
     ^~~~~~~~~~~~~~~
INFO: From Compiling hessian2/basic_codec/list_codec.cc:
In file included from external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/object_codec.hpp:11:0,
                 from external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/list_codec.hpp:5,
                 from external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/list_codec.cc:1:
external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/date_codec.hpp:23:5: warning: "_LIBCPP_STD_VER" is not defined, evaluates to 0 [-Wundef]
 #if _LIBCPP_STD_VER > 17
     ^~~~~~~~~~~~~~~
external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/date_codec.hpp:49:5: warning: "_LIBCPP_STD_VER" is not defined, evaluates to 0 [-Wundef]
 #if _LIBCPP_STD_VER > 17
     ^~~~~~~~~~~~~~~
INFO: From Compiling hessian2/basic_codec/map_codec.cc:
In file included from external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/object_codec.hpp:11:0,
                 from external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/map_codec.hpp:5,
                 from external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/map_codec.cc:1:
external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/date_codec.hpp:23:5: warning: "_LIBCPP_STD_VER" is not defined, evaluates to 0 [-Wundef]
 #if _LIBCPP_STD_VER > 17
     ^~~~~~~~~~~~~~~
external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/date_codec.hpp:49:5: warning: "_LIBCPP_STD_VER" is not defined, evaluates to 0 [-Wundef]
 #if _LIBCPP_STD_VER > 17
     ^~~~~~~~~~~~~~~
INFO: From Compiling hessian2/basic_codec/object_codec.cc:
In file included from external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/object_codec.hpp:11:0,
                 from external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/object_codec.cc:1:
external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/date_codec.hpp:23:5: warning: "_LIBCPP_STD_VER" is not defined, evaluates to 0 [-Wundef]
 #if _LIBCPP_STD_VER > 17
     ^~~~~~~~~~~~~~~
external/com_github_alibaba_hessian2_codec/hessian2/basic_codec/date_codec.hpp:49:5: warning: "_LIBCPP_STD_VER" is not defined, evaluates to 0 [-Wundef]
 #if _LIBCPP_STD_VER > 17
     ^~~~~~~~~~~~~~~
ERROR: /home/ubuntu/.cache/bazel/_bazel_ubuntu/201dace3fe891a3f02bfdb4cf508e497/external/com_google_cel_cpp/eval/public/containers/BUILD:40:11: Compiling eval/public/containers/container_backed_map_impl.cc failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 36 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
external/com_google_cel_cpp/eval/public/containers/container_backed_map_impl.cc: In static member function 'static absl::StatusOr<std::unique_ptr<google::api::expr::runtime::CelMap> > google::api::expr::runtime::{anonymous}::ContainerBackedMapImpl::Create(absl::Span<std::pair<google::api::expr::runtime::CelValue, google::api::expr::runtime::CelValue> >)':
external/com_google_cel_cpp/eval/public/containers/container_backed_map_impl.cc:114:12: error: could not convert 'cel_map' from 'std::unique_ptr<google::api::expr::runtime::{anonymous}::ContainerBackedMapImpl, std::default_delete<google::api::expr::runtime::{anonymous}::ContainerBackedMapImpl> >' to 'absl::StatusOr<std::unique_ptr<google::api::expr::runtime::CelMap> >'
     return cel_map;
            ^~~~~~~
Target //source/exe:envoy-static failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 367.245s, Critical Path: 327.05s
INFO: 1819 processes: 145 internal, 1673 linux-sandbox, 1 worker.
FAILED: Build did NOT complete successfully

Could you please help me in getting this issue fixed?
RyanTheOptimist commented 2 years ago

cc @lizan

lizan commented 2 years ago

-- The C compiler identification is GNU 7.5.0 -- The CXX compiler identification is GNU 7.5.0

This might be too old for 1.19, try use GCC 9.x or Clang 10.x

mramakrishnaprasad commented 2 years ago

Thanks @lizan. Will try with the upgraded GCC version.

mramakrishnaprasad commented 2 years ago

Its working with the upgraded gcc version. Thanks.