envoyproxy / envoyproxy/envoy-filter-example
Not able to build the executable binary in Ubuntu 20.04 for both gcc and clang
- Dominant language
- C++
- Stars
- 360
- Forks
- 220
- PR merge metrics
- No merged PRs in 30d
Description
Hello, I am trying to build the http filter with envoy v1.16.0 . I tried using both **gcc** and **clang** but still no luck.
### GCC
My specs are as follows.
- bazel 3.4.1
- gcc 9.3.0
- gcc++ 9.3.0
When I try to build using the following commands,
```
git clone https://github.com/envoyproxy/envoy-filter-example.git
cd envoy-filter-example
git submodule update --init
cd envoy
git checkout v1.16.0
cd ..
bazel build //http-filter-example:envoy --config=clang
```
I get the following error.
```
ERROR: /home/khadija/.cache/bazel/_bazel_khadija/67b71b3527ed4854635b017e6b6cd642/external/com_googlesource_quiche/BUILD.bazel:2170:17: C++ compilation of rule '@com_googlesource_quiche//:quic_core_framer_lib' failed (Exit 1): gcc failed: error executing command
(cd /home/khadija/.cache/bazel/_bazel_khadija/67b71b3527ed4854635b017e6b6cd642/sandbox/linux-sandbox/2634/execroot/envoy_filter_example && \
exec env - \
BAZEL_LINKLIBS=-l%:libstdc++.a \
BAZEL_LINKOPTS=-lm \
CC=gcc \
CXX=g++ \
PATH=/home/khadija/.cache/bazelisk/downloads/bazelbuild/bazel-3.4.1-linux-x86_64/bin:/usr/lib/llvm-8/bin:/home/khadija/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/go/bin \
PWD=/proc/self/cwd \`
[-Werror=sign-compare]
5546 | static_cast(writer->remaining() - ecn_size) <
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
5547 | QuicDataWriter::GetVarInt62Len(gap) +
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5548 | QuicDataWriter::GetVarInt62Len(ack_range)) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At global scope:
cc1plus: error: unrecognized command line option '-Wno-range-loop-analysis' [-Werror]
cc1plus: all warnings being treated as errors
Target //:envoy failed to build
```
### Clang
I followed the instructions on bazel/ReadMe to download and configure Clang+llvm.
```
git clone https://github.com/envoyproxy/envoy-filter-example.git
cd envoy-filter-example
git submodule update --init
cd envoy
git checkout v1.16.0
bazel/setup_clang.sh ~/Downloads/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04
cd ..
bazel build //http-filter-example:envoy --config=clang
```
But I am getting the following error.
```
ERROR: /home/khadija/.cache/bazel/_bazel_khadija/b8963e6f21a84c9e75cda0cff04a3eb5/external/envoy/source/common/common/BUILD:321:23: C++ compilation of rule '@envoy//source/common/common:thread_impl_lib_posix' 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 '-std=c++0x' -MD -MF ... (remaining 70 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
gcc: error: unrecognized command line option '-fno-limit-debug-info'
gcc: error: unrecognized command line option '-Wgnu-conditional-omitted-operand'
gcc: error: unrecognized command line option '-Wc++2a-extensions'; did you mean '-fms-extensions'?
gcc: error: unrecognized command line option '-Wrange-loop-analysis'
Target //http-filter-example:envoy failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.718s, Critical Path: 0.40s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
```
Any idea ? I was using envoy v1.14.0 and it works fine. But with v1.16.0, I can't build using both gcc and clang. Tried for few days and still no luck.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.