Giter Club home page Giter Club logo

envoy-filter-example's Introduction

Envoy filter example

This project demonstrates the linking of additional filters with the Envoy binary. A new filter echo2 is introduced, identical modulo renaming to the existing echo filter. Integration tests demonstrating the filter's end-to-end behavior are also provided.

For an example of additional HTTP filters, see here.

OpenSSF Scorecard

Building

To build the Envoy static binary:

  1. git submodule update --init
  2. bazel build //:envoy

Testing

To run the echo2 integration test:

bazel test //:echo2_integration_test

To run the regular Envoy tests from this project:

bazel test @envoy//test/...

How it works

The Envoy repository is provided as a submodule. The WORKSPACE file maps the @envoy repository to this local path.

The BUILD file introduces a new Envoy static binary target, envoy, that links together the new filter and @envoy//source/exe:envoy_main_entry_lib. The echo2 filter registers itself during the static initialization phase of the Envoy binary as a new filter.

envoy-filter-example's People

Contributors

110y avatar alyssawilk avatar curiouserrandy avatar derekargueta avatar dio avatar ggreenway avatar htuch avatar jmarantz avatar jmillikin-stripe avatar kyessenov avatar lambdai avatar lizan avatar mattklein123 avatar mmorel-35 avatar msample avatar phlax avatar piotrsikora avatar qiangyt avatar qinggniq avatar ramaraochavali avatar satvindar avatar songhu avatar taion809 avatar talnordan avatar update-envoy[bot] avatar venilnoronha avatar warrn avatar wbpcode avatar yanavlasov avatar zuercher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

envoy-filter-example's Issues

build error

I build by bazel build //http-filter-example:envoy

ERROR: error loading package '': Extension file not found. Unable to load file '@com_lyft_protoc_gen_validate//bazel:go_proto_library.bzl': file doesn't exist or isn't a file
ERROR: error loading package '': Extension file not found. Unable to load file '@com_lyft_protoc_gen_validate//bazel:go_proto_library.bzl': file doesn't exist or isn't a file
INFO: Elapsed time: 0.069s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)

anyone can help me?

git submodule dependency

As a Bazel user I would expect to download the envoy source code by using a Bazel repository rule.

Example

http_archive(
    name = "envoy",
    sha256 = "d7e270cd02923eee34d6fc5bfc1e73541e1c3121813779f779d29112402d2ecc",
    strip_prefix = "envoy-1.13.1",
    url = "https://github.com/envoyproxy/envoy/archive/v1.13.1.tar.gz",
)

The build fails when trying to make envoy available for binding by using the http_archive rule to download the Bazel repository as a compressed archive file.

What is the technical reason behind the strict git submodule dependency, besides the reliance on the envoy's .bazelrc Bazel configuration file.

@htuch @mattklein123 @dio @alyssawilk @PiotrSikora

post-merge build is broken

Seems it doesn't like something about tcmalloc

Use --sandbox_debug to see verbose messages from the sandbox
warning: unknown warning option '-Wno-implicit-int-float-conversion'; did you mean '-Wno-implicit-float-conversion'? [-Wunknown-warning-option]
In file included from external/com_github_google_tcmalloc/tcmalloc/cpu_cache.cc:15:
In file included from external/com_github_google_tcmalloc/tcmalloc/cpu_cache.h:30:
external/com_github_google_tcmalloc/tcmalloc/internal/percpu_tcmalloc.h:332:18: error: invalid output constraint '=@ccae' in asm
      [overflow] "=@ccae"(overflow)
                 ^
external/com_github_google_tcmalloc/tcmalloc/internal/percpu_tcmalloc.h:459:25: error: invalid output constraint '=@ccbe' in asm
            [underflow] "=@ccbe"(underflow),
                        ^
1 warning and 2 errors generated.
Target //:envoy failed to build
INFO: Elapsed time: 52.329s, Critical Path: 21.65s
INFO: 2526 processes: 2130 internal, 395 processwrapper-sandbox, 1 worker.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully

did a bit of bisecting and I think it started with this commit in main Envoy: envoyproxy/envoy@4c0d2d2'

envoy-filter-example commit: db2cdca

Failed to build with error to `gcc: error: unrecognized command line option`

I couldn't build example filter with a below error.

Error description:

~/envoy-filter-example$ bazel build --verbose_failures //:envoy
INFO: Analyzed target //:envoy (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/kawabe_katsuya/.cache/bazel/_bazel_kawabe_katsuya/30585ce2bf3025fd03c0677be149cc9a/external/com_google_absl/absl/numeric/BUILD.bazel:27:11: C++ compilation of rule '@com_google_absl//absl/numeric:int128' failed (Exit 1): gcc failed: error executing command
  (cd /home/kawabe_katsuya/.cache/bazel/_bazel_kawabe_katsuya/30585ce2bf3025fd03c0677be149cc9a/sandbox/linux-sandbox/5393/execroot/envoy_filter_example && \
  exec env - \
    PATH=/bin:/usr/bin:/usr/local/bin \
    PWD=/proc/self/cwd \
  /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 -fdata-sections '-std=c++0x' -MD -MF bazel-out/host/bin/external/com_google_absl/absl/numeric/_objs/int128/int128.d '-frandom-seed=bazel-out/host/bin/external/com_google_absl/absl/numeric/_objs/int128/int128.o' -iquote external/com_google_absl -iquote bazel-out/host/bin/external/com_google_absl -g0 -g0 -Wall -Wextra -Wcast-qual -Wconversion -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wfor-loop-analysis -Wformat-security -Wgnu-redeclared-enum -Winfinite-recursion -Wliteral-conversion -Wmissing-declarations -Woverlength-strings -Wpointer-arith -Wself-assign -Wshadow -Wstring-conversion -Wtautological-overlap-compare -Wundef -Wuninitialized -Wunreachable-code -Wunused-comparison -Wunused-local-typedefs -Wunused-result -Wvla -Wwrite-strings -Wno-float-conversion -Wno-implicit-float-conversion -Wno-implicit-int-float-conversion -Wno-implicit-int-conversion -Wno-shorten-64-to-32 -Wno-sign-conversion -DNOMINMAX -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/com_google_absl/absl/numeric/int128.cc -o bazel-out/host/bin/external/com_google_absl/absl/numeric/_objs/int128/int128.o)
Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox gcc failed: error executing command
  (cd /home/kawabe_katsuya/.cache/bazel/_bazel_kawabe_katsuya/30585ce2bf3025fd03c0677be149cc9a/sandbox/linux-sandbox/5393/execroot/envoy_filter_example && \
  exec env - \
    PATH=/bin:/usr/bin:/usr/local/bin \
    PWD=/proc/self/cwd \
  /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 -fdata-sections '-std=c++0x' -MD -MF bazel-out/host/bin/external/com_google_absl/absl/numeric/_objs/int128/int128.d '-frandom-seed=bazel-out/host/bin/external/com_google_absl/absl/numeric/_objs/int128/int128.o' -iquote external/com_google_absl -iquote bazel-out/host/bin/external/com_google_absl -g0 -g0 -Wall -Wextra -Wcast-qual -Wconversion -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wfor-loop-analysis -Wformat-security -Wgnu-redeclared-enum -Winfinite-recursion -Wliteral-conversion -Wmissing-declarations -Woverlength-strings -Wpointer-arith -Wself-assign -Wshadow -Wstring-conversion -Wtautological-overlap-compare -Wundef -Wuninitialized -Wunreachable-code -Wunused-comparison -Wunused-local-typedefs -Wunused-result -Wvla -Wwrite-strings -Wno-float-conversion -Wno-implicit-float-conversion -Wno-implicit-int-float-conversion -Wno-implicit-int-conversion -Wno-shorten-64-to-32 -Wno-sign-conversion -DNOMINMAX -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/com_google_absl/absl/numeric/int128.cc -o bazel-out/host/bin/external/com_google_absl/absl/numeric/_objs/int128/int128.o)
Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox
gcc: error: unrecognized command line option '-Wfloat-overflow-conversion'; did you mean '-Wfloat-conversion'?
gcc: error: unrecognized command line option '-Wfloat-zero-conversion'; did you mean '-Wfloat-conversion'?
gcc: error: unrecognized command line option '-Wfor-loop-analysis'
gcc: error: unrecognized command line option '-Wgnu-redeclared-enum'
gcc: error: unrecognized command line option '-Winfinite-recursion'; did you mean '-finit-real=snan'?
gcc: error: unrecognized command line option '-Wliteral-conversion'; did you mean '-Wfloat-conversion'?
gcc: error: unrecognized command line option '-Wself-assign'; did you mean '-Wcast-align'?
gcc: error: unrecognized command line option '-Wstring-conversion'; did you mean '-Wint-conversion'?
gcc: error: unrecognized command line option '-Wtautological-overlap-compare'; did you mean '-Wtautological-compare'?
gcc: error: unrecognized command line option '-Wunused-comparison'; did you mean '-Wunused-function'?
Target //:envoy failed to build
INFO: Elapsed time: 0.891s, Critical Path: 0.37s
INFO: 18 processes: 17 internal, 1 linux-sandbox.
FAILED: Build did NOT complete successfully

Environment:

gcc

gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

g++

g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

bazel

Bazelisk version: v1.7.5
Build label: 3.7.2
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Dec 17 16:57:23 2020 (1608224243)
Build timestamp: 1608224243
Build timestamp as int: 1608224243

HTTP filter example

Currently only L4 (TCP) filter are there, it would be nice to have HTTP filter example too.

build error no such package '@envoy_deps//': External dep build failed and referenced by '//external:tcmalloc_and_profiler'

I build it on MacOS.
I update code and build with "bazel build ://http-filter-example:envoy" Under the root directory but failed... err msg is :
make: *** [/private/var/tmp/_bazel_root/1aaa4e112752cd596b47f9795fb7a4b5/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/cares.dep] Error 1
DEBUG: /private/var/tmp/_bazel_root/1aaa4e112752cd596b47f9795fb7a4b5/external/envoy/bazel/repositories.bzl:120:5: External dep build exited with return code: 2
DEBUG: /private/var/tmp/_bazel_root/1aaa4e112752cd596b47f9795fb7a4b5/external/envoy/bazel/repositories.bzl:122:9: External dependency build failed, check above log for errors and ensure all prerequisites at https://github.com/envoyproxy/envoy/blob/master/bazel/README.md#quick-start-bazel-build-for-developers are met.
ERROR: /private/var/tmp/_bazel_root/1aaa4e112752cd596b47f9795fb7a4b5/external/envoy/bazel/repositories.bzl:271:13: no such package '@envoy_deps//': External dep build failed and referenced by '//external:tcmalloc_and_profiler'
ERROR: Analysis of target '//http-filter-example:envoy' failed; build aborted: Analysis failed
INFO: Elapsed time: 339.572s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (41 packages loaded)

