envoyproxy / envoy

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

Compilation fails for Envoy 1.31.0 #36513

Open learnsomethingtoday opened 1 week ago

learnsomethingtoday commented 1 week ago

I am building Envoy 1.31.0 from sources and i am stuck while compilation with the following error :

ERROR: /root/.cache/bazel/_bazel_root/fc9d07c8fa1ae7ff490efa6f3e8eaa23/external/com_google_cel_cpp/runtime/standard/BUILD:23:11: Compiling runtime/standard/comparison_functions.cc failed: (Exit 1): clang-14 failed: error executing command (from target @com_google_cel_cpp//runtime/standard:comparison_functions) /usr/bin/clang-14 -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer '-std=c++14' ... (remaining 34 arguments skipped)

Clang and LLVM version - 14

bazel build command : bazel build --config=clang envoy --cxxopt=-std=c++20 --host_cxxopt=-std=c++20

Tried if it works with c++17 or c++14, both of them did not work :(

Could someone please suggest on how to proceed?

learnsomethingtoday commented 1 week ago

Error when i tried to build with c++17 : source/extensions/filters/http/match_delegate/config.cc:279:7: error: designated initializers are a C++20 extension [-Werror,-Wc++20-designator]

alyssawilk commented 1 week ago

I haven't seen those particular errors, but it can often help to start with docker builds, and try to narrow down what's different between your and the provided working build environment cc @phlax

learnsomethingtoday commented 1 week ago

I am restricted to access dockerhub, and that is the only reason to build this from sources..

I have used the versions as mentioned - clang14 and c++20, not sure why am i getting compilation issues

learnsomethingtoday commented 1 week ago

/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/type_traits:1364:23: error: incomplete type 'cel::JsonObject' used in type trait expression __bool_constant<__has_trivial_destructor(_Tp)>>

observed this error incomplete type 'cel::JsonObject' used in type trait expression, in all of my trails

learnsomethingtoday commented 6 days ago

Any leads? @alyssawilk @phlax

phlax commented 6 days ago

start by trying to build with the envoy build container - ie ./ci/run_envoy_docker.sh - once you have that working you can try building in a different environment

learnsomethingtoday commented 6 days ago

@phlax As I said before i cannot pull images from dockerhub, we are restricted to do that :( To run this ./ci/run_envoy_docker.sh, i need access to dockerhub right, so i cant proceed with this approach..

phlax commented 6 days ago

the problem is not obvious im afraid - we provide the build container as a known good starting point - i would suggest trying a build in an env that can access dockerhub and then ..

... once you have that working you can try building in a different environment

learnsomethingtoday commented 6 days ago

Sadly, our entire organization's network is blocked from accessing dockerhub. Or else i would have used the same build container to directly build the image, instead of building from sources 😞

I have previously built earlier versions of Envoy, for which i didn't face compilation errors like this.. Seeing for the first time.

alyssawilk commented 6 days ago

Yeah unfortunately there's a lot of finicky bits that go into the Envoy build. We've supplied docker based builds because the maintainer team can't handle the overhead of debugging other people's builds. Sorry we likely can't help more with this :-(

learnsomethingtoday commented 6 days ago

Will i be able to build that docker image used in the build container locally in my environment? Instead of pulling it from dockerhub

phlax commented 6 days ago

yeah - the recipe is here https://github.com/envoyproxy/envoy-build-tools/tree/main/docker/linux/ubuntu

you might find it easier to download and then load it into docker tho (assuming you can inject large files into your env)

learnsomethingtoday commented 6 days ago

will give a try, thanks!