anyone can help me???

Bazel build error when using lyft/envoy-build:latest and CI scripts

I'm attempting to build Envoy and test the example filter but keep hitting the same build issue. I first encountered this attempting to run Bazel on Mac but I can reproduce it using the Docker build container as well. I've gone though the quick-start-bazel-build-for-developers locally and also tried the CI build described here but the command ./ci/run_envoy_docker.sh './ci/do_ci.sh bazel.dev' also fails.

This issue uses directions in both this repo and the envoy main repo, if it should be moved there let me know.

CI run error:

› ./ci/run_envoy_docker.sh './ci/do_ci.sh bazel.dev'
Unable to find image 'lyft/envoy-build:b3542cdfe76e7e46c276c781935d339d4ecd0502' locally
b3542cdfe76e7e46c276c781935d339d4ecd0502: Pulling from lyft/envoy-build
<snip>
Cloning into '/build/envoy-filter-example'...
remote: Counting objects: 73, done.
remote: Total 73 (delta 0), reused 0 (delta 0), pack-reused 73
Unpacking objects: 100% (73/73), done.
Checking connectivity... done.
Note: checking out 'b904b8ce9cabafb485e6b6fae1d0fd9e33ddfcc1'.
<snip>
HEAD is now at b904b8c... filters: remove deprecated type(). (#19)
building using 4 CPUs
clang-5.0/clang++-5.0 toolchain configured
bazel fastbuild build with tests...
Building...
INFO: $TEST_TMPDIR defined: output root default is '/build/tmp'.
Extracting Bazel installation...
INFO: Analysed target //source/exe:envoy-static (83 packages loaded).
INFO: Found 1 target...
ERROR: Process exited with status 1: Process exited with status 1
fatal: Not a git repository: ../.git/modules/envoy
Target //source/exe:envoy-static failed to build
INFO: Elapsed time: 46.147s, Critical Path: 0.11s
FAILED: Build did NOT complete successfully

When running the Bazel command directly on the build image the issue also occurs. The issue remains if I don't mount /root/.cache/bazel into the host's /tmp/ as well. The Docker image of lyft/envoy-build:latest was pulled today.

› docker run -v /tmp/bazel_cache:/root/.cache/bazel -v pwd:/envoy-filter-example -w /envoy-filter-example -it lyft/envoy-build:latest bazel build //:envoy
.
External dependency cache directory /root/.cache/bazel/_bazel_root/2689a15d13c8176e302c46da5aa07874/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f
make: Entering directory '/root/.cache/bazel/_bazel_root/2689a15d13c8176e302c46da5aa07874/external/envoy_deps'
make: '/root/.cache/bazel/_bazel_root/2689a15d13c8176e302c46da5aa07874/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/cares.dep' is up to date.
<snip>

real	0m0.099s
user	0m0.000s
sys	0m0.000s
DEBUG: /root/.cache/bazel/_bazel_root/2689a15d13c8176e302c46da5aa07874/external/envoy/bazel/repositories.bzl:18:5: Fetching external dependencies...
DEBUG: /root/.cache/bazel/_bazel_root/2689a15d13c8176e302c46da5aa07874/external/envoy/bazel/repositories.bzl:24:5:
DEBUG: /root/.cache/bazel/_bazel_root/2689a15d13c8176e302c46da5aa07874/external/envoy/bazel/repositories.bzl:25:5: External dependency cache directory /root/.cache/bazel/_bazel_root/2689a15d13c8176e302c46da5aa07874/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f
make: Entering directory '/root/.cache/bazel/_bazel_root/2689a15d13c8176e302c46da5aa07874/external/envoy_deps'
make: '/root/.cache/bazel/_bazel_root/2689a15d13c8176e302c46da5aa07874/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/cares.dep' is up to date.
<snip>

real	0m0.099s
user	0m0.000s
sys	0m0.000s
DEBUG: /root/.cache/bazel/_bazel_root/2689a15d13c8176e302c46da5aa07874/external/envoy/bazel/repositories.bzl:26:5: External dep build exited with return code: 0
ERROR: in target '//external:cc_toolchain': error loading package '@local_config_cc//': Extension file not found. Unable to load file '@local_config_cc//:dummy_toolchain.bzl': file doesn't exist or isn't a file
INFO: Elapsed time: 3.278s
FAILED: Build did NOT complete successfully (4 packages loaded)
 currently loading: @local_config_cc// ... (2 packages)

Help Wanted! Creating a custom envoy docker image

Hello!, I wrote a custom http filter for envoy (following the sample available here). I am able to build the project and generate an envoy static binary using bazel build //http-filter-example:envoy. I tried to generate a docker image for envoy with this custom filter included following the documentation here but it doesn't seem to factor in the custom filter I added.

How do I go about creating a custom docker image for envoy with the filter that I just added?

Sorry, I am new to envoy and bazel and I apologize if I am asking something that is already documented somewhere.

Thanks!

some error when compilation on arm64

I cannot use bazel build //:envoy or ./ci/do_ci.sh build to compile envoy with out tree filter on arm64 cpu (centos).
uname -a: Linux ecs-526c-0002 4.18.0-80.7.2.el7.aarch64 #1 SMP Thu Sep 12 16:13:20 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux
detail message: envoyproxy/envoy#13668

build fails for filter example - no such package

I have tried the build according to the steps mentioned in the README. The build fails with the error below

/envoy-filter-example$ bazel build //:envoy
Starting local Bazel server and connecting to it...
ERROR: /home/jyoti/.cache/bazel/_bazel_jyoti/d7dbc3ad28d2496ca23a589bf2a3c01f/external/envoy/bazel/foreign_cc/BUILD:8:1: no such package '@com_github_gperftools_gperftools//': Traceback (most recent call last):
File "/home/jyoti/.cache/bazel/_bazel_jyoti/d7dbc3ad28d2496ca23a589bf2a3c01f/external/bazel_tools/tools/build_defs/repo/http.bzl", line 55
patch(ctx)
File "/home/jyoti/.cache/bazel/_bazel_jyoti/d7dbc3ad28d2496ca23a589bf2a3c01f/external/bazel_tools/tools/build_defs/repo/utils.bzl", line 89, in patch
fail(("Error applying patch command %...)))
Error applying patch command ./autogen.sh:
./autogen.sh: 3: ./autogen.sh: autoreconf: not found
and referenced by '@envoy//bazel/foreign_cc:gperftools_build'
ERROR: Analysis of target '//:envoy' failed; build aborted: no such package '@com_github_gperftools_gperftools//': Traceback (most recent call last):
File "/home/jyoti/.cache/bazel/_bazel_jyoti/d7dbc3ad28d2496ca23a589bf2a3c01f/external/bazel_tools/tools/build_defs/repo/http.bzl", line 55
patch(ctx)
File "/home/jyoti/.cache/bazel/_bazel_jyoti/d7dbc3ad28d2496ca23a589bf2a3c01f/external/bazel_tools/tools/build_defs/repo/utils.bzl", line 89, in patch
fail(("Error applying patch command %...)))
Error applying patch command ./autogen.sh:
./autogen.sh: 3: ./autogen.sh: autoreconf: not found
INFO: Elapsed time: 25.181s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (17 packages loaded, 149 targets configured)

Please help me resolve this error

Build fails repeatedly, with different errors

I'm following the README but compilation initially fails with the following message:

mac-se-catper:envoy-filter-example catper$ bazel build //:envoy --verbose_failures
INFO: Analyzed target //:envoy (540 packages loaded, 19946 targets configured).
INFO: Found 1 target...
INFO: From Executing genrule @com_lightstep_tracer_cpp//:generate_version_h:
CMake Warning at CMakeLists.txt:51 (message):
  WITH_GRPC is not set; building without dynamic loading support.


-- The C compiler identification is AppleClang 10.0.1.10010046
-- The CXX compiler identification is AppleClang 10.0.1.10010046
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/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: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/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: /var/folders/0g/_kqmbj9x4v7d5rqfj67cq73m1x__yj/T/tmp.jftkhykW
-- Cache values
BUILD_SHARED_LIBS:BOOL=ON
BUILD_STATIC_LIBS:BOOL=ON
CMAKE_BUILD_TYPE:STRING=
CMAKE_EXECUTABLE_FORMAT:STRING=MACHO
CMAKE_INSTALL_PREFIX:PATH=/usr/local
CMAKE_OSX_ARCHITECTURES:STRING=
CMAKE_OSX_DEPLOYMENT_TARGET:STRING=
CMAKE_OSX_SYSROOT:PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk
DEFAULT_SSL_ROOTS_PEM:STRING=
ENABLE_LINTING:BOOL=OFF
HEADERS_ONLY:BOOL=ON
WITH_DYNAMIC_LOAD:BOOL=ON
WITH_GRPC:BOOL=OFF
INFO: From Executing genrule @io_opentracing_cpp//:generate_version_h:
-- The C compiler identification is AppleClang 10.0.1.10010046
-- The CXX compiler identification is AppleClang 10.0.1.10010046
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/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: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/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: /var/folders/0g/_kqmbj9x4v7d5rqfj67cq73m1x__yj/T/tmp.cO6Dizd4
-- 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_EXECUTABLE_FORMAT:STRING=MACHO
CMAKE_INSTALL_PREFIX:PATH=/usr/local
CMAKE_OSX_ARCHITECTURES:STRING=
CMAKE_OSX_DEPLOYMENT_TARGET:STRING=
CMAKE_OSX_SYSROOT:PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk
ENABLE_LINTING:BOOL=ON
ERROR: /private/var/tmp/_bazel_catper/02761ffba8886e583e02dddfa163ae93/external/com_google_protobuf/BUILD:117:1: C++ compilation of rule '@com_google_protobuf//:protobuf_lite' failed (Exit 1) cc_wrapper.sh failed: error executing command
  (cd /private/var/tmp/_bazel_catper/02761ffba8886e583e02dddfa163ae93/sandbox/darwin-sandbox/209/execroot/envoy_filter_example && \
  exec env - \
    PATH=/bin:/usr/bin:/usr/local/bin \
    PWD=/proc/self/cwd \
  external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/host/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.d '-frandom-seed=bazel-out/host/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.o' -iquote external/com_google_protobuf -iquote bazel-out/host/bin/external/com_google_protobuf -isystem external/com_google_protobuf/src -isystem bazel-out/host/bin/external/com_google_protobuf/src -g0 -g0 -DHAVE_PTHREAD -DHAVE_ZLIB -Woverloaded-virtual -Wno-sign-compare -Wno-unused-function -Wno-write-strings -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/com_google_protobuf/src/google/protobuf/io/coded_stream.cc -o bazel-out/host/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.o)
Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox
external/com_google_protobuf/src/google/protobuf/io/coded_stream.cc:915:15: error: cannot initialize a parameter of type 'google::protobuf::uint8 *' (aka 'unsigned char *') with an rvalue of type 'google::protobuf::uint8 **' (aka 'unsigned char **')
  EnsureSpace(&ptr);
              ^~~~
/usr/local/include/google/protobuf/io/coded_stream.h:688:54: note: passing argument to parameter 'ptr' here
  PROTOBUF_MUST_USE_RESULT uint8* EnsureSpace(uint8* ptr) {
                                                     ^
external/com_google_protobuf/src/google/protobuf/io/coded_stream.cc:923:15: error: cannot initialize a parameter of type 'google::protobuf::uint8 *' (aka 'unsigned char *') with an rvalue of type 'google::protobuf::uint8 **' (aka 'unsigned char **')
  EnsureSpace(&ptr);
              ^~~~
/usr/local/include/google/protobuf/io/coded_stream.h:688:54: note: passing argument to parameter 'ptr' here
  PROTOBUF_MUST_USE_RESULT uint8* EnsureSpace(uint8* ptr) {
                                                     ^
2 errors generated.
Target //:envoy failed to build
INFO: Elapsed time: 7.244s, Critical Path: 5.55s
INFO: 15 processes: 15 darwin-sandbox.
FAILED: Build did NOT complete successfully

If I then, just to see what happens, try executing the build again, I get another error message:

mac-se-catper:envoy-filter-example catper$ bazel build //:envoy --verbose_failures
INFO: Analyzed target //:envoy (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /private/var/tmp/_bazel_catper/02761ffba8886e583e02dddfa163ae93/external/com_google_protobuf/BUILD:117:1: C++ compilation of rule '@com_google_protobuf//:protobuf_lite' failed (Exit 1) cc_wrapper.sh failed: error executing command
  (cd /private/var/tmp/_bazel_catper/02761ffba8886e583e02dddfa163ae93/sandbox/darwin-sandbox/230/execroot/envoy_filter_example && \
  exec env - \
    PATH=/bin:/usr/bin:/usr/local/bin \
    PWD=/proc/self/cwd \
  external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/host/bin/external/com_google_protobuf/_objs/protobuf_lite/arena.d '-frandom-seed=bazel-out/host/bin/external/com_google_protobuf/_objs/protobuf_lite/arena.o' -iquote external/com_google_protobuf -iquote bazel-out/host/bin/external/com_google_protobuf -isystem external/com_google_protobuf/src -isystem bazel-out/host/bin/external/com_google_protobuf/src -g0 -g0 -DHAVE_PTHREAD -DHAVE_ZLIB -Woverloaded-virtual -Wno-sign-compare -Wno-unused-function -Wno-write-strings -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/com_google_protobuf/src/google/protobuf/arena.cc -o bazel-out/host/bin/external/com_google_protobuf/_objs/protobuf_lite/arena.o)
Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox
external/com_google_protobuf/src/google/protobuf/arena.cc:147:1: warning: attribute declaration must precede definition [-Wignored-attributes]
PROTOBUF_FUNC_ALIGN(32)
^
/usr/local/include/google/protobuf/port_def.inc:207:51: note: expanded from macro 'PROTOBUF_FUNC_ALIGN'
#define PROTOBUF_FUNC_ALIGN(bytes) __attribute__((aligned(bytes)))
                                                  ^
/usr/local/include/google/protobuf/arena_impl.h:110:9: note: previous definition is here
  void* AllocateAligned(size_t n) {
        ^
external/com_google_protobuf/src/google/protobuf/arena.cc:148:18: error: redefinition of 'AllocateAligned'
void* ArenaImpl::AllocateAligned(size_t n) {
                 ^
/usr/local/include/google/protobuf/arena_impl.h:110:9: note: previous definition is here
  void* AllocateAligned(size_t n) {
        ^
external/com_google_protobuf/src/google/protobuf/arena.cc:192:47: error: redefinition of 'GetSerialArenaFast'
inline PROTOBUF_ALWAYS_INLINE bool ArenaImpl::GetSerialArenaFast(
                                              ^
/usr/local/include/google/protobuf/arena_impl.h:331:31: note: previous definition is here
  PROTOBUF_ALWAYS_INLINE bool GetSerialArenaFast(SerialArena** arena) {
                              ^
1 warning and 2 errors generated.
Target //:envoy failed to build
ERROR: /private/var/tmp/_bazel_catper/02761ffba8886e583e02dddfa163ae93/external/envoy_api/envoy/annotations/BUILD:5:1 C++ compilation of rule '@com_google_protobuf//:protobuf_lite' failed (Exit 1) cc_wrapper.sh failed: error executing command
  (cd /private/var/tmp/_bazel_catper/02761ffba8886e583e02dddfa163ae93/sandbox/darwin-sandbox/230/execroot/envoy_filter_example && \
  exec env - \
    PATH=/bin:/usr/bin:/usr/local/bin \
    PWD=/proc/self/cwd \
  external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/host/bin/external/com_google_protobuf/_objs/protobuf_lite/arena.d '-frandom-seed=bazel-out/host/bin/external/com_google_protobuf/_objs/protobuf_lite/arena.o' -iquote external/com_google_protobuf -iquote bazel-out/host/bin/external/com_google_protobuf -isystem external/com_google_protobuf/src -isystem bazel-out/host/bin/external/com_google_protobuf/src -g0 -g0 -DHAVE_PTHREAD -DHAVE_ZLIB -Woverloaded-virtual -Wno-sign-compare -Wno-unused-function -Wno-write-strings -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/com_google_protobuf/src/google/protobuf/arena.cc -o bazel-out/host/bin/external/com_google_protobuf/_objs/protobuf_lite/arena.o)
Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox
INFO: Elapsed time: 1.682s, Critical Path: 1.39s
INFO: 6 processes: 6 darwin-sandbox.
FAILED: Build did NOT complete successfully
mac-se-catper:envoy-filter-example catper$

I haven't changed anything from cloning the project, I'm just trying to compile the provided example. FWIW I am able to build Envoy in "stand-alone mode", i.e. if I clone and build envoy outside of the context of trying to incorporate a new filter, I have no issues.

If anyone has an idea as to what's going on here please let me know. Thanks!

create filter with external deps cryptopp

Hi,

Do we have samples on how to add external deps on a filter using the bazel BUILD/WORKSPACE for eg., in my case I would like to add the crytopp dependency into my filter.

Thanks
Bharath

build process consistency (dev-tooling)

I know it's an example project, but after fighting a bit with bazel or more so (ccache and fedora 28) and almost giving up, I went to the "main repo" and had a look at the docs and because you folks are so nice, there are bunch of Images + scripts that wrap away all the nastiness of dependencies and tooling.

One just needs
https://github.com/envoyproxy/envoy/blob/master/ci/run_envoy_docker.sh
https://github.com/envoyproxy/envoy/blob/master/ci/envoy_build_sha.sh
copy the binary out of bazel-bin to a mount point and you are set.

I know keeping this in sync with the main project is a Sisyphus work and it doenst have to be the fully fledged dev loving tooling like https://github.com/envoyproxy/envoy/tree/master/ci, but those 2 scripts get you started really quick. Is actually doing what .circleci/config.yaml does but for devs.

I know nothing about bazel, but the scripts are not that complex. Might learn a thing or two on the way The build dir is not being used and I have to copy the binary out of bazel-bin before leaving the container. The bazel-dir is not working on the host due to symlinks, but that's not that awful. I'll give a go this weekend.

run http filter example error, How to solve?

[2020-05-27 10:41:10.052][457426][debug][config] [external/envoy/source/extensions/filters/network/http_connection_manager/config.cc:446] http filter #0
[2020-05-27 10:41:10.052][457426][debug][config] [external/envoy/source/extensions/filters/network/http_connection_manager/config.cc:447] name: sample
[2020-05-27 10:41:10.052][457426][debug][config] [external/envoy/source/extensions/filters/network/http_connection_manager/config.cc:454] config: {}

[2020-05-27 10:41:10.052][457426][debug][misc] [external/envoy/source/common/protobuf/utility.cc:255] Proto validation error; throwing Proto constraint validation failed (DecoderValidationError.Key: ["value length must be at least " '\x01' " bytes"]):
[2020-05-27 10:41:10.053][457426][debug][init] [external/envoy/source/common/init/watcher_impl.cc:27] Listener-local-init-watcher 4628fb28-aad4-441e-bdb1-1e8de7e423e8 destroyed
[2020-05-27 10:41:10.053][457426][debug][init] [external/envoy/source/common/init/watcher_impl.cc:27] init manager Listener-local-init-manager 4628fb28-aad4-441e-bdb1-1e8de7e423e8 14773217957741281905 destroyed
[2020-05-27 10:41:10.053][457426][debug][init] [external/envoy/source/common/init/target_impl.cc:32] target Listener-init-target 4628fb28-aad4-441e-bdb1-1e8de7e423e8 destroyed
[2020-05-27 10:41:10.055][457426][critical][main] [external/envoy/source/server/server.cc:95] error initializing configuration 'envoy.yaml': Proto constraint validation failed (DecoderValidationError.Key: ["value length must be at least " '\x01' " bytes"]):
[2020-05-27 10:41:10.055][457426][debug][init] [external/envoy/source/common/init/watcher_impl.cc:27] ClusterImplBase destroyed
[2020-05-27 10:41:10.055][457426][debug][init] [external/envoy/source/common/init/watcher_impl.cc:27] init manager Cluster ping-service destroyed
[2020-05-27 10:41:10.055][457426][debug][grpc] [external/envoy/source/common/grpc/google_async_client_impl.cc:35] Joining completionThread
[2020-05-27 10:41:10.055][457433][debug][grpc] [external/envoy/source/common/grpc/google_async_client_impl.cc:68] completionThread exiting
[2020-05-27 10:41:10.055][457426][debug][grpc] [external/envoy/source/common/grpc/google_async_client_impl.cc:37] Joined completionThread
[2020-05-27 10:41:10.056][457426][debug][upstream] [external/envoy/source/common/upstream/cluster_manager_impl.cc:942] shutting down thread local cluster manager
[2020-05-27 10:41:10.056][457426][info][main] [external/envoy/source/server/server.cc:606] exiting
[2020-05-27 10:41:10.056][457426][debug][main] [external/envoy/source/common/access_log/access_log_manager_impl.cc:16] destroying access logger /dev/stdout
[2020-05-27 10:41:10.057][457426][debug][main] [external/envoy/source/common/access_log/access_log_manager_impl.cc:16] destroying access logger /dev/null
[2020-05-27 10:41:10.057][457426][debug][main] [external/envoy/source/common/access_log/access_log_manager_impl.cc:19] destroyed access loggers
[2020-05-27 10:41:10.059][457426][debug][init] [external/envoy/source/common/init/watcher_impl.cc:27] init manager Server destroyed
Proto constraint validation failed (DecoderValidationError.Key: ["value length must be at least " '\x01' " bytes"]):

Not able to run envoy after build is successful.

I am trying to run envoy with the custom http filter present in http-filter-example folder.
Repo : https://github.com/envoyproxy/envoy-filter-example/tree/master/http-filter-example
Steps followed.

  1. Cloned the repo
  2. build using
    git submodule update --init
    bazel build //http-filter-example:envoy

Build was successful. After build was successful, envoy binary was generated inside http-filter-example ---- bazel bin folder.
Now I am trying to run envoy file front-envoy.yaml using sample filter.

front-envoy.yaml

static_resources:
  listeners:
  - name: listener_0
    address:
      socket_address: { address: 0.0.0.0, port_value: 10000}
    filter_chains:
    - filters:
      - name: envoy.http_connection_manager
        config:
          use_remote_address: true
          stat_prefix: ingress_http
          codec_type: AUTO
          route_config:
            name: remote_api
            virtual_hosts:
            - name: api
              domains:
              - "*"
              routes:
              - match:
                  prefix: "/"
                route:
                  cluster: api
 
          http_filters:
            - name: sample
              typed_config:
                "@type": type.googleapis.com/sample.Decoder
                key: via
                val: sample-filter
            - name: envoy.router
              typed_config: {}           
  clusters:
  - name: api
    connect_timeout: 1s
    type: strict_dns
    lb_policy: round_robin
    hosts:
    - socket_address:
        address: localhost
        port_value: 8000
  - name: rate_limit_cluster
    type: strict_dns
    connect_timeout: 0.25s
    lb_policy: round_robin
    http2_protocol_options: {}
    hosts:
    - socket_address:
        address: localhost
        port_value: 8081

But while running ./envoy --config-path front-envoy.yaml command I am getting below error:
dyld: Symbol not found: _program_invocation_name
Referenced from: /private/var/tmp/_bazel_prince.kumar/77a930df3acbb1cb74b82e11b4381bd4/execroot/envoy_filter_example/bazel-out/darwin-fastbuild/bin/http-filter-example/./envoy
Expected in: flat namespace
in /private/var/tmp/_bazel_prince.kumar/77a930df3acbb1cb74b82e11b4381bd4/execroot/envoy_filter_example/bazel-out/darwin-fastbuild/bin/http-filter-example/./envoy

I tried installing Xcode10 and followed steps
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
Still getting same issue.

Mac OS :Mojave, 10.14.6
Xcode version : 10
Bazel version: bazel 3.4.1

build error gcc: error trying to exec '/usr/lib/gcc/x86_64-linux-gnu/7/cc1plus': execv: Argument list too long

gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)

ERROR: /home/ubuntu/.cache/bazel/_bazel_ubuntu/3577de60e542174ece7fd3dd4ebef4be/external/envoy/source/exe/BUILD:58:17: C++ compilation of rule
'@envoy//source/exe:main_common_lib' failed (Exit 1) gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wa
ll -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -MD -MF ... (remaining 1321 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
gcc: error trying to exec '/usr/lib/gcc/x86_64-linux-gnu/7/cc1plus': execv: Argument list too long
Target //:envoy failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 4.670s, Critical Path: 4.08s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

question about the filter

I want to add a filter, and by judging if the traffic is in order, if it is not satisfied, it will return directly to the back end. I want to know whether it should inherit from the treamDecoderFilter, and what can I do to stop the back end service,Like the state of the return code tatus or something

thank you

osx "bazel test" fails with "dyld: Symbol not found: _program_invocation_name"

OSX 10.15.4

bazel: stable 3.0.0 (bottled)

-- The C compiler identification is AppleClang 11.0.3.11030032
-- The CXX compiler identification is AppleClang 11.0.3.11030032
$ bazel test //:echo2_integration_test

DEBUG: _/private/var/tmp/_bazeluser/a9fc29333019096f53a1d7073ad2f2d9/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:68:9:_
Current running Bazel is ahead of bazel-toolchains repo. Please update your pin to bazel-toolchains repo in your WORKSPACE file.
DEBUG: /private/var/tmp/_bazel_user/a9fc29333019096f53a1d7073ad2f2d9/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:68:9:
Current running Bazel is ahead of bazel-toolchains repo. Please update your pin to bazel-toolchains repo in your WORKSPACE file.
DEBUG: /private/var/tmp/_bazel_user/a9fc29333019096f53a1d7073ad2f2d9/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:68:9:
Current running Bazel is ahead of bazel-toolchains repo. Please update your pin to bazel-toolchains repo in your WORKSPACE file.
INFO: Analyzed target //:echo2_integration_test (0 packages loaded, 0 targets configured).
INFO: Found 1 test target...
FAIL: //:echo2_integration_test (see /private/var/tmp/_bazel_user/a9fc29333019096f53a1d7073ad2f2d9/execroot/envoy_filter_example/bazel-out/darwin-fastbuild/testlogs/echo2_integration_test/test.log)
Target //:echo2_integration_test up-to-date:
  bazel-bin/echo2_integration_test
INFO: Elapsed time: 0.591s, Critical Path: 0.18s
INFO: 2 processes: 2 darwin-sandbox.
INFO: Build completed, 1 test FAILED, 2 total actions
//:echo2_integration_test                                                FAILED in 0.1s
  /private/var/tmp/_bazel_user/a9fc29333019096f53a1d7073ad2f2d9/execroot/envoy_filter_example/bazel-out/darwin-fastbuild/testlogs/echo2_integration_test/test.log

INFO: Build completed, 1 test FAILED, 2 total actions
$ cat /private/var/tmp/_bazel_user/a9fc29333019096f53a1d7073ad2f2d9/execroot/envoy_filter_example/bazel-out/darwin-fastbuild/testlogs/echo2_integration_test/test.log
exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //:echo2_integration_test
-----------------------------------------------------------------------------
dyld: Symbol not found: _program_invocation_name
  Referenced from: /private/var/tmp/_bazel_user/a9fc29333019096f53a1d7073ad2f2d9/sandbox/darwin-sandbox/4181/execroot/envoy_filter_example/bazel-out/darwin-fastbuild/bin/echo2_integration_test.runfiles/envoy_filter_example/echo2_integration_test
  Expected in: flat namespace
 in /private/var/tmp/_bazel_user/a9fc29333019096f53a1d7073ad2f2d9/sandbox/darwin-sandbox/4181/execroot/envoy_filter_example/bazel-out/darwin-fastbuild/bin/echo2_integration_test.runfiles/envoy_filter_example/echo2_integration_test
external/bazel_tools/tools/test/test-setup.sh: line 310: 19225 Abort trap: 6

test coverage

I am trying to get the test coverage for a filter written on top of envoy similar to http filter example. Was wondering if anyone has tried this before and what approach they took?

Target //http-filter-example:envoy failed to build

I have tried to build http-filter-example following README. The build fails with the error below

ERROR: /source/http-filter-example/BUILD:37:1: C++ compilation of rule '//http-filter-example:http_filter_config' 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 917 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
http-filter-example/http_filter_config.cc: In member function 'virtual Envoy::Http::FilterFactoryCb Envoy::Server::Configuration::HttpSampleDecoderFilterConfig::createFilterFactoryFromProto(const google::protobuf::Message&, const string&, Envoy::Server::Configuration::FactoryContext&)':
http-filter-example/http_filter_config.cc:31:85: error: no matching function for call to 'Envoy::MessageUtil::downcastAndValidate<const sample::Decoder&>(const google::protobuf::Message&)'
         Envoy::MessageUtil::downcastAndValidate<const sample::Decoder&>(proto_config), context);
                                                                                     ^
In file included from bazel-out/k8-fastbuild/bin/external/envoy/include/envoy/upstream/_virtual_includes/locality_lib/envoy/upstream/locality.h:5:0,
                 from bazel-out/k8-fastbuild/bin/external/envoy/include/envoy/upstream/_virtual_includes/upstream_interface/envoy/upstream/upstream.h:22,
                 from bazel-out/k8-fastbuild/bin/external/envoy/include/envoy/grpc/_virtual_includes/context_interface/envoy/grpc/context.h:6,
                 from bazel-out/k8-fastbuild/bin/external/envoy/include/envoy/server/_virtual_includes/filter_config_interface/envoy/server/filter_config.h:7,
                 from http-filter-example/http_filter.h:5,
                 from http-filter-example/http_filter_config.cc:3:
bazel-out/k8-fastbuild/bin/external/envoy/source/common/protobuf/_virtual_includes/utility_lib/common/protobuf/utility.h:275:3: note: candidate: template<class MessageType> static const MessageType& Envoy::MessageUtil::downcastAndValidate(const google::protobuf::Message&, Envoy::ProtobufMessage::ValidationVisitor&)
   downcastAndValidate(const Protobuf::Message& config,
   ^~~~~~~~~~~~~~~~~~~
bazel-out/k8-fastbuild/bin/external/envoy/source/common/protobuf/_virtual_includes/utility_lib/common/protobuf/utility.h:275:3: note:   template argument deduction/substitution failed:
http-filter-example/http_filter_config.cc:31:85: note:   candidate expects 2 arguments, 1 provided
         Envoy::MessageUtil::downcastAndValidate<const sample::Decoder&>(proto_config), context);
                                                                                     ^
Target //http-filter-example:envoy failed to build

http-filter-example test fails

compilation errors when testing http-filter-example from commit d87ee2c4024703b8cf379f0b5c0ebc345ef0de59 on OSX, bazel version 0.6.1

 C++ compilation of rule '//http-filter-example:http_filter_integration_test_lib' failed (Exit 1).
http-filter-example/http_filter_integration_test.cc:33:3: error: unknown type name 'IntegrationCodecClientPtr'; did you mean 'IntegrationTcpClientPtr'?
  IntegrationCodecClientPtr codec_client;
  ^~~~~~~~~~~~~~~~~~~~~~~~~
  IntegrationTcpClientPtr
external/envoy/test/integration/integration.h:98:47: note: 'IntegrationTcpClientPtr' declared here
typedef std::unique_ptr<IntegrationTcpClient> IntegrationTcpClientPtr;
                                              ^
http-filter-example/http_filter_integration_test.cc:38:18: error: use of undeclared identifier 'makeHttpConnection'
  codec_client = makeHttpConnection(lookupPort("http"), Http::CodecClient::Type::HTTP1);
                 ^
http-filter-example/http_filter_integration_test.cc:39:17: error: no member named 'makeHeaderOnlyRequest' in 'Envoy::IntegrationTcpClient'
  codec_client->makeHeaderOnlyRequest(headers, *response);
  ~~~~~~~~~~~~  ^
http-filter-example/http_filter_integration_test.cc:41:63: error: too few arguments to function call, at least argument 'client_dispatcher' must be specified
  request_stream = fake_upstream_connection->waitForNewStream();
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
external/envoy/test/integration/fake_upstream.h:219:3: note: 'waitForNewStream' declared here
  FakeStreamPtr waitForNewStream(Event::Dispatcher& client_dispatcher,
  ^
4 errors generated.
Target //http-filter-example:http_filter_integration_test failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 4.386s, Critical Path: 3.76s

Executed 0 out of 1 test: 1 fails to build.

C++ compilation error during build

While trying the steps mentioned in https://github.com/lyft/envoy-filter-example/tree/master/http-filter-example, the build(bazel build //http-filter-example:envoy) gives a compilation error on mac:

C++ compilation of rule '@envoy//source/common/router:config_lib' failed .

Following is the exception in detail:

ERROR: >/private/var/tmp/_bazel_smenon2/8057895bf9b56d918b0676d518f20623/external/envoy/source/>common/router/BUILD:11:1: C++ compilation of rule '@envoy//source/common/router:config_lib' >failed (Exit 1).
external/envoy/source/common/router/config_impl.cc:562:64: error: default initialization of an >object of const type 'const VirtualHostImpl::CatchAllVirtualCluster' without a user-provided default >constructor
const VirtualHostImpl::CatchAllVirtualCluster VirtualHostImpl::VIRTUAL_CLUSTER_CATCH_ALL;
^
{}
external/envoy/source/common/router/config_impl.cc:563:39: error: default initialization of an >object of const type 'const Envoy::Router::SslRedirector' without a user-provided default >constructor
const SslRedirector SslRedirectRoute::SSL_REDIRECTOR;

Do let me know if you think I might be doing something wrong.

How to get upstream host from filter!!

Is there a way to get upstream host from http filter or network filter? callbacks_->streamInfo().upstreamHost() is alway nullptr. Basically, the custom filter needs to get lb-selected upstream host. Is it possible? I tried with upstream network filter. But upstreamHost is always nullptr. Please help.

Error in README.md

There seems a minor error in the README.md "How It works" section. It says "@envoy//source/exe:envoy_main_lib" which should be changed to "@envoy//source/exe:envoy_main_entry_lib" based on the BUILD file.

Would suggest correct the README since most reader of it would be people just started learning envoy (and probably new to bazel as well).

Unable to reference to envoy grpc proto when using envoy 1.8.0

I am using the http-filter-example template to implement a custom envoy http filter of my own. In the filter config i need a reference to api/envoy/api/v2/core/grpc_service.proto. The following BUILD script was working fine with envoy 1.7.1. But it fails to compile with envoy 1.8.0.

I am new to bazel, and any help will be highly appreciated. I need 1.8.0 for some of the additional capabilities and staying on 1.7.1 is not an option

My filter config file filter_config.proto

syntax = "proto3";
package myproto;

import "validate/validate.proto";
import "envoy/api/v2/core/grpc_service.proto";

message EpmpCmds {
  // The external  gRPC service configuration 
  envoy.api.v2.core.GrpcService cnc_service = 1;

 // additional config -  mostly boolean fields
}

My BUILD file

package(default_visibility = ["//visibility:public"])

load(
    "@envoy//bazel:envoy_build_system.bzl",
    "envoy_cc_binary",
    "envoy_cc_library",
    "envoy_cc_test_library",
    "envoy_cc_test",
)

load("@envoy_api//bazel:api_build_system.bzl", "api_proto_library")

api_proto_library(
    name = "filter_config_proto",
    srcs = ["filter_config.proto"],
    deps = [
        "@envoy_api//envoy/api/v2/core:grpc_service",
    ],
)

// additional lines

Encountered ERROR

DEBUG: /private/var/tmp/_bazel_ajit_verma/1f2dd7d102aa45a25d81491054a38483/external/envoy/bazel/repositories.bzl:120:5: External dep build exited with return code: 0
ERROR: /Users/ajit_verma/Workspace/custom-envoy/epmp/filters/epmp_cmds/BUILD:13:1: target '@envoy_api//envoy/api/v2/core:grpc_service' is not visible from target '//epmp/filters/epmp_cmds:config_proto'. Check the visibility declaration of the former target if you think the dependency is legitimate
ERROR: Analysis of target '//:envoy' failed; build aborted: Analysis of target '//epmp/filters/epmp_cmds:config_proto' failed; build aborted

Building fails by giving the error: Argument list too long compilation terminated.

I have read past closed issues related to this error but nothing worked out. Can anyone please guide me to solve this problem?

ERROR: /home/<user>/.cache/bazel/_bazel_root/3ec64ea2d722c04dac7c46c2d723e18b/external/envoy/source/exe/BUILD:58:17: C++ compilation of rule '@envoy//source/exe:main_common_lib' 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 1447 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox 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 1447 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
gcc: fatal error: cannot execute '/usr/lib/gcc/x86_64-linux-gnu/9/cc1plus': execv: Argument list too long
compilation terminated.
Target //:envoy failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 5.283s, Critical Path: 3.48s
INFO: 6 processes: 6 internal.
FAILED: Build did NOT complete successfully

I tried ulimit -s unlimited, updating GCC, and clang to 9,10. Not sure why it's not working.

Command Used

git submodule update --init
bazel build //:envoy

gcc -v, clang -v and bazel info release

gcc version 9.3.0 (Ubuntu 9.3.0-11ubuntu0~18.04.1)
clang version 10.0.0-4ubuntu1~18.04.2
release 3.7.2

Improve CI and WORKSPACE management in envoy-filter-example

Following up from #62. A few systematic issues we should think about fixing in this repo:

  1. I'm not seeing the .circleci/config.yaml build/test phases running as part of the GH checks here.
  2. It would be nice to get regular nag e-mails from CircleCI when this repo is broken, rather than waiting for folks to discover this and file issues.
  3. We should probably push WORKSPACE directly from envoyproxy, similar to what we do for data-plane-api.

Build with current Envoy master fails immediately

To reproduce clone this repository and follow the instructions.
The build fails immediately before even trying to compile anything:

➜  envoy-filter-example git:(master) git submodule update --init
Submodule 'envoy' (https://github.com/envoyproxy/envoy.git) registered for path 'envoy'
Cloning into '/home/robert/dev/envoy-filter-example/envoy'...
Submodule path 'envoy': checked out '1f9e2fd690e3747017f9e7aa8e6368592f5c71e7'
➜  envoy-filter-example git:(master) bazel build //:envoy -c dbg --strip=never
Starting local Bazel server and connecting to it...
ERROR: Failed to load Starlark extension '@io_bazel_rules_go_compat//:compat.bzl'.
It usually happens when the repository is not defined prior to being used.
Maybe repository 'io_bazel_rules_go_compat' was defined later in your WORKSPACE file?
ERROR: cycles detected during target parsing
INFO: Elapsed time: 2.275s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)

(I also called bazel clean --expunge before)

I am running on Ubuntu 18.04 with Bazel 0.23.1:

➜  envoy-filter-example git:(master) bazel version
Build label: 0.23.1
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Mon Mar 4 10:37:56 2019 (1551695876)
Build timestamp: 1551695876
Build timestamp as int: 1551695876

Build is successful but test are failing with below exception

Thanks for all your help on this

gcc and g++ are below versions:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Thread model: posix
gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)

DEBUG: /root/.cache/bazel/_bazel_root/cd764acb1d1bfad047ee8b5603f1640e/external/envoy/bazel/repositories.bzl:120:5: External dep build exited with return code: 0
INFO: Analysed target //:echo2_integration_test (36 packages loaded).
INFO: Found 1 test target...
ERROR: /root/.cache/bazel/_bazel_root/cd764acb1d1bfad047ee8b5603f1640e/external/envoy/test/mocks/server/BUILD:11:1: C++ compilation of rule '@envoy//test/mocks/server:server_mocks' failed (Exit 4)
gcc: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-7/README.Bugs for instructions.
Target //:echo2_integration_test failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 390.112s, Critical Path: 128.84s
INFO: 39 processes: 39 linux-sandbox.

compile envoy failed error message is unknown type name 'STACK_UNINITIALIZED'

I use build command :

./envoy/ci/run_envoy_docker.sh './ci/do_ci.sh build'

but error happend here:

error description:

Use --sandbox_debug to see verbose messages from the sandbox
external/com_googlesource_googleurl/url/url_util.cc:187:3: error: unknown type name 'STACK_UNINITIALIZED'
  STACK_UNINITIALIZED RawCanonOutputT<CHAR> whitespace_buffer;
  ^
external/com_googlesource_googleurl/url/url_util.cc:187:23: error: template specialization requires 'template<>'
  STACK_UNINITIALIZED RawCanonOutputT<CHAR> whitespace_buffer;

compile command :

Use --sandbox_debug to see verbose messages from the sandbox clang failed: error executing command 
  (cd /build/.cache/bazel/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/sandbox/processwrapper-sandbox/4/execroot/envoy_filter_example && \
  exec env - \
    BAZEL_LINKLIBS=-l%:libstdc++.a \
    BAZEL_LINKOPTS=-lm \
    CC=clang \
    CXX=clang++ \
    PATH=/usr/lib/llvm-8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin \
    PWD=/proc/self/cwd \
  /usr/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer '-std=c++0x' -MD -MF bazel-out/k8-fastbuild/bin/external/com_googlesource_googleurl/url/_objs/url/url_util.pic.d '-frandom-seed=bazel-out/k8-fastbuild/bin/external/com_googlesource_googleurl/url/_objs/url/url_util.pic.o' -fPIC -iquote external/com_googlesource_googleurl -iquote bazel-out/k8-fastbuild/bin/external/com_googlesource_googleurl -iquote external/org_unicode_icuuc -iquote bazel-out/k8-fastbuild/bin/external/org_unicode_icuuc -isystem external/org_unicode_icuuc/icu4c/source/common -isystem bazel-out/k8-fastbuild/bin/external/org_unicode_icuuc/icu4c/source/common -fPIC '-std=c++17' '-std=c++17' -fno-strict-aliasing -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/com_googlesource_googleurl/url/url_util.cc -o bazel-out/k8-fastbuild/bin/external/com_googlesource_googleurl/url/_objs/url/url_util.pic.o)
Execution platform: @local_config_platform//:host

compile environment:

Setting up libclang-common-6.0-dev (1:6.0-1ubuntu2) ...
Setting up libobjc4:amd64 (10.1.0-2ubuntu1~18.04) ...
Setting up libgcc-7-dev:amd64 (7.5.0-3ubuntu1~18.04) ...
Setting up llvm-6.0-runtime (1:6.0-1ubuntu2) ...
mount: /proc/sys/fs/binfmt_misc: permission denied.
update-binfmts: warning: Couldn't mount the binfmt_misc filesystem on /proc/sys/fs/binfmt_misc.
Setting up libstdc++-7-dev:amd64 (7.5.0-3ubuntu1~18.04) ...
Setting up libobjc-7-dev:amd64 (7.5.0-3ubuntu1~18.04) ...
Setting up clang-6.0 (1:6.0-1ubuntu2) ...
Setting up llvm-6.0 (1:6.0-1ubuntu2) ...
Setting up clang (1:6.0-41~exp5~ubuntu1) ...
Setting up llvm-6.0-dev (1:6.0-1ubuntu2) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang/clang++ toolchain configured

Not able to build the executable binary in Ubuntu 20.04 for both gcc and clang

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<size_t>(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.

Envoy tests fail with missing 'protoc'

Following the readme, everything else works, but the last option to run all the envoy tests. It fails with this:

INFO: Found 522 targets and 148 test targets...
ERROR: missing input file '@envoy//ci/prebuilt:thirdparty_build/bin/protoc'.
ERROR: /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy/ci/prebuilt/BUILD:86:1: @envoy//ci/prebuilt:protoc: missing input file '@envoy//ci/prebuilt:thirdparty_build/bin/protoc'.
ERROR: /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy/ci/prebuilt/BUILD:86:1 1 input file(s) do not exist.
INFO: Elapsed time: 456.258s, Critical Path: 0.94s
@envoy//test/common/access_log:access_log_manager_impl_test           NO STATUS
@envoy//test/common/api:api_impl_test                                 NO STATUS
...

However, the build log for protobuf.dep.log shows 'protoc' has been built and installed:

 /bin/mkdir -p '/home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/thirdparty_build/bin'
  /bin/bash ../libtool   --mode=install /usr/bin/install -c protoc '/home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/thirdparty_build/bin'
libtool: install: /usr/bin/install -c protoc /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/thirdparty_build/bin/protoc

And the binary actually runs, too:

~/dev/envoy-filter-example$ /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/thirdparty_build/bin/protoc 
Usage: /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/thirdparty_build/bin/protoc [OPTION] PROTO_FILES
Parse PROTO_FILES and generate output based on the options given:
  -IPATH, --proto_path=PATH   Specify the directory in which to search for
                              imports.  May be specified multiple times;
                              directories will be searched in order.  If not
                              given, the current working directory is used.
  --version                   Show version info and exit.
  -h, --help                  Show this text and exit.
  --encode=MESSAGE_TYPE       Read a text-format message of the given type
                              from standard input and write it in binary
                              to standard output.  The message type must
                              be defined in PROTO_FILES or their imports.
  --decode=MESSAGE_TYPE       Read a binary message of the given type from
                              standard input and write it in text format
                              to standard output.  The message type must
                              be defined in PROTO_FILES or their imports.
  --decode_raw                Read an arbitrary protocol message from
                              standard input and write the raw tag/value
                              pairs in text format to standard output.  No
                              PROTO_FILES should be given when using this
                              flag.
  --descriptor_set_in=FILES   Specifies a delimited list of FILES
                              each containing a FileDescriptorSet (a
                              protocol buffer defined in descriptor.proto).
                              The FileDescriptor for each of the PROTO_FILES
                              provided will be loaded from these
                              FileDescriptorSets. If a FileDescriptor
                              appears multiple times, the first occurrence
                              will be used.
  -oFILE,                     Writes a FileDescriptorSet (a protocol buffer,
    --descriptor_set_out=FILE defined in descriptor.proto) containing all of
                              the input files to FILE.
  --include_imports           When using --descriptor_set_out, also include
                              all dependencies of the input files in the
                              set, so that the set is self-contained.
  --include_source_info       When using --descriptor_set_out, do not strip
                              SourceCodeInfo from the FileDescriptorProto.
                              This results in vastly larger descriptors that
                              include information about the original
                              location of each decl in the source file as
                              well as surrounding comments.
  --dependency_out=FILE       Write a dependency output file in the format
                              expected by make. This writes the transitive
                              set of input file paths to FILE
  --error_format=FORMAT       Set the format in which to print errors.
                              FORMAT may be 'gcc' (the default) or 'msvs'
                              (Microsoft Visual Studio format).
  --print_free_field_numbers  Print the free field numbers of the messages
                              defined in the given proto files. Groups share
                              the same field number space with the parent 
                              message. Extension ranges are counted as 
                              occupied fields numbers.

  --plugin=EXECUTABLE         Specifies a plugin executable to use.
                              Normally, protoc searches the PATH for
                              plugins, but you may specify additional
                              executables not in the path using this flag.
                              Additionally, EXECUTABLE may be of the form
                              NAME=PATH, in which case the given plugin name
                              is mapped to the given executable even if
                              the executable's own name differs.
  --cpp_out=OUT_DIR           Generate C++ header and source.
  --csharp_out=OUT_DIR        Generate C# source file.
  --java_out=OUT_DIR          Generate Java source file.
  --javanano_out=OUT_DIR      Generate Java Nano source file.
  --js_out=OUT_DIR            Generate JavaScript source.
  --objc_out=OUT_DIR          Generate Objective C header and source.
  --php_out=OUT_DIR           Generate PHP source file.
  --python_out=OUT_DIR        Generate Python source file.
  --ruby_out=OUT_DIR          Generate Ruby source file.

This from a freshly cloned lyft/envoy-filter-example, following the instructions on README.md.

Building fails with error: "ld: unknown option: -no-as-needed"

I've installed all requirements, and ran a straight forward bazel build //:envoy and got the following error:

~/git/envoy-filter-example (master ✔) [default2] ᐅ bazel build //:envoy
DEBUG: /private/var/tmp/_bazel_ilaif/d508507cc702a165435e26f4f82e2699/external/io_bazel_rules_go/proto/def.bzl:138:3: You no longer need to call proto_register_toolchains(), it does nothing
DEBUG: /private/var/tmp/_bazel_ilaif/d508507cc702a165435e26f4f82e2699/external/envoy/bazel/repositories.bzl:76:5: Fetching external dependencies...
DEBUG: /private/var/tmp/_bazel_ilaif/d508507cc702a165435e26f4f82e2699/external/envoy/bazel/repositories.bzl:82:5:
DEBUG: /private/var/tmp/_bazel_ilaif/d508507cc702a165435e26f4f82e2699/external/envoy/bazel/repositories.bzl:83:5: External dependency cache directory /private/var/tmp/_bazel_ilaif/d508507cc702a165435e26f4f82e2699/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f
No need to rebuild /private/var/tmp/_bazel_ilaif/d508507cc702a165435e26f4f82e2699/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/gperftools.dep.env
No need to rebuild /private/var/tmp/_bazel_ilaif/d508507cc702a165435e26f4f82e2699/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/cares.dep.env
No need to rebuild /private/var/tmp/_bazel_ilaif/d508507cc702a165435e26f4f82e2699/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/libevent.dep.env
No need to rebuild /private/var/tmp/_bazel_ilaif/d508507cc702a165435e26f4f82e2699/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/benchmark.dep.env
No need to rebuild /private/var/tmp/_bazel_ilaif/d508507cc702a165435e26f4f82e2699/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/luajit.dep.env
No need to rebuild /private/var/tmp/_bazel_ilaif/d508507cc702a165435e26f4f82e2699/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/nghttp2.dep.env
No need to rebuild /private/var/tmp/_bazel_ilaif/d508507cc702a165435e26f4f82e2699/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/yaml-cpp.dep.env
No need to rebuild /private/var/tmp/_bazel_ilaif/d508507cc702a165435e26f4f82e2699/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/zlib.dep.env

real	0m0.254s
user	0m0.044s
sys	0m0.097s
DEBUG: /private/var/tmp/_bazel_ilaif/d508507cc702a165435e26f4f82e2699/external/envoy/bazel/repositories.bzl:84:5: External dep build exited with return code: 0
WARNING: /private/var/tmp/_bazel_ilaif/d508507cc702a165435e26f4f82e2699/external/com_github_grpc_grpc/BUILD:1972:1: in srcs attribute of cc_library rule @com_github_grpc_grpc//:grpc_nanopb: please do not import '@com_github_grpc_grpc//third_party/nanopb:pb_common.c' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'grpc_generate_one_off_targets', the error might have been caused by the macro implementation in /private/var/tmp/_bazel_ilaif/d508507cc702a165435e26f4f82e2699/external/com_github_grpc_grpc/bazel/grpc_build_system.bzl:172:12
WARNING: /private/var/tmp/_bazel_ilaif/d508507cc702a165435e26f4f82e2699/external/com_github_grpc_grpc/BUILD:1972:1: in srcs attribute of cc_library rule @com_github_grpc_grpc//:grpc_nanopb: please do not import '@com_github_grpc_grpc//third_party/nanopb:pb_decode.c' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'grpc_generate_one_off_targets', the error might have been caused by the macro implementation in /private/var/tmp/_bazel_ilaif/d508507cc702a165435e26f4f82e2699/external/com_github_grpc_grpc/bazel/grpc_build_system.bzl:172:12
WARNING: /private/var/tmp/_bazel_ilaif/d508507cc702a165435e26f4f82e2699/external/com_github_grpc_grpc/BUILD:1972:1: in srcs attribute of cc_library rule @com_github_grpc_grpc//:grpc_nanopb: please do not import '@com_github_grpc_grpc//third_party/nanopb:pb_encode.c' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'grpc_generate_one_off_targets', the error might have been caused by the macro implementation in /private/var/tmp/_bazel_ilaif/d508507cc702a165435e26f4f82e2699/external/com_github_grpc_grpc/bazel/grpc_build_system.bzl:172:12
INFO: Analysed target //:envoy (0 packages loaded).
INFO: Found 1 target...
ERROR: /private/var/tmp/_bazel_ilaif/d508507cc702a165435e26f4f82e2699/external/io_bazel_rules_go/BUILD.bazel:9:1: GoStdlib external/io_bazel_rules_go/darwin_amd64_stripped/stdlib~/pkg failed (Exit 1)
# runtime/cgo
ld: unknown option: -no-as-needed
clang: error: linker command failed with exit code 1 (use -v to see invocation)
2018/07/05 19:54:48 error running go install std: exit status 2
Target //:envoy failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 35.676s, Critical Path: 34.50s
INFO: 118 processes: 118 darwin-sandbox.
FAILED: Build did NOT complete successfully
  • I'm running on Mac OS X High Sierra.

Also tried running bazel clean --expunge before building but to no avail.

What might be the problem?

Build fails with bazel 0.7.0.

envoy-filter-example$ bazel build //:envoy
..........
External dependency cache directory /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f
make: Entering directory '/home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps'
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/backward.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/backward.dep.log
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/gcovr.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/gcovr.dep.log
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/cares.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/cares.dep.log
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/googletest.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/googletest.dep.log
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/libevent.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/libevent.dep.log
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/gperftools.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/gperftools.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/backward.dep
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/http-parser.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/http-parser.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/gcovr.dep
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/protobuf.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/protobuf.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/http-parser.dep
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/nghttp2.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/nghttp2.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/nghttp2.dep
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/rapidjson.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/rapidjson.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/rapidjson.dep
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/spdlog.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/spdlog.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/spdlog.dep
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/boringssl.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/boringssl.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/libevent.dep
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/tclap.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/tclap.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/googletest.dep
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/yaml-cpp.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/yaml-cpp.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/tclap.dep
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/zlib.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/zlib.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/zlib.dep
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/cares.dep
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/gperftools.dep
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/yaml-cpp.dep
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/protobuf.dep
make: '/home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/protobuf.dep' is up to date.
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/lightstep.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/lightstep.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/lightstep.dep
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/boringssl.dep
make: Leaving directory '/home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps'

real	4m31.185s
user	18m53.180s
sys	1m52.722s
DEBUG: /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy/bazel/repositories.bzl:18:5: Fetching external dependencies...
DEBUG: /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy/bazel/repositories.bzl:24:5: External dep build exited with return code: 0
DEBUG: /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy/bazel/repositories.bzl:25:5: 
DEBUG: /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy/bazel/repositories.bzl:26:5: External dependency cache directory /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f
make: Entering directory '/home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps'
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/backward.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/backward.dep.log
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/gcovr.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/gcovr.dep.log
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/cares.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/cares.dep.log
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/googletest.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/googletest.dep.log
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/libevent.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/libevent.dep.log
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/gperftools.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/gperftools.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/backward.dep
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/http-parser.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/http-parser.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/gcovr.dep
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/protobuf.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/protobuf.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/http-parser.dep
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/nghttp2.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/nghttp2.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/nghttp2.dep
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/rapidjson.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/rapidjson.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/rapidjson.dep
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/spdlog.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/spdlog.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/spdlog.dep
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/boringssl.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/boringssl.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/libevent.dep
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/tclap.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/tclap.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/googletest.dep
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/yaml-cpp.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/yaml-cpp.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/tclap.dep
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/zlib.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/zlib.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/zlib.dep
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/cares.dep
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/gperftools.dep
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/yaml-cpp.dep
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/protobuf.dep
make: '/home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/protobuf.dep' is up to date.
Building in /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/lightstep.dep.build, logs at /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/lightstep.dep.log
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/lightstep.dep
Successful build of /home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/boringssl.dep
make: Leaving directory '/home/vagrant/.cache/bazel/_bazel_vagrant/20ac4282102046f33dfec48128432a91/external/envoy_deps'

real	4m31.185s
user	18m53.180s
sys	1m52.722s
ERROR: in target '//external:cc_toolchain': error loading package '@local_config_cc//': Extension file not found. Unable to load file '@local_config_cc//:dummy_toolchain.bzl': file doesn't exist or isn't a file
INFO: Elapsed time: 275.545s
FAILED: Build did NOT complete successfully (5 packages loaded)
    currently loading: @local_config_cc//
envoy-filter-example$ bazel version
..........
Build label: 0.7.0
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Oct 18 14:27:19 2017 (1508336839)
Build timestamp: 1508336839
Build timestamp as int: 1508336839
envoy-filter-example$ 

Unable to build the filter example

Followed the directions for building the example filter but I keep getting this error. I'm trying to build on OS X El Capitan and I've made sure I have the latest version of all dependencies listed.

3 warnings generated.
mv -f src/tests/.deps/tcm_min_asserts_unittest-tcmalloc_unittest.Tpo src/tests/.deps/tcm_min_asserts_unittest-tcmalloc_unittest.Po

real 0m28.083s
user 0m46.548s
sys 0m9.496s
make: *** [/private/var/tmp/_bazel_shishir/0eafc979d803d3fb03e26d0005f3ec89/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/gperftools.dep] Error 1
.
DEBUG: /private/var/tmp/_bazel_shishir/0eafc979d803d3fb03e26d0005f3ec89/external/envoy/bazel/repositories.bzl:84:5: External dep build exited with return code: 2.
DEBUG: /private/var/tmp/_bazel_shishir/0eafc979d803d3fb03e26d0005f3ec89/external/envoy/bazel/repositories.bzl:86:9: External dependency build failed, check above log for errors and ensure all prerequisites at https://github.com/envoyproxy/envoy/blob/master/bazel/README.md#quick-start-bazel-build-for-developers are met.
ERROR: /private/var/tmp/_bazel_shishir/0eafc979d803d3fb03e26d0005f3ec89/external/envoy/bazel/repositories.bzl:167:13: no such package '@envoy_deps//': External dep build failed and referenced by '//external:tcmalloc_and_profiler'.
ERROR: Analysis of target '//:envoy' failed; build aborted.
INFO: Elapsed time: 28.793s

Can someone help me with resolving this please.

Is it possiable to control source service or the destination service version in rate limit

I am using rate limit since istio 1.1, now seems the rate limit usage mode is completely changed. Just have a quick test about demo envoy filter configuration, https://istio.io/v1.9/docs/tasks/policy-enforcement/rate-limit/, it works good. Here is more detail scenario. I have below configuration to control source(production service) to destination(details v1) worked before. But now by envoy filter, seems it not easy to control the source service or the destination service version? Thanks for your kindly help.

spec:
  quotas:
    - name: requestcount.quota.istio-system
      maxAmount: 5000
      validDuration: 1s
      overrides:
        - dimensions:
            destination: details
            destinationVersion: v1
            source: productpage
          maxAmount: 1
          validDuration: 1s

How to add .proto with validate/validate.proto e.g. for the http-filter-example?

I'm thinking to add a .proto for the HttpSampleDecoderFilter which imports validate/validate.proto inside it, in this setup how to do that exactly?

I tried to use the envoy_proto_library but no luck.

Got following error (validate/validate.proto: File not found.):

bazel-out/host/bin/external/com_google_protobuf/protoc '--cpp_out=bazel-out/darwin-fastbuild/genfiles/' -I. http-filter-example/http_filter.proto)

Use --sandbox_debug to see verbose messages from the sandbox
validate/validate.proto: File not found.
http-filter-example/http_filter.proto: Import "validate/validate.proto" was not found or had errors.

Here is my edited http-filter-example/BUILD file:

package(default_visibility = ["//visibility:public"])

load(
    "@envoy//bazel:envoy_build_system.bzl",
    "envoy_cc_binary",
    "envoy_cc_library",
    "envoy_cc_test",
    "envoy_proto_library",
)

envoy_cc_binary(
    name = "envoy",
    repository = "@envoy",
    deps = [
        ":http_filter_config",
        "@envoy//source/exe:envoy_main_entry_lib",
    ],
)

envoy_proto_library(
    name = "http_filter_proto",
    srcs = ["http_filter.proto"],
)

envoy_cc_library(
    name = "http_filter_lib",
    srcs = ["http_filter.cc"],
    hdrs = ["http_filter.h"],
    repository = "@envoy",
    deps = [
        ":http_filter_proto",
        "@envoy//source/exe:envoy_common_lib",
    ],
)

envoy_cc_library(
    name = "http_filter_config",
    srcs = ["http_filter_config.cc"],
    repository = "@envoy",
    deps = [
        ":http_filter_lib",
        "@envoy//source/exe:envoy_common_lib",
    ],
)

envoy_cc_test(
    name = "http_filter_integration_test",
    srcs = ["http_filter_integration_test.cc"],
    repository = "@envoy",
    external_deps = ["envoy_filter_network_http_connection_manager"],
    deps = [
        ":http_filter_config",
        "@envoy//test/integration:http_integration_lib",
    ],
)

And the corresponding http-filter-example/http_filter.proto

syntax = "proto3";

package envoy.api.v2.filter.http;

import "validate/validate.proto";

message HttpSampleDecoder {

    string foo = 1 [(validate.rules).string.min_bytes = 1];
}

Should I add an array of external_deps for the

envoy_proto_library(
    name = "http_filter_proto",
    srcs = ["http_filter.proto"],
)

?

if yes, what it will be?

Thanks!

Build errors - include/registry dependency & exe:envoy_main_lib ref

Building master with given README.md instructions inside the lyft/envoy-build:latest container fails with:

ERROR: /code/envoy-filter-example/BUILD:33:1: no such package '@envoy//include/envoy/registry': BUILD file not found on package path and referenced by '//:echo2_config'.
ERROR: /code/envoy-filter-example/BUILD:10:1: no such target '@envoy//source/exe:envoy_main_lib': target 'envoy_main_lib' not declared in package 'source/exe' (did you mean 'envoy_common_lib'?) defined by /root/.cache/bazel/_bazel_root/10680e8ee3273e72f1d320dfcf6be48e/external/envoy/source/exe/BUILD and referenced by '//:envoy'.
ERROR: Analysis of target '//:envoy' failed; build aborted.

Works if update ./BUILD's envoy_cc_binary to depend on "@envoy//source/exe:envoy_main_entry_lib" instead "@envoy//source/exe:envoy_main_lib" and bump envoy git submodule to tip of master.

test: latest envoy-filter-example test with the latest envoy failed

Title: latest envoy-filter-example http_filter_integration_test test with the latest envoy failed

Reproduce:

> git clone https://github.com/envoyproxy/envoy-filter-example #commit d12cc8af64a7e27dcd21517c5d26614c4ea97e01
> cd envoy-filter-example
> git clone https://github.com/envoyproxy/envoy.git #commit 432cc06
> cd ..
> bazel test //http-filter-example:http_filter_integration_test --test_env=ENVOY_IP_TEST_VERSIONS=v4only

Log:

exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //http-filter-example:http_filter_integration_test
-----------------------------------------------------------------------------
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from IpVersions/HttpFilterSampleIntegrationTest
[ RUN      ] IpVersions/HttpFilterSampleIntegrationTest.Test1/0
http-filter-example/http_filter_integration_test.cc:38: Failure
Value of: response->waitForEndStream()
  Actual: false (Timed out waiting for end stream
)
Expected: true
Stack trace:
  0x453577: Envoy::HttpFilterSampleIntegrationTest_Test1_Test::TestBody()
  0x35caad4: testing::internal::HandleSehExceptionsInMethodIfSupported<>()
  0x35ba23e: testing::internal::HandleExceptionsInMethodIfSupported<>()
  0x35a29e3: testing::Test::Run()
  0x35a35dd: testing::TestInfo::Run()
... Google Test internal frames ...

[2021-04-15 08:20:36.428][12][critical][assert] [external/envoy/source/common/network/connection_impl.cc:102] assert failure: !ioHandle().isOpen() && delayed_close_timer_ == nullptr. Details: ConnectionImpl was unexpectedly torn down without being closed.
[2021-04-15 08:20:36.428][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:104] Caught Aborted, suspect faulting address 0x274c0000000c
[2021-04-15 08:20:36.428][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:91] Backtrace (use tools/stack_decode.py to get line numbers):
[2021-04-15 08:20:36.428][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:92] Envoy version: 0/1.18.0-dev/test/DEBUG/BoringSSL
[2021-04-15 08:20:36.448][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #0: Envoy::SignalAction::sigHandler() [0x25703e9]
[2021-04-15 08:20:36.448][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #1: __restore_rt [0x7fa9f4f9a980]
[2021-04-15 08:20:36.468][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #2: Envoy::Network::ClientConnectionImpl::~ClientConnectionImpl() [0x236c64c]
[2021-04-15 08:20:36.488][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #3: Envoy::Network::ClientConnectionImpl::~ClientConnectionImpl() [0x236c263]
[2021-04-15 08:20:36.509][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #4: Envoy::Network::ClientConnectionImpl::~ClientConnectionImpl() [0x236c2bc]
[2021-04-15 08:20:36.529][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #5: std::default_delete<>::operator()() [0x55cbaf]
[2021-04-15 08:20:36.548][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #6: std::unique_ptr<>::~unique_ptr() [0x52c083]
[2021-04-15 08:20:36.569][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #7: Envoy::Http::CodecClient::~CodecClient() [0x1a36777]
[2021-04-15 08:20:36.589][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #8: Envoy::Http::CodecClientProd::~CodecClientProd() [0x52b828]
[2021-04-15 08:20:36.608][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #9: Envoy::IntegrationCodecClient::~IntegrationCodecClient() [0x531b24]
[2021-04-15 08:20:36.627][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #10: Envoy::IntegrationCodecClient::~IntegrationCodecClient() [0x531b4c]
[2021-04-15 08:20:36.647][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #11: std::default_delete<>::operator()() [0x4d7dcf]
[2021-04-15 08:20:36.667][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #12: std::unique_ptr<>::~unique_ptr() [0x4556c3]
[2021-04-15 08:20:36.687][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #13: Envoy::HttpFilterSampleIntegrationTest_Test1_Test::TestBody() [0x453992]
[2021-04-15 08:20:36.687][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #14: testing::internal::HandleSehExceptionsInMethodIfSupported<>() [0x35caad4]
[2021-04-15 08:20:36.687][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #15: testing::internal::HandleExceptionsInMethodIfSupported<>() [0x35ba23e]
[2021-04-15 08:20:36.687][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #16: testing::Test::Run() [0x35a29e3]
[2021-04-15 08:20:36.687][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #17: testing::TestInfo::Run() [0x35a35dd]
[2021-04-15 08:20:36.708][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #18: testing::TestSuite::Run() [0x35a3eac]
[2021-04-15 08:20:36.728][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #19: testing::internal::UnitTestImpl::RunAllTests() [0x35b2875]
[2021-04-15 08:20:36.748][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #20: testing::internal::HandleSehExceptionsInMethodIfSupported<>() [0x35cdac4]
[2021-04-15 08:20:36.768][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #21: testing::internal::HandleExceptionsInMethodIfSupported<>() [0x35bc884]
[2021-04-15 08:20:36.788][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #22: testing::UnitTest::Run() [0x35b2393]
[2021-04-15 08:20:36.808][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #23: RUN_ALL_TESTS() [0x2283921]
[2021-04-15 08:20:36.829][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #24: Envoy::TestRunner::RunTests() [0x2282ed4]
[2021-04-15 08:20:36.849][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #25: main [0x2280914]
[2021-04-15 08:20:36.850][12][critical][backtrace] [bazel-out/k8-fastbuild/bin/external/envoy/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:96] #26: __libc_start_main [0x7fa9f4bb8bf7]

Note:
Before commit b602ea3, test pass well, then test fail.

build error envoy/source/common/init/manager_impl.cc:73:39: error: unused variable 'count'

gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)

external/envoy/source/common/init/manager_impl.cc:73:39: error: unused variable 'count' [-Werror=unused-variable]
for (const auto& [target_name, count] : target_names_count_) {
^
cc1plus: all warnings being treated as errors
Target //:envoy failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 564.203s, Critical Path: 47.46s
INFO: 2658 processes: 2658 linux-sandbox.
FAILED: Build did NOT complete successfully

Integration test fails for http filter example

Command

$ bazel test //http-filter-example:http_filter_integration_test 

Output

INFO: Analysed target //http-filter-example:http_filter_integration_test (0 packages loaded).
INFO: Found 1 test target...
ERROR: /home/june/git/envoy-filter-example/http-filter-example/BUILD:47:1: C++ compilation of rule '//http-filter-example:http_filter_integration_test_lib' failed (Exit 1)
http-filter-example/http_filter_integration_test.cc: In member function 'virtual void Envoy::HttpFilterSampleIntegrationTest_Test1_Test::TestBody()':
http-filter-example/http_filter_integration_test.cc:33:57: error: no matching function for call to 'Envoy::IntegrationCodecClient::makeHeaderOnlyRequest(Envoy::Http::TestHeaderMapImpl&, Envoy::IntegrationStreamDecoder&)'
   codec_client->makeHeaderOnlyRequest(headers, *response);
                                                         ^
In file included from http-filter-example/http_filter_integration_test.cc:1:0:
external/envoy/test/integration/http_integration.h:25:31: note: candidate: Envoy::IntegrationStreamDecoderPtr Envoy::IntegrationCodecClient::makeHeaderOnlyRequest(const Envoy::Http::HeaderMap&)
   IntegrationStreamDecoderPtr makeHeaderOnlyRequest(const Http::HeaderMap& headers);
                               ^
external/envoy/test/integration/http_integration.h:25:31: note:   candidate expects 1 argument, 2 provided
http-filter-example/http_filter_integration_test.cc:34:84: error: no matching function for call to 'Envoy::FakeUpstream::waitForHttpConnection(Envoy::Event::Dispatcher&)'
   fake_upstream_connection = fake_upstreams_[0]->waitForHttpConnection(*dispatcher_);
                                                                                    ^
In file included from external/envoy/test/integration/integration.h:11:0,
                 from external/envoy/test/integration/http_integration.h:10,
                 from http-filter-example/http_filter_integration_test.cc:1:
external/envoy/test/integration/fake_upstream.h:512:3: note: candidate: testing::AssertionResult Envoy::FakeUpstream::waitForHttpConnection(Envoy::Event::Dispatcher&, Envoy::FakeHttpConnectionPtr&, std::chrono::milliseconds)
   waitForHttpConnection(Event::Dispatcher& client_dispatcher, FakeHttpConnectionPtr& connection,
   ^
external/envoy/test/integration/fake_upstream.h:512:3: note:   candidate expects 3 arguments, 1 provided
external/envoy/test/integration/fake_upstream.h:524:3: note: candidate: static testing::AssertionResult Envoy::FakeUpstream::waitForHttpConnection(Envoy::Event::Dispatcher&, std::vector<std::unique_ptr<Envoy::FakeUpstream> >&, Envoy::FakeHttpConnectionPtr&, std::chrono::milliseconds)
   waitForHttpConnection(Event::Dispatcher& client_dispatcher,
   ^
external/envoy/test/integration/fake_upstream.h:524:3: note:   candidate expects 4 arguments, 1 provided
http-filter-example/http_filter_integration_test.cc:35:75: error: no matching function for call to 'Envoy::FakeHttpConnection::waitForNewStream(Envoy::Event::Dispatcher&)'
   request_stream = fake_upstream_connection->waitForNewStream(*dispatcher_);
                                                                           ^
In file included from external/envoy/test/integration/integration.h:11:0,
                 from external/envoy/test/integration/http_integration.h:10,
                 from http-filter-example/http_filter_integration_test.cc:1:
external/envoy/test/integration/fake_upstream.h:401:3: note: candidate: testing::AssertionResult Envoy::FakeHttpConnection::waitForNewStream(Envoy::Event::Dispatcher&, Envoy::FakeStreamPtr&, bool, std::chrono::milliseconds)
   waitForNewStream(Event::Dispatcher& client_dispatcher, FakeStreamPtr& stream,
   ^
external/envoy/test/integration/fake_upstream.h:401:3: note:   candidate expects 4 arguments, 1 provided
Target //http-filter-example:http_filter_integration_test failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 320.534s, Critical Path: 225.40s
INFO: 390 processes: 390 linux-sandbox.
FAILED: Build did NOT complete successfully

FAILED: Build did NOT complete successfully

Setup CI

We need a better story for keeping this up to date and also doing CI on it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.