diff --git a/.gitignore b/.gitignore index db2be52a8b12..7f4c28b37948 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ SOURCE_VERSION .cache .vimrc .vscode +.vs diff --git a/api/bazel/api_build_system.bzl b/api/bazel/api_build_system.bzl index e9307f5a67d2..5a1c322ee6ee 100644 --- a/api/bazel/api_build_system.bzl +++ b/api/bazel/api_build_system.bzl @@ -5,6 +5,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_test") _PY_SUFFIX = "_py" _CC_SUFFIX = "_cc" +_CC_NATIVE_SUFFIX = "_cc_native" _GO_PROTO_SUFFIX = "_go_proto" _GO_GRPC_SUFFIX = "_go_grpc" _GO_IMPORTPATH_PREFIX = "github.com/envoyproxy/data-plane-api/api/" @@ -130,6 +131,14 @@ def api_proto_library(name, visibility = ["//visibility:private"], srcs = [], de ], visibility = ["//visibility:public"], ) + + native.cc_proto_library( + name = _Suffix(name, _CC_NATIVE_SUFFIX), + deps = [name], + tags = ["manual"], + visibility = ["//visibility:public"], + ) + if (require_py == 1): api_py_proto_library(name, srcs, deps, has_services) diff --git a/api/bazel/repositories.bzl b/api/bazel/repositories.bzl index d46771a7642b..c87a0230f1fd 100644 --- a/api/bazel/repositories.bzl +++ b/api/bazel/repositories.bzl @@ -18,7 +18,7 @@ def api_dependencies(): strip_prefix = "googleapis-" + GOOGLEAPIS_SHA, url = "https://github.com/googleapis/googleapis/archive/" + GOOGLEAPIS_SHA + ".tar.gz", build_file_content = """ -load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library", "py_proto_library") +load("@com_google_protobuf//:protobuf.bzl", "py_proto_library", pb_cc_proto_library="cc_proto_library") load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") filegroup( @@ -45,6 +45,13 @@ proto_library( ) cc_proto_library( + name = "http_api_protos_native", + deps = [":http_api_protos_proto"], + tags=["manual"], + visibility = ["//visibility:public"], +) + +pb_cc_proto_library( name = "http_api_protos", srcs = [ "google/api/annotations.proto", @@ -93,7 +100,8 @@ proto_library( deps = ["@com_google_protobuf//:any_proto"], visibility = ["//visibility:public"], ) -cc_proto_library( + +pb_cc_proto_library( name = "rpc_status_protos", srcs = ["google/rpc/status.proto"], default_runtime = "@com_google_protobuf//:protobuf", @@ -133,7 +141,7 @@ py_proto_library( strip_prefix = "protobuf-" + GOGOPROTO_SHA, url = "https://github.com/gogo/protobuf/archive/" + GOGOPROTO_SHA + ".tar.gz", build_file_content = """ -load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library", "py_proto_library") +load("@com_google_protobuf//:protobuf.bzl", "py_proto_library", pb_cc_proto_library="cc_proto_library") load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") proto_library( @@ -154,7 +162,7 @@ go_proto_library( visibility = ["//visibility:public"], ) -cc_proto_library( +pb_cc_proto_library( name = "gogo_proto_cc", srcs = [ "gogoproto/gogo.proto", diff --git a/bazel/BUILD b/bazel/BUILD index 6a5258d5440b..223d2d0b7ee1 100644 --- a/bazel/BUILD +++ b/bazel/BUILD @@ -35,6 +35,35 @@ genrule( stamp = 1, ) +config_setting( + name = "windows_x86_64", + values = {"cpu": "x64_windows"}, +) + +config_setting( + name = "windows_opt_build", + values = { + "cpu": "x64_windows", + "compilation_mode": "opt", + }, +) + +config_setting( + name = "windows_dbg_build", + values = { + "cpu": "x64_windows", + "compilation_mode": "dbg", + }, +) + +config_setting( + name = "windows_fastbuild_build", + values = { + "cpu": "x64_windows", + "compilation_mode": "fastbuild", + }, +) + config_setting( name = "opt_build", values = {"compilation_mode": "opt"}, diff --git a/bazel/envoy_build_system.bzl b/bazel/envoy_build_system.bzl index cad0fec13b23..09d928fb1389 100644 --- a/bazel/envoy_build_system.bzl +++ b/bazel/envoy_build_system.bzl @@ -5,19 +5,40 @@ def envoy_package(): # Compute the final copts based on various options. def envoy_copts(repository, test = False): - return [ - "-Wall", - "-Wextra", - "-Werror", - "-Wnon-virtual-dtor", - "-Woverloaded-virtual", - "-Wold-style-cast", - "-std=c++14", - ] + select({ + posix_options = [ + "-Wall", + "-Wextra", + "-Werror", + "-Wnon-virtual-dtor", + "-Woverloaded-virtual", + "-Wold-style-cast", + "-std=c++14", + ] + + msvc_options = [ + "-WX", + "-DWIN32", + "-DDISABLE_PROTO_VALIDATE", + "-DWIN32_LEAN_AND_MEAN", + # need win8 for ntohll + # https://msdn.microsoft.com/en-us/library/windows/desktop/aa383745(v=vs.85).aspx + "-D_WIN32_WINNT=0x0602", + "-DNTDDI_VERSION=0x06020000", + "-DCARES_STATICLIB", + "-DNGHTTP2_STATICLIB", + ] + + return select({ + "//bazel:windows_x86_64": msvc_options, + "//conditions:default": posix_options, + }) + select({ # Bazel adds an implicit -DNDEBUG for opt. repository + "//bazel:opt_build": [] if test else ["-ggdb3"], repository + "//bazel:fastbuild_build": [], repository + "//bazel:dbg_build": ["-ggdb3"], + repository + "//bazel:windows_opt_build": [], + repository + "//bazel:windows_fastbuild_build": [], + repository + "//bazel:windows_dbg_build": [], }) + select({ repository + "//bazel:disable_tcmalloc": ["-DABSL_MALLOC_HOOK_MMAP_DISABLE"], "//conditions:default": ["-DTCMALLOC"], @@ -47,6 +68,9 @@ def envoy_linkopts(): "-pagezero_size 10000", "-image_base 100000000", ], + "//bazel:windows_x86_64": [ + "-DEFAULTLIB:advapi32.lib", + ], "//conditions:default": [ "-pthread", "-lrt", @@ -62,6 +86,7 @@ def _envoy_stamped_linkopts(): # # /usr/bin/ld.gold: internal error in write_build_id, at ../../gold/layout.cc:5419 "@envoy//bazel:coverage_build": [], + "//bazel:windows_x86_64": [], # MacOS doesn't have an official equivalent to the `.note.gnu.build-id` # ELF section, so just stuff the raw ID into a new text section. @@ -120,6 +145,16 @@ def tcmalloc_external_deps(repository): "//conditions:default": [envoy_external_dep_path("tcmalloc_and_profiler")], }) +# Dependencies on libevent should be wrapped with this function. +def libevent_external_deps(repository): + return [envoy_external_dep_path("event")] + select({ + repository + "//bazel:windows_x86_64": [], + "//conditions:default": [envoy_external_dep_path("event_pthreads")], + }) + +def http_api_protos_external_deps(repository): + return envoy_protobuf_cc_select(repository, [envoy_external_dep_path("http_api_protos")]) + # Transform the package path (e.g. include/envoy/common) into a path for # exporting the package headers at (e.g. envoy/common). Source files can then # include using this path scheme (e.g. #include "envoy/common/time.h"). @@ -135,6 +170,16 @@ def envoy_include_prefix(path): def envoy_basic_cc_library(name, **kargs): native.cc_library(name = name, **kargs) +def envoy_windows_protobuf_cc_dep_path(dep): + return dep + "_native" + +def envoy_protobuf_cc_select(repository, deps = []): + windows_deps = [envoy_windows_protobuf_cc_dep_path(dep) for dep in deps] + return select({ + repository + "//bazel:windows_x86_64": windows_deps, + "//conditions:default": deps, + }) + # Envoy C++ library targets should be specified with this function. def envoy_cc_library( name, @@ -142,8 +187,11 @@ def envoy_cc_library( hdrs = [], copts = [], visibility = None, + protobuf_cc_deps = [], external_deps = [], tcmalloc_dep = None, + libevent_dep = None, + http_api_protos_dep = None, repository = "", linkstamp = None, tags = [], @@ -151,6 +199,11 @@ def envoy_cc_library( strip_include_prefix = None): if tcmalloc_dep: deps += tcmalloc_external_deps(repository) + if libevent_dep: + deps += libevent_external_deps(repository) + if http_api_protos_dep: + deps += http_api_protos_external_deps(repository) + native.cc_library( name = name, srcs = srcs, @@ -164,11 +217,14 @@ def envoy_cc_library( envoy_external_dep_path("abseil_strings"), envoy_external_dep_path("spdlog"), envoy_external_dep_path("fmtlib"), - ], + ] + envoy_protobuf_cc_select(repository, protobuf_cc_deps), include_prefix = envoy_include_prefix(PACKAGE_NAME), alwayslink = 1, linkstatic = 1, - linkstamp = linkstamp, + linkstamp = select({ + repository + "//bazel:windows_x86_64": None, + "//conditions:default": linkstamp, + }), strip_include_prefix = strip_include_prefix, ) @@ -473,5 +529,6 @@ def envoy_select_force_libcpp(if_libcpp, default = None): return select({ "@envoy//bazel:force_libcpp": if_libcpp, "@bazel_tools//tools/osx:darwin": [], + "//bazel:windows_x86_64": [], "//conditions:default": default or [], }) diff --git a/bazel/external/libcircllhist.BUILD b/bazel/external/libcircllhist.BUILD index 4e109f0b38d4..a937b65a382c 100644 --- a/bazel/external/libcircllhist.BUILD +++ b/bazel/external/libcircllhist.BUILD @@ -6,4 +6,8 @@ cc_library( ], includes = ["src"], visibility = ["//visibility:public"], + copts = select({ + "@envoy//bazel:windows_x86_64": ["-DWIN32"], + "//conditions:default": [], + }), ) diff --git a/bazel/repositories.bat b/bazel/repositories.bat new file mode 100644 index 000000000000..7b6695710593 --- /dev/null +++ b/bazel/repositories.bat @@ -0,0 +1,4 @@ +echo "Start" +@ECHO OFF +%BAZEL_SH% -c "./repositories.sh %*" +exit %ERRORLEVEL% diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 21d04ff9ba90..05384c54924f 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -7,6 +7,12 @@ load(":genrule_repository.bzl", "genrule_repository") load(":patched_http_archive.bzl", "patched_http_archive") load(":repository_locations.bzl", "REPOSITORY_LOCATIONS") load(":target_recipes.bzl", "TARGET_RECIPES") +load( + "@bazel_tools//tools/cpp:windows_cc_configure.bzl", + "find_vc_path", + "setup_vc_env_vars", +) +load("@bazel_tools//tools/cpp:lib_cc_configure.bzl", "get_env_var") def _repository_impl(name, **kwargs): # `existing_rule_keys` contains the names of repositories that have already @@ -67,6 +73,7 @@ def _repository_impl(name, **kwargs): def _build_recipe_repository_impl(ctxt): # Setup the build directory with links to the relevant files. ctxt.symlink(Label("//bazel:repositories.sh"), "repositories.sh") + ctxt.symlink(Label("//bazel:repositories.bat"), "repositories.bat") ctxt.symlink( Label("//ci/build_container:build_and_install_deps.sh"), "build_and_install_deps.sh", @@ -81,11 +88,25 @@ def _build_recipe_repository_impl(ctxt): ctxt.symlink(Label("//ci/prebuilt:BUILD"), "BUILD") # Run the build script. - environment = {} + command = [] + env = {} + if ctxt.os.name.upper().startswith("WINDOWS"): + vc_path = find_vc_path(ctxt) + current_path = get_env_var(ctxt, "PATH", None, False) + env = setup_vc_env_vars(ctxt, vc_path) + env["PATH"] += (";%s" % current_path) + env["CC"] = "cl" + env["CXX"] = "cl" + env["CXXFLAGS"] = "-DNDEBUG" + env["CFLAGS"] = "-DNDEBUG" + command = ["./repositories.bat"] + ctxt.attr.recipes + else: + command = ["./repositories.sh"] + ctxt.attr.recipes + print("Fetching external dependencies...") result = ctxt.execute( - ["./repositories.sh"] + ctxt.attr.recipes, - environment = environment, + command, + environment = env, quiet = False, ) print(result.stdout) @@ -196,6 +217,10 @@ def _envoy_api_deps(): name = "http_api_protos", actual = "@googleapis//:http_api_protos", ) + native.bind( + name = "http_api_protos_native", + actual = "@googleapis//:http_api_protos_native", + ) _repository_impl( name = "six_archive", build_file = "@com_google_protobuf//:six.BUILD", diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index c9e1446d8e73..fbbb8794595e 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -18,7 +18,7 @@ REPOSITORY_LOCATIONS = dict( remote = "https://github.com/bombela/backward-cpp", ), com_github_circonus_labs_libcircllhist = dict( - commit = "476687ac9cc636fc92ac3070246d757ae6854547", # 2018-05-08 + commit = "050da53a44dede7bda136b93a9aeef47bd91fa12", # 2018-07-02 remote = "https://github.com/circonus-labs/libcircllhist", ), com_github_cyan4973_xxhash = dict( diff --git a/ci/build_container/build_recipes/benchmark.sh b/ci/build_container/build_recipes/benchmark.sh index 5e8f2f41ab2c..761ca8b6034a 100644 --- a/ci/build_container/build_recipes/benchmark.sh +++ b/ci/build_container/build_recipes/benchmark.sh @@ -6,13 +6,23 @@ export COMMIT="e1c3a83b8197cf02e794f61228461c27d4e78cfb" # benchmark @ Jan 11, git clone https://github.com/google/benchmark.git (cd benchmark; git reset --hard "$COMMIT") mkdir build - cd build -cmake -G "Unix Makefiles" ../benchmark \ + +cmake_generator="Unix Makefiles" +make_cmd=make +benchmark_lib="libbenchmark.a" + +if [[ "${OS}" == "Windows_NT" ]]; then + cmake_generator="Ninja" + make_cmd=ninja + benchmark_lib="benchmark.lib" +fi + +cmake -G "$cmake_generator" ../benchmark \ -DCMAKE_BUILD_TYPE=RELEASE \ -DBENCHMARK_ENABLE_GTEST_TESTS=OFF -make -cp src/libbenchmark.a "$THIRDPARTY_BUILD"/lib +"$make_cmd" +cp "src/$benchmark_lib" "$THIRDPARTY_BUILD"/lib cd ../benchmark INCLUDE_DIR="$THIRDPARTY_BUILD/include/testing/base/public" diff --git a/ci/build_container/build_recipes/cares.sh b/ci/build_container/build_recipes/cares.sh index b3797f432e99..5168c44886a4 100755 --- a/ci/build_container/build_recipes/cares.sh +++ b/ci/build_container/build_recipes/cares.sh @@ -10,10 +10,24 @@ VERSION=cares-1_14_0 CPPFLAGS="$(for f in $CXXFLAGS; do if [[ $f =~ -D.* ]]; then echo $f; fi; done | tr '\n' ' ')" CFLAGS="$(for f in $CXXFLAGS; do if [[ ! $f =~ -D.* ]]; then echo $f; fi; done | tr '\n' ' ')" -wget -O c-ares-"$VERSION".tar.gz https://github.com/c-ares/c-ares/archive/"$VERSION".tar.gz +curl https://github.com/c-ares/c-ares/archive/"$VERSION".tar.gz -sLo c-ares-"$VERSION".tar.gz tar xf c-ares-"$VERSION".tar.gz cd c-ares-"$VERSION" -./buildconf -./configure --prefix="$THIRDPARTY_BUILD" --enable-shared=no --enable-lib-only \ - --enable-debug --enable-optimize -make V=1 install + +if [[ "${OS}" == "Windows_NT" ]]; then + mkdir build + cd build + cmake -G "Ninja" -DCMAKE_INSTALL_PREFIX="$THIRDPARTY_BUILD" \ + -DCARES_SHARED=no \ + -DCARES_STATIC=on \ + -DCMAKE_BUILD_TYPE=Debug \ + .. + ninja + ninja install + cp "CMakeFiles/c-ares.dir/c-ares.pdb" "$THIRDPARTY_BUILD/lib/c-ares.pdb" +else + ./buildconf + ./configure --prefix="$THIRDPARTY_BUILD" --enable-shared=no --enable-lib-only \ + --enable-debug --enable-optimize + make V=1 install +fi diff --git a/ci/build_container/build_recipes/gperftools.sh b/ci/build_container/build_recipes/gperftools.sh index 7c0c72d9c6e6..ec8e5f8aedac 100755 --- a/ci/build_container/build_recipes/gperftools.sh +++ b/ci/build_container/build_recipes/gperftools.sh @@ -3,8 +3,11 @@ set -e VERSION=2.7 +if [[ "${OS}" == "Windows_NT" ]]; then + exit 0 +fi -wget -O gperftools-"$VERSION".tar.gz https://github.com/gperftools/gperftools/releases/download/gperftools-"$VERSION"/gperftools-"$VERSION".tar.gz +curl https://github.com/gperftools/gperftools/releases/download/gperftools-"$VERSION"/gperftools-"$VERSION".tar.gz -sLo gperftools-"$VERSION".tar.gz tar xf gperftools-"$VERSION".tar.gz cd gperftools-"$VERSION" diff --git a/ci/build_container/build_recipes/libevent.sh b/ci/build_container/build_recipes/libevent.sh index c88d5bb3a2ed..a03888850a7c 100755 --- a/ci/build_container/build_recipes/libevent.sh +++ b/ci/build_container/build_recipes/libevent.sh @@ -4,8 +4,29 @@ set -e VERSION=2.1.8-stable -wget -O libevent-"$VERSION".tar.gz https://github.com/libevent/libevent/releases/download/release-"$VERSION"/libevent-"$VERSION".tar.gz -tar xf libevent-"$VERSION".tar.gz -cd libevent-"$VERSION" -./configure --prefix="$THIRDPARTY_BUILD" --enable-shared=no --disable-libevent-regress --disable-openssl -make V=1 install +if [[ "${OS}" == "Windows_NT" ]]; then + curl https://github.com/libevent/libevent/archive/release-"$VERSION".tar.gz -sLo libevent-"$VERSION".tar.gz + tar xf libevent-"$VERSION".tar.gz + + cd libevent-release-"$VERSION" + + mkdir build + cd build + cmake -G "Ninja" \ + -DCMAKE_INSTALL_PREFIX="$THIRDPARTY_BUILD" \ + -DEVENT__DISABLE_OPENSSL:BOOL=on \ + -DEVENT__DISABLE_REGRESS:BOOL=on \ + -DCMAKE_BUILD_TYPE=Debug \ + .. + ninja + ninja install + cp "CMakeFiles/event.dir/event.pdb" "$THIRDPARTY_BUILD/lib/event.pdb" +else + curl https://github.com/libevent/libevent/releases/download/release-"$VERSION"/libevent-"$VERSION".tar.gz -sLo libevent-"$VERSION".tar.gz + tar xf libevent-"$VERSION".tar.gz + + cd libevent-"$VERSION" + + ./configure --prefix="$THIRDPARTY_BUILD" --enable-shared=no --disable-libevent-regress --disable-openssl + make V=1 install +fi diff --git a/ci/build_container/build_recipes/luajit.sh b/ci/build_container/build_recipes/luajit.sh index 4deba13a51d4..52cd77b81cd5 100644 --- a/ci/build_container/build_recipes/luajit.sh +++ b/ci/build_container/build_recipes/luajit.sh @@ -4,7 +4,7 @@ set -e VERSION=2.0.5 -wget -O LuaJIT-"$VERSION".tar.gz https://github.com/LuaJIT/LuaJIT/archive/v"$VERSION".tar.gz +curl https://github.com/LuaJIT/LuaJIT/archive/v"$VERSION".tar.gz -sLo LuaJIT-"$VERSION".tar.gz tar xf LuaJIT-"$VERSION".tar.gz cd LuaJIT-"$VERSION" @@ -46,15 +46,25 @@ index f7f81a4..e698517 100644 # Disable the JIT compiler, i.e. turn LuaJIT into a pure interpreter. #XCFLAGS+= -DLUAJIT_DISABLE_JIT @@ -564,7 +564,7 @@ endif - + Q= @ E= @echo -#Q= +Q= #E= @: - + ############################################################################## EOF -patch -p1 < ../luajit_make.diff -DEFAULT_CC=${CC} TARGET_CFLAGS=${CFLAGS} TARGET_LDFLAGS=${CFLAGS} CFLAGS="" make V=1 PREFIX="$THIRDPARTY_BUILD" install +if [[ "${OS}" == "Windows_NT" ]]; then + cd src + ./msvcbuild.bat debug + + mkdir -p "$THIRDPARTY_BUILD/include/luajit-2.0" + cp *.h* "$THIRDPARTY_BUILD/include/luajit-2.0" + cp luajit.lib "$THIRDPARTY_BUILD/lib" + cp *.pdb "$THIRDPARTY_BUILD/lib" +else + patch -p1 < ../luajit_make.diff + DEFAULT_CC=${CC} TARGET_CFLAGS=${CFLAGS} TARGET_LDFLAGS=${CFLAGS} CFLAGS="" make V=1 PREFIX="$THIRDPARTY_BUILD" install +fi diff --git a/ci/build_container/build_recipes/nghttp2.sh b/ci/build_container/build_recipes/nghttp2.sh index 1b380f3856d2..727d9c615bc2 100755 --- a/ci/build_container/build_recipes/nghttp2.sh +++ b/ci/build_container/build_recipes/nghttp2.sh @@ -4,8 +4,38 @@ set -e VERSION=1.32.0 -wget -O nghttp2-"$VERSION".tar.gz https://github.com/nghttp2/nghttp2/releases/download/v"$VERSION"/nghttp2-"$VERSION".tar.gz +curl https://github.com/nghttp2/nghttp2/releases/download/v"$VERSION"/nghttp2-"$VERSION".tar.gz -sLo nghttp2-"$VERSION".tar.gz tar xf nghttp2-"$VERSION".tar.gz cd nghttp2-"$VERSION" -./configure --prefix="$THIRDPARTY_BUILD" --enable-shared=no --enable-lib-only -make V=1 install + +# Allow nghttp2 to build as static lib on Windows +cat > nghttp2_cmakelists.diff << 'EOF' +diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt +index 17e422b2..e58070f5 100644 +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -56,6 +56,7 @@ if(HAVE_CUNIT OR ENABLE_STATIC_LIB) + COMPILE_FLAGS "${WARNCFLAGS}" + VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION} + ARCHIVE_OUTPUT_NAME nghttp2 ++ ARCHIVE_OUTPUT_DIRECTORY static + ) + target_compile_definitions(nghttp2_static PUBLIC "-DNGHTTP2_STATICLIB") + if(ENABLE_STATIC_LIB) +EOF + +if [[ "${OS}" == "Windows_NT" ]]; then + git apply nghttp2_cmakelists.diff + mkdir build + cd build + cmake -G "Ninja" -DCMAKE_INSTALL_PREFIX="$THIRDPARTY_BUILD" \ + -DENABLE_STATIC_LIB=on \ + -DENABLE_LIB_ONLY=on \ + .. + ninja + ninja install + cp "lib/CMakeFiles/nghttp2_static.dir/nghttp2_static.pdb" "$THIRDPARTY_BUILD/lib/nghttp2_static.pdb" +else + ./configure --prefix="$THIRDPARTY_BUILD" --enable-shared=no --enable-lib-only + make V=1 install +fi diff --git a/ci/build_container/build_recipes/yaml-cpp.sh b/ci/build_container/build_recipes/yaml-cpp.sh index db63dcb3a11e..f7518664d023 100755 --- a/ci/build_container/build_recipes/yaml-cpp.sh +++ b/ci/build_container/build_recipes/yaml-cpp.sh @@ -4,11 +4,26 @@ set -e VERSION=0.6.2 -wget -O yaml-cpp-"$VERSION".tar.gz https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-"$VERSION".tar.gz +curl https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-"$VERSION".tar.gz -sLo yaml-cpp-"$VERSION".tar.gz tar xf yaml-cpp-"$VERSION".tar.gz cd yaml-cpp-yaml-cpp-"$VERSION" -cmake -DCMAKE_INSTALL_PREFIX:PATH="$THIRDPARTY_BUILD" \ - -DCMAKE_CXX_FLAGS:STRING="${CXXFLAGS} ${CPPFLAGS}" \ - -DCMAKE_C_FLAGS:STRING="${CFLAGS} ${CPPFLAGS}" \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo . -make VERBOSE=1 install + +mkdir build +cd build + +if [[ "${OS}" == "Windows_NT" ]]; then + cmake -G"Ninja" -DCMAKE_INSTALL_PREFIX:PATH="$THIRDPARTY_BUILD" \ + -DCMAKE_CXX_FLAGS:STRING="${CXXFLAGS} ${CPPFLAGS}" \ + -DCMAKE_C_FLAGS:STRING="${CFLAGS} ${CPPFLAGS}" \ + -DYAML_CPP_BUILD_TESTS=off \ + -DCMAKE_BUILD_TYPE=Debug .. + ninja + ninja install + cp "CMakeFiles/yaml-cpp.dir/yaml-cpp.pdb" "$THIRDPARTY_BUILD/lib/yaml-cpp.pdb" +else + cmake -DCMAKE_INSTALL_PREFIX:PATH="$THIRDPARTY_BUILD" \ + -DCMAKE_CXX_FLAGS:STRING="${CXXFLAGS} ${CPPFLAGS}" \ + -DCMAKE_C_FLAGS:STRING="${CFLAGS} ${CPPFLAGS}" \ + -DCMAKE_BUILD_TYPE=RelWithDebugInfo .. + make VERBOSE=1 install +fi diff --git a/ci/build_container/build_recipes/zlib.sh b/ci/build_container/build_recipes/zlib.sh index fd22ea67f0af..0fbf14440f45 100644 --- a/ci/build_container/build_recipes/zlib.sh +++ b/ci/build_container/build_recipes/zlib.sh @@ -4,8 +4,18 @@ set -e VERSION=1.2.11 -wget -O zlib-"$VERSION".tar.gz https://github.com/madler/zlib/archive/v"$VERSION".tar.gz +curl https://github.com/madler/zlib/archive/v"$VERSION".tar.gz -sLo zlib-"$VERSION".tar.gz tar xf zlib-"$VERSION".tar.gz cd zlib-"$VERSION" -./configure --prefix="$THIRDPARTY_BUILD" -make V=1 install + +if [[ "${OS}" == "Windows_NT" ]]; then + mkdir build + cd build + cmake -G "Ninja" -DCMAKE_INSTALL_PREFIX:PATH="$THIRDPARTY_BUILD" .. + ninja + ninja install + cp "CMakeFiles/zlibstatic.dir/zlibstatic.pdb" "$THIRDPARTY_BUILD/lib/zlibstatic.pdb" +else + ./configure --prefix="$THIRDPARTY_BUILD" + make V=1 install +fi diff --git a/ci/build_setup.ps1 b/ci/build_setup.ps1 new file mode 100755 index 000000000000..dcd191c59b55 --- /dev/null +++ b/ci/build_setup.ps1 @@ -0,0 +1,22 @@ +$ErrorActionPreference = "Stop"; +trap { $host.SetShouldExit(1) } + +if ("$env:NUM_CPUS" -eq "") { + $env:NUM_CPUS = (Get-WmiObject -class Win32_computersystem).NumberOfLogicalProcessors +} + +if ("$env:ENVOY_BAZEL_ROOT" -eq "") { + Write-Host "ENVOY_BAZEL_ROOT must be set!" + throw +} + +mkdir -force "$env:ENVOY_BAZEL_ROOT" > $nul + +$env:ENVOY_SRCDIR = [System.IO.Path]::GetFullPath("$PSScriptRoot\..") + +echo "ENVOY_BAZEL_ROOT: $env:ENVOY_BAZEL_ROOT" +echo "ENVOY_SRCDIR: $env:ENVOY_SRCDIR" + +$env:BAZEL_BASE_OPTIONS="--nomaster_bazelrc --output_base=$env:ENVOY_BAZEL_ROOT --bazelrc=$env:ENVOY_SRCDIR\windows\tools\bazel.rc --batch" +$env:BAZEL_BUILD_OPTIONS="--strategy=Genrule=standalone --spawn_strategy=standalone --verbose_failures --action_env=HOME --action_env=PYTHONUSERBASE --jobs=$env:NUM_CPUS --show_task_finish $env:BAZEL_BUILD_EXTRA_OPTIONS" +$env:BAZEL_TEST_OPTIONS="$env:BAZEL_BUILD_OPTIONS --test_env=HOME --test_env=PYTHONUSERBASE --test_env=UBSAN_OPTIONS=print_stacktrace=1 --cache_test_results=no --test_output=all $env:BAZEL_EXTRA_TEST_OPTIONS" diff --git a/ci/do_ci.ps1 b/ci/do_ci.ps1 new file mode 100755 index 000000000000..fa0aa691c1a7 --- /dev/null +++ b/ci/do_ci.ps1 @@ -0,0 +1,20 @@ +$ErrorActionPreference = "Stop"; +trap { $host.SetShouldExit(1) } + +. "$PSScriptRoot\build_setup.ps1" +Write-Host "building using $env:NUM_CPUS CPUs" + +function bazel_debug_binary_build() { + echo "Building..." + pushd "$env:ENVOY_SRCDIR" + bazel $env:BAZEL_BASE_OPTIONS.Split(" ") build $env:BAZEL_BUILD_OPTIONS.Split(" ") -c dbg "//source/exe:envoy-static" + $exit = $LASTEXITCODE + if ($exit -ne 0) { + popd + exit $exit + } + popd +} + +echo "bazel debug build..." +bazel_debug_binary_build diff --git a/ci/prebuilt/BUILD b/ci/prebuilt/BUILD index 691644568905..3e2e5bebe2ac 100644 --- a/ci/prebuilt/BUILD +++ b/ci/prebuilt/BUILD @@ -2,23 +2,37 @@ licenses(["notice"]) # Apache 2 package(default_visibility = ["//visibility:public"]) +config_setting( + name = "windows_x86_64", + values = {"cpu": "x64_windows"}, +) + cc_library( name = "ares", - srcs = ["thirdparty_build/lib/libcares.a"], + srcs = select({ + ":windows_x86_64": ["thirdparty_build/lib/cares.lib"], + "//conditions:default": ["thirdparty_build/lib/libcares.a"], + }), hdrs = glob(["thirdparty_build/include/ares*.h"]), includes = ["thirdparty_build/include"], ) cc_library( name = "benchmark", - srcs = ["thirdparty_build/lib/libbenchmark.a"], + srcs = select({ + ":windows_x86_64": ["thirdparty_build/lib/benchmark.lib"], + "//conditions:default": ["thirdparty_build/lib/libbenchmark.a"], + }), hdrs = ["thirdparty_build/include/testing/base/public/benchmark.h"], includes = ["thirdparty_build/include"], ) cc_library( name = "event", - srcs = ["thirdparty_build/lib/libevent.a"], + srcs = select({ + ":windows_x86_64": ["thirdparty_build/lib/event.lib"], + "//conditions:default": ["thirdparty_build/lib/libevent.a"], + }), hdrs = glob(["thirdparty_build/include/event2/**/*.h"]), includes = ["thirdparty_build/include"], ) @@ -31,7 +45,10 @@ cc_library( cc_library( name = "luajit", - srcs = ["thirdparty_build/lib/libluajit-5.1.a"], + srcs = select({ + ":windows_x86_64": ["thirdparty_build/lib/luajit.lib"], + "//conditions:default": ["thirdparty_build/lib/libluajit-5.1.a"], + }), hdrs = glob(["thirdparty_build/include/luajit-2.0/*"]), includes = ["thirdparty_build/include"], # TODO(mattklein123): We should strip luajit-2.0 here for consumers. However, if we do that @@ -40,7 +57,10 @@ cc_library( cc_library( name = "nghttp2", - srcs = ["thirdparty_build/lib/libnghttp2.a"], + srcs = select({ + ":windows_x86_64": ["thirdparty_build/lib/nghttp2.lib"], + "//conditions:default": ["thirdparty_build/lib/libnghttp2.a"], + }), hdrs = glob(["thirdparty_build/include/nghttp2/**/*.h"]), includes = ["thirdparty_build/include"], ) @@ -54,14 +74,20 @@ cc_library( cc_library( name = "yaml_cpp", - srcs = ["thirdparty_build/lib/libyaml-cpp.a"], + srcs = select({ + ":windows_x86_64": glob(["thirdparty_build/lib/libyaml-cpp*.lib"]), + "//conditions:default": ["thirdparty_build/lib/libyaml-cpp.a"], + }), hdrs = glob(["thirdparty_build/include/yaml-cpp/**/*.h"]), includes = ["thirdparty_build/include"], ) cc_library( name = "zlib", - srcs = ["thirdparty_build/lib/libz.a"], + srcs = select({ + ":windows_x86_64": glob(["thirdparty_build/lib/zlibstaticd.lib"]), + "//conditions:default": ["thirdparty_build/lib/libz.a"], + }), hdrs = [ "thirdparty_build/include/zconf.h", "thirdparty_build/include/zlib.h", diff --git a/include/envoy/common/BUILD b/include/envoy/common/BUILD index 507c15d284fe..c1fc05dd56af 100644 --- a/include/envoy/common/BUILD +++ b/include/envoy/common/BUILD @@ -14,6 +14,8 @@ envoy_basic_cc_library( hdrs = [ "exception.h", "pure.h", + "socket_fd.h", + "ssize.h", ], include_prefix = "envoy/common", ) diff --git a/include/envoy/common/socket_fd.h b/include/envoy/common/socket_fd.h new file mode 100644 index 000000000000..d1c95f0c2580 --- /dev/null +++ b/include/envoy/common/socket_fd.h @@ -0,0 +1,2 @@ +// empty header file so Bazel doesn't complain +// NOLINT(namespace-envoy) diff --git a/include/envoy/common/ssize.h b/include/envoy/common/ssize.h new file mode 100644 index 000000000000..d1c95f0c2580 --- /dev/null +++ b/include/envoy/common/ssize.h @@ -0,0 +1,2 @@ +// empty header file so Bazel doesn't complain +// NOLINT(namespace-envoy) diff --git a/include/envoy/grpc/BUILD b/include/envoy/grpc/BUILD index e908c917d928..5435486cd45f 100644 --- a/include/envoy/grpc/BUILD +++ b/include/envoy/grpc/BUILD @@ -23,17 +23,19 @@ envoy_cc_library( envoy_cc_library( name = "async_client_manager_interface", hdrs = ["async_client_manager.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:grpc_service_cc", + ], deps = [ ":async_client_interface", "//include/envoy/stats:stats_interface", - "@envoy_api//envoy/api/v2/core:grpc_service_cc", ], ) envoy_cc_library( name = "google_grpc_creds_interface", hdrs = ["google_grpc_creds.h"], - deps = [ + protobuf_cc_deps = [ "@envoy_api//envoy/api/v2/core:grpc_service_cc", ], ) diff --git a/include/envoy/local_info/BUILD b/include/envoy/local_info/BUILD index 103028e273f5..0ffdfc105bd7 100644 --- a/include/envoy/local_info/BUILD +++ b/include/envoy/local_info/BUILD @@ -11,8 +11,10 @@ envoy_package() envoy_cc_library( name = "local_info_interface", hdrs = ["local_info.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:base_cc", + ], deps = [ "//include/envoy/network:address_interface", - "@envoy_api//envoy/api/v2/core:base_cc", ], ) diff --git a/include/envoy/network/BUILD b/include/envoy/network/BUILD index 31781824fa09..38ef8981b33b 100644 --- a/include/envoy/network/BUILD +++ b/include/envoy/network/BUILD @@ -62,9 +62,11 @@ envoy_cc_library( envoy_cc_library( name = "listen_socket_interface", hdrs = ["listen_socket.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:base_cc", + ], deps = [ "//include/envoy/network:address_interface", - "@envoy_api//envoy/api/v2/core:base_cc", ], ) diff --git a/include/envoy/router/BUILD b/include/envoy/router/BUILD index 290010fe8c4c..170d48c4923e 100644 --- a/include/envoy/router/BUILD +++ b/include/envoy/router/BUILD @@ -17,6 +17,9 @@ envoy_cc_library( envoy_cc_library( name = "route_config_provider_manager_interface", hdrs = ["route_config_provider_manager.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/network/http_connection_manager/v2:http_connection_manager_cc", + ], deps = [ ":rds_interface", "//include/envoy/event:dispatcher_interface", @@ -28,7 +31,6 @@ envoy_cc_library( "//include/envoy/stats:stats_interface", "//include/envoy/thread_local:thread_local_interface", "//include/envoy/upstream:cluster_manager_interface", - "@envoy_api//envoy/config/filter/network/http_connection_manager/v2:http_connection_manager_cc", ], ) @@ -36,6 +38,9 @@ envoy_cc_library( name = "router_interface", hdrs = ["router.h"], external_deps = ["abseil_optional"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2:rds_cc", + ], deps = [ "//include/envoy/access_log:access_log_interface", "//include/envoy/http:codec_interface", @@ -46,7 +51,6 @@ envoy_cc_library( "//include/envoy/upstream:resource_manager_interface", "//source/common/protobuf", "//source/common/protobuf:utility_lib", - "@envoy_api//envoy/api/v2:rds_cc", ], ) diff --git a/include/envoy/secret/BUILD b/include/envoy/secret/BUILD index c4dcf8404fd6..5a88fea67617 100644 --- a/include/envoy/secret/BUILD +++ b/include/envoy/secret/BUILD @@ -11,8 +11,10 @@ envoy_package() envoy_cc_library( name = "secret_manager_interface", hdrs = ["secret_manager.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/auth:cert_cc", + ], deps = [ "//include/envoy/ssl:tls_certificate_config_interface", - "@envoy_api//envoy/api/v2/auth:cert_cc", ], ) diff --git a/include/envoy/server/BUILD b/include/envoy/server/BUILD index fae78b50ab2a..ab6298ca2603 100644 --- a/include/envoy/server/BUILD +++ b/include/envoy/server/BUILD @@ -134,6 +134,9 @@ envoy_cc_library( envoy_cc_library( name = "filter_config_interface", hdrs = ["filter_config.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:base_cc", + ], deps = [ ":admin_interface", "//include/envoy/access_log:access_log_interface", @@ -151,13 +154,15 @@ envoy_cc_library( "//source/common/common:assert_lib", "//source/common/common:macros", "//source/common/protobuf", - "@envoy_api//envoy/api/v2/core:base_cc", ], ) envoy_cc_library( name = "listener_manager_interface", hdrs = ["listener_manager.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/listener:listener_cc", + ], deps = [ ":drain_manager_interface", ":filter_config_interface", @@ -166,7 +171,6 @@ envoy_cc_library( "//include/envoy/network:listen_socket_interface", "//include/envoy/ssl:context_interface", "//source/common/protobuf", - "@envoy_api//envoy/api/v2/listener:listener_cc", ], ) diff --git a/include/envoy/upstream/BUILD b/include/envoy/upstream/BUILD index 3c5c8312df63..f0d9deab4dd8 100644 --- a/include/envoy/upstream/BUILD +++ b/include/envoy/upstream/BUILD @@ -11,6 +11,10 @@ envoy_package() envoy_cc_library( name = "cluster_manager_interface", hdrs = ["cluster_manager.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2:cds_cc", + "@envoy_api//envoy/config/bootstrap/v2:bootstrap_cc", + ], deps = [ ":health_checker_interface", ":load_balancer_interface", @@ -26,17 +30,17 @@ envoy_cc_library( "//include/envoy/secret:secret_manager_interface", "//include/envoy/server:admin_interface", "//include/envoy/tcp:conn_pool_interface", - "@envoy_api//envoy/api/v2:cds_cc", - "@envoy_api//envoy/config/bootstrap/v2:bootstrap_cc", ], ) envoy_cc_library( name = "health_checker_interface", hdrs = ["health_checker.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/data/core/v2alpha:health_check_event_cc", + ], deps = [ ":upstream_interface", - "@envoy_api//envoy/data/core/v2alpha:health_check_event_cc", ], ) @@ -48,12 +52,14 @@ envoy_cc_library( envoy_cc_library( name = "host_description_interface", hdrs = ["host_description.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:base_cc", + ], deps = [ ":health_check_host_monitor_interface", ":outlier_detection_interface", "//include/envoy/network:address_interface", "//include/envoy/stats:stats_macros", - "@envoy_api//envoy/api/v2/core:base_cc", ], ) @@ -69,9 +75,11 @@ envoy_cc_library( envoy_cc_library( name = "load_balancer_type_interface", hdrs = ["load_balancer_type.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2:cds_cc", + ], deps = [ "//source/common/protobuf", - "@envoy_api//envoy/api/v2:cds_cc", ], ) diff --git a/source/common/access_log/BUILD b/source/common/access_log/BUILD index afbca0e51e2c..d29456a6b07e 100644 --- a/source/common/access_log/BUILD +++ b/source/common/access_log/BUILD @@ -37,6 +37,9 @@ envoy_cc_library( name = "access_log_lib", srcs = ["access_log_impl.cc"], hdrs = ["access_log_impl.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/accesslog/v2:accesslog_cc", + ], deps = [ "//include/envoy/access_log:access_log_interface", "//include/envoy/filesystem:filesystem_interface", @@ -55,6 +58,5 @@ envoy_cc_library( "//source/common/request_info:request_info_lib", "//source/common/runtime:uuid_util_lib", "//source/common/tracing:http_tracer_lib", - "@envoy_api//envoy/config/filter/accesslog/v2:accesslog_cc", ], ) diff --git a/source/common/common/BUILD b/source/common/common/BUILD index f2811d7a546a..d552a8596f94 100644 --- a/source/common/common/BUILD +++ b/source/common/common/BUILD @@ -129,13 +129,15 @@ envoy_cc_library( srcs = ["matchers.cc"], hdrs = ["matchers.h"], external_deps = ["abseil_optional"], + protobuf_cc_deps = [ + "@envoy_api//envoy/type/matcher:metadata_cc", + "@envoy_api//envoy/type/matcher:number_cc", + "@envoy_api//envoy/type/matcher:string_cc", + ], deps = [ ":utility_lib", "//source/common/config:metadata_lib", "//source/common/protobuf", - "@envoy_api//envoy/type/matcher:metadata_cc", - "@envoy_api//envoy/type/matcher:number_cc", - "@envoy_api//envoy/type/matcher:string_cc", ], ) diff --git a/source/common/config/BUILD b/source/common/config/BUILD index 9c362e71e58d..844fa9ad288c 100644 --- a/source/common/config/BUILD +++ b/source/common/config/BUILD @@ -12,12 +12,14 @@ envoy_cc_library( name = "address_json_lib", srcs = ["address_json.cc"], hdrs = ["address_json.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:address_cc", + ], deps = [ "//include/envoy/json:json_object_interface", "//source/common/common:assert_lib", "//source/common/network:cidr_range_lib", "//source/common/network:utility_lib", - "@envoy_api//envoy/api/v2/core:address_cc", ], ) @@ -25,6 +27,9 @@ envoy_cc_library( name = "bootstrap_json_lib", srcs = ["bootstrap_json.cc"], hdrs = ["bootstrap_json.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/bootstrap/v2:bootstrap_cc", + ], deps = [ ":address_json_lib", ":cds_json_lib", @@ -36,7 +41,6 @@ envoy_cc_library( "//source/common/json:config_schemas_lib", "//source/common/protobuf:utility_lib", "//source/extensions/stat_sinks:well_known_names", - "@envoy_api//envoy/config/bootstrap/v2:bootstrap_cc", ], ) @@ -44,9 +48,11 @@ envoy_cc_library( name = "base_json_lib", srcs = ["base_json.cc"], hdrs = ["base_json.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:base_cc", + ], deps = [ "//include/envoy/json:json_object_interface", - "@envoy_api//envoy/api/v2/core:base_cc", ], ) @@ -55,6 +61,10 @@ envoy_cc_library( srcs = ["cds_json.cc"], hdrs = ["cds_json.h"], external_deps = ["abseil_optional"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2:cds_cc", + "@envoy_api//envoy/api/v2/cluster:circuit_breaker_cc", + ], deps = [ ":address_json_lib", ":json_utility_lib", @@ -66,8 +76,6 @@ envoy_cc_library( "//source/common/common:assert_lib", "//source/common/json:config_schemas_lib", "//source/common/network:utility_lib", - "@envoy_api//envoy/api/v2:cds_cc", - "@envoy_api//envoy/api/v2/cluster:circuit_breaker_cc", ], ) @@ -89,9 +97,11 @@ envoy_cc_library( name = "datasource_lib", srcs = ["datasource.cc"], hdrs = ["datasource.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:base_cc", + ], deps = [ "//source/common/filesystem:filesystem_lib", - "@envoy_api//envoy/api/v2/core:base_cc", ], ) @@ -99,20 +109,7 @@ envoy_cc_library( name = "filter_json_lib", srcs = ["filter_json.cc"], hdrs = ["filter_json.h"], - deps = [ - ":address_json_lib", - ":json_utility_lib", - ":protocol_json_lib", - ":rds_json_lib", - ":utility_lib", - "//include/envoy/json:json_object_interface", - "//source/common/common:assert_lib", - "//source/common/common:utility_lib", - "//source/common/json:config_schemas_lib", - "//source/common/protobuf", - "//source/common/protobuf:utility_lib", - "//source/extensions/access_loggers:well_known_names", - "//source/extensions/filters/http:well_known_names", + protobuf_cc_deps = [ "@envoy_api//envoy/config/accesslog/v2:file_cc", "@envoy_api//envoy/config/filter/http/buffer/v2:buffer_cc", "@envoy_api//envoy/config/filter/http/fault/v2:fault_cc", @@ -130,6 +127,21 @@ envoy_cc_library( "@envoy_api//envoy/config/filter/network/redis_proxy/v2:redis_proxy_cc", "@envoy_api//envoy/config/filter/network/tcp_proxy/v2:tcp_proxy_cc", ], + deps = [ + ":address_json_lib", + ":json_utility_lib", + ":protocol_json_lib", + ":rds_json_lib", + ":utility_lib", + "//include/envoy/json:json_object_interface", + "//source/common/common:assert_lib", + "//source/common/common:utility_lib", + "//source/common/json:config_schemas_lib", + "//source/common/protobuf", + "//source/common/protobuf:utility_lib", + "//source/extensions/access_loggers:well_known_names", + "//source/extensions/filters/http:well_known_names", + ], ) envoy_cc_library( @@ -152,6 +164,9 @@ envoy_cc_library( envoy_cc_library( name = "grpc_mux_subscription_lib", hdrs = ["grpc_mux_subscription_impl.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2:discovery_cc", + ], deps = [ "//include/envoy/config:grpc_mux_interface", "//include/envoy/config:subscription_interface", @@ -159,28 +174,30 @@ envoy_cc_library( "//source/common/common:minimal_logger_lib", "//source/common/grpc:common_lib", "//source/common/protobuf", - "@envoy_api//envoy/api/v2:discovery_cc", ], ) envoy_cc_library( name = "grpc_subscription_lib", hdrs = ["grpc_subscription_impl.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:base_cc", + ], deps = [ ":grpc_mux_lib", ":grpc_mux_subscription_lib", "//include/envoy/config:subscription_interface", "//include/envoy/event:dispatcher_interface", "//include/envoy/grpc:async_client_interface", - "@envoy_api//envoy/api/v2/core:base_cc", ], ) envoy_cc_library( name = "http_subscription_lib", hdrs = ["http_subscription_impl.h"], - external_deps = [ - "http_api_protos", + http_api_protos_dep = True, + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:base_cc", ], deps = [ "//include/envoy/config:subscription_interface", @@ -191,7 +208,6 @@ envoy_cc_library( "//source/common/http:rest_api_fetcher_lib", "//source/common/protobuf", "//source/common/protobuf:utility_lib", - "@envoy_api//envoy/api/v2/core:base_cc", ], ) @@ -209,6 +225,9 @@ envoy_cc_library( name = "lds_json_lib", srcs = ["lds_json.cc"], hdrs = ["lds_json.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2:lds_cc", + ], deps = [ ":address_json_lib", ":json_utility_lib", @@ -219,7 +238,6 @@ envoy_cc_library( "//source/common/json:config_schemas_lib", "//source/common/network:utility_lib", "//source/extensions/filters/network:well_known_names", - "@envoy_api//envoy/api/v2:lds_cc", ], ) @@ -227,16 +245,18 @@ envoy_cc_library( name = "metadata_lib", srcs = ["metadata.cc"], hdrs = ["metadata.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:base_cc", + ], deps = [ "//source/common/protobuf", - "@envoy_api//envoy/api/v2/core:base_cc", ], ) envoy_cc_library( name = "protobuf_link_hacks", hdrs = ["protobuf_link_hacks.h"], - deps = [ + protobuf_cc_deps = [ "@envoy_api//envoy/service/discovery/v2:ads_cc", "@envoy_api//envoy/service/ratelimit/v2:rls_cc", ], @@ -246,10 +266,12 @@ envoy_cc_library( name = "protocol_json_lib", srcs = ["protocol_json.cc"], hdrs = ["protocol_json.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:protocol_cc", + ], deps = [ ":json_utility_lib", "//include/envoy/json:json_object_interface", - "@envoy_api//envoy/api/v2/core:protocol_cc", ], ) @@ -263,6 +285,9 @@ envoy_cc_library( name = "rds_json_lib", srcs = ["rds_json.cc"], hdrs = ["rds_json.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2:rds_cc", + ], deps = [ ":base_json_lib", ":json_utility_lib", @@ -272,13 +297,15 @@ envoy_cc_library( "//source/common/config:utility_lib", "//source/common/json:config_schemas_lib", "//source/extensions/filters/http:well_known_names", - "@envoy_api//envoy/api/v2:rds_cc", ], ) envoy_cc_library( name = "subscription_factory_lib", hdrs = ["subscription_factory.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:base_cc", + ], deps = [ ":filesystem_subscription_lib", ":grpc_mux_subscription_lib", @@ -289,7 +316,6 @@ envoy_cc_library( "//include/envoy/upstream:cluster_manager_interface", "//source/common/filesystem:filesystem_lib", "//source/common/protobuf", - "@envoy_api//envoy/api/v2/core:base_cc", ], ) @@ -297,11 +323,13 @@ envoy_cc_library( name = "tls_context_json_lib", srcs = ["tls_context_json.cc"], hdrs = ["tls_context_json.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/auth:cert_cc", + ], deps = [ ":json_utility_lib", "//include/envoy/json:json_object_interface", "//source/common/common:utility_lib", - "@envoy_api//envoy/api/v2/auth:cert_cc", ], ) @@ -309,6 +337,10 @@ envoy_cc_library( name = "utility_lib", srcs = ["utility.cc"], hdrs = ["utility.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:base_cc", + "@envoy_api//envoy/config/filter/network/http_connection_manager/v2:http_connection_manager_cc", + ], deps = [ ":json_utility_lib", ":resources_lib", @@ -327,8 +359,6 @@ envoy_cc_library( "//source/common/protobuf:utility_lib", "//source/common/singleton:const_singleton", "//source/common/stats:stats_lib", - "@envoy_api//envoy/api/v2/core:base_cc", - "@envoy_api//envoy/config/filter/network/http_connection_manager/v2:http_connection_manager_cc", ], ) diff --git a/source/common/event/BUILD b/source/common/event/BUILD index 68420b3312b5..85c0bc7d7327 100644 --- a/source/common/event/BUILD +++ b/source/common/event/BUILD @@ -57,10 +57,7 @@ envoy_cc_library( name = "libevent_lib", srcs = ["libevent.cc"], hdrs = ["libevent.h"], - external_deps = [ - "event", - "event_pthreads", - ], + libevent_dep = 1, deps = [ "//source/common/common:assert_lib", "//source/common/common:c_smart_ptr_lib", @@ -71,10 +68,7 @@ envoy_cc_library( name = "dispatched_thread_lib", srcs = ["dispatched_thread.cc"], hdrs = ["dispatched_thread.h"], - external_deps = [ - "event", - "event_pthreads", - ], + libevent_dep = 1, deps = [ ":dispatcher_lib", "//include/envoy/event:dispatcher_interface", diff --git a/source/common/filesystem/BUILD b/source/common/filesystem/BUILD index b548a0321326..689cbc326898 100644 --- a/source/common/filesystem/BUILD +++ b/source/common/filesystem/BUILD @@ -25,6 +25,9 @@ envoy_cc_library( envoy_cc_library( name = "watcher_lib", srcs = select({ + "//bazel:windows_x86_64": [ + "win32/watcher_impl.cc", + ], "@bazel_tools//tools/osx:darwin": [ "kqueue/watcher_impl.cc", ], @@ -33,6 +36,9 @@ envoy_cc_library( ], }), hdrs = select({ + "//bazel:windows_x86_64": [ + "win32/watcher_impl.h", + ], "@bazel_tools//tools/osx:darwin": [ "kqueue/watcher_impl.h", ], @@ -40,8 +46,9 @@ envoy_cc_library( "inotify/watcher_impl.h", ], }), - external_deps = ["event"], + libevent_dep = 1, strip_include_prefix = select({ + "//bazel:windows_x86_64": "win32", "@bazel_tools//tools/osx:darwin": "kqueue", "//conditions:default": "inotify", }), diff --git a/source/common/http/BUILD b/source/common/http/BUILD index 002c311e35bd..b374ceafc9e9 100644 --- a/source/common/http/BUILD +++ b/source/common/http/BUILD @@ -72,6 +72,9 @@ envoy_cc_library( name = "codes_lib", srcs = ["codes.cc"], hdrs = ["codes.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/type:http_status_cc", + ], deps = [ ":headers_lib", ":utility_lib", @@ -80,7 +83,6 @@ envoy_cc_library( "//include/envoy/stats:stats_interface", "//source/common/common:enum_to_int", "//source/common/common:utility_lib", - "@envoy_api//envoy/type:http_status_cc", ], ) @@ -236,6 +238,10 @@ envoy_cc_library( name = "utility_lib", srcs = ["utility.cc"], hdrs = ["utility.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:http_uri_cc", + "@envoy_api//envoy/api/v2/core:protocol_cc", + ], deps = [ ":exception_lib", ":header_map_lib", @@ -254,8 +260,6 @@ envoy_cc_library( "//source/common/json:json_loader_lib", "//source/common/network:utility_lib", "//source/common/protobuf:utility_lib", - "@envoy_api//envoy/api/v2/core:http_uri_cc", - "@envoy_api//envoy/api/v2/core:protocol_cc", ], ) @@ -273,13 +277,15 @@ envoy_cc_library( name = "header_utility_lib", srcs = ["header_utility.cc"], hdrs = ["header_utility.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/route:route_cc", + "@envoy_api//envoy/type:range_cc", + ], deps = [ "//include/envoy/http:header_map_interface", "//include/envoy/json:json_object_interface", "//source/common/common:utility_lib", "//source/common/config:rds_json_lib", "//source/common/protobuf:utility_lib", - "@envoy_api//envoy/api/v2/route:route_cc", - "@envoy_api//envoy/type:range_cc", ], ) diff --git a/source/common/network/BUILD b/source/common/network/BUILD index 04354a75e6c8..805138a647cb 100644 --- a/source/common/network/BUILD +++ b/source/common/network/BUILD @@ -14,6 +14,7 @@ envoy_cc_library( srcs = ["address_impl.cc"], hdrs = ["address_impl.h"], deps = [ + ":errormap_lib", "//include/envoy/network:address_interface", "//source/common/common:assert_lib", "//source/common/common:utility_lib", @@ -24,6 +25,9 @@ envoy_cc_library( name = "cidr_range_lib", srcs = ["cidr_range.cc"], hdrs = ["cidr_range.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:address_cc", + ], deps = [ ":address_lib", ":utility_lib", @@ -31,7 +35,6 @@ envoy_cc_library( "//include/envoy/network:address_interface", "//source/common/common:assert_lib", "//source/common/common:utility_lib", - "@envoy_api//envoy/api/v2/core:address_cc", ], ) @@ -42,6 +45,7 @@ envoy_cc_library( external_deps = ["abseil_optional"], deps = [ ":address_lib", + ":errormap_lib", ":filter_manager_lib", ":raw_buffer_socket_lib", ":utility_lib", @@ -82,6 +86,11 @@ envoy_cc_library( hdrs = ["filter_impl.h"], ) +envoy_cc_library( + name = "errormap_lib", + hdrs = ["errormap.h"], +) + envoy_cc_library( name = "filter_manager_lib", srcs = ["filter_manager_impl.cc"], @@ -112,6 +121,7 @@ envoy_cc_library( hdrs = ["listen_socket_impl.h"], deps = [ ":address_lib", + ":errormap_lib", ":utility_lib", "//include/envoy/network:listen_socket_interface", "//source/common/common:assert_lib", @@ -129,6 +139,7 @@ envoy_cc_library( ], deps = [ ":address_lib", + ":errormap_lib", ":listen_socket_lib", "//include/envoy/event:dispatcher_interface", "//include/envoy/event:file_event_interface", @@ -147,14 +158,17 @@ envoy_cc_library( name = "raw_buffer_socket_lib", srcs = ["raw_buffer_socket.cc"], hdrs = ["raw_buffer_socket.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:base_cc", + ], deps = [ + ":errormap_lib", ":utility_lib", "//include/envoy/network:connection_interface", "//include/envoy/network:transport_socket_interface", "//source/common/buffer:buffer_lib", "//source/common/common:empty_string", "//source/common/http:headers_lib", - "@envoy_api//envoy/api/v2/core:base_cc", ], ) @@ -162,6 +176,9 @@ envoy_cc_library( name = "resolver_lib", srcs = ["resolver_impl.cc"], hdrs = ["resolver_impl.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:base_cc", + ], deps = [ ":utility_lib", "//include/envoy/network:address_interface", @@ -170,7 +187,6 @@ envoy_cc_library( "//source/common/config:well_known_names", "//source/common/network:address_lib", "//source/common/protobuf", - "@envoy_api//envoy/api/v2/core:base_cc", ], ) @@ -208,13 +224,15 @@ envoy_cc_library( srcs = ["socket_option_factory.cc"], hdrs = ["socket_option_factory.h"], external_deps = ["abseil_optional"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:address_cc", + ], deps = [ ":addr_family_aware_socket_option_lib", ":address_lib", ":socket_option_lib", "//include/envoy/network:listen_socket_interface", "//source/common/common:logger_lib", - "@envoy_api//envoy/api/v2/core:address_cc", ], ) @@ -222,6 +240,10 @@ envoy_cc_library( name = "utility_lib", srcs = ["utility.cc"], hdrs = ["utility.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:address_cc", + "@envoy_api//envoy/api/v2/core:base_cc", + ], deps = [ ":address_lib", "//include/envoy/network:connection_interface", @@ -229,7 +251,5 @@ envoy_cc_library( "//source/common/common:assert_lib", "//source/common/common:utility_lib", "//source/common/protobuf", - "@envoy_api//envoy/api/v2/core:address_cc", - "@envoy_api//envoy/api/v2/core:base_cc", ], ) diff --git a/source/common/network/errormap.h b/source/common/network/errormap.h new file mode 100644 index 000000000000..d1c95f0c2580 --- /dev/null +++ b/source/common/network/errormap.h @@ -0,0 +1,2 @@ +// empty header file so Bazel doesn't complain +// NOLINT(namespace-envoy) diff --git a/source/common/protobuf/BUILD b/source/common/protobuf/BUILD index bb7d80348019..ef4e6755bf71 100644 --- a/source/common/protobuf/BUILD +++ b/source/common/protobuf/BUILD @@ -13,8 +13,10 @@ proto_library( deps = [ "@com_google_protobuf//:any_proto", "@com_google_protobuf//:descriptor_proto", + "@com_google_protobuf//:duration_proto", "@com_google_protobuf//:empty_proto", "@com_google_protobuf//:struct_proto", + "@com_google_protobuf//:timestamp_proto", "@com_google_protobuf//:wrappers_proto", ], ) @@ -38,6 +40,9 @@ envoy_cc_library( srcs = ["utility.cc"], hdrs = ["utility.h"], external_deps = ["protobuf"], + protobuf_cc_deps = [ + "@envoy_api//envoy/type:percent_cc", + ], deps = [ ":protobuf", "//source/common/common:assert_lib", @@ -45,6 +50,5 @@ envoy_cc_library( "//source/common/common:utility_lib", "//source/common/filesystem:filesystem_lib", "//source/common/json:json_loader_lib", - "@envoy_api//envoy/type:percent_cc", ], ) diff --git a/source/common/ratelimit/BUILD b/source/common/ratelimit/BUILD index 60ea694e3a06..0af99b530b0b 100644 --- a/source/common/ratelimit/BUILD +++ b/source/common/ratelimit/BUILD @@ -13,6 +13,11 @@ envoy_cc_library( name = "ratelimit_lib", srcs = ["ratelimit_impl.cc"], hdrs = ["ratelimit_impl.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/ratelimit:ratelimit_cc", + "@envoy_api//envoy/config/ratelimit/v2:rls_cc", + "@envoy_api//envoy/service/ratelimit/v2:rls_cc", + ], deps = [ ":ratelimit_proto", "//include/envoy/grpc:async_client_interface", @@ -23,9 +28,6 @@ envoy_cc_library( "//source/common/common:minimal_logger_lib", "//source/common/http:headers_lib", "//source/common/tracing:http_tracer_lib", - "@envoy_api//envoy/api/v2/ratelimit:ratelimit_cc", - "@envoy_api//envoy/config/ratelimit/v2:rls_cc", - "@envoy_api//envoy/service/ratelimit/v2:rls_cc", ], ) diff --git a/source/common/router/BUILD b/source/common/router/BUILD index d4dfd9712910..15e4279e82bf 100644 --- a/source/common/router/BUILD +++ b/source/common/router/BUILD @@ -53,6 +53,9 @@ envoy_cc_library( name = "config_utility_lib", srcs = ["config_utility.cc"], hdrs = ["config_utility.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2:rds_cc", + ], deps = [ "//include/envoy/http:codes_interface", "//include/envoy/upstream:resource_manager_interface", @@ -62,7 +65,6 @@ envoy_cc_library( "//source/common/filesystem:filesystem_lib", "//source/common/http:headers_lib", "//source/common/protobuf:utility_lib", - "@envoy_api//envoy/api/v2:rds_cc", ], ) @@ -70,6 +72,11 @@ envoy_cc_library( name = "rds_lib", srcs = ["rds_impl.cc"], hdrs = ["rds_impl.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/admin/v2alpha:config_dump_cc", + "@envoy_api//envoy/api/v2:rds_cc", + "@envoy_api//envoy/config/filter/network/http_connection_manager/v2:http_connection_manager_cc", + ], deps = [ ":config_lib", ":rds_subscription_lib", @@ -88,9 +95,6 @@ envoy_cc_library( "//source/common/config:subscription_factory_lib", "//source/common/config:utility_lib", "//source/common/protobuf:utility_lib", - "@envoy_api//envoy/admin/v2alpha:config_dump_cc", - "@envoy_api//envoy/api/v2:rds_cc", - "@envoy_api//envoy/config/filter/network/http_connection_manager/v2:http_connection_manager_cc", ], ) @@ -98,6 +102,9 @@ envoy_cc_library( name = "rds_subscription_lib", srcs = ["rds_subscription.cc"], hdrs = ["rds_subscription.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/network/http_connection_manager/v2:http_connection_manager_cc", + ], deps = [ "//include/envoy/config:subscription_interface", "//source/common/common:assert_lib", @@ -106,7 +113,6 @@ envoy_cc_library( "//source/common/http:headers_lib", "//source/common/http:rest_api_fetcher_lib", "//source/common/json:json_loader_lib", - "@envoy_api//envoy/config/filter/network/http_connection_manager/v2:http_connection_manager_cc", ], ) @@ -136,6 +142,9 @@ envoy_cc_library( name = "router_lib", srcs = ["router.cc"], hdrs = ["router.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/http/router/v2:router_cc", + ], deps = [ ":config_lib", ":header_parser_lib", @@ -173,7 +182,6 @@ envoy_cc_library( "//source/common/http:utility_lib", "//source/common/request_info:request_info_lib", "//source/common/tracing:http_tracer_lib", - "@envoy_api//envoy/config/filter/http/router/v2:router_cc", ], ) diff --git a/source/common/secret/BUILD b/source/common/secret/BUILD index 4f1eff746d6d..952dcda0d858 100644 --- a/source/common/secret/BUILD +++ b/source/common/secret/BUILD @@ -12,10 +12,12 @@ envoy_cc_library( name = "secret_manager_impl_lib", srcs = ["secret_manager_impl.cc"], hdrs = ["secret_manager_impl.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/auth:cert_cc", + ], deps = [ "//include/envoy/secret:secret_manager_interface", "//source/common/common:minimal_logger_lib", "//source/common/ssl:tls_certificate_config_impl_lib", - "@envoy_api//envoy/api/v2/auth:cert_cc", ], ) diff --git a/source/common/ssl/BUILD b/source/common/ssl/BUILD index fe3c6db0d182..292535fcd624 100644 --- a/source/common/ssl/BUILD +++ b/source/common/ssl/BUILD @@ -33,6 +33,9 @@ envoy_cc_library( external_deps = [ "ssl", ], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/auth:cert_cc", + ], deps = [ "//include/envoy/secret:secret_manager_interface", "//include/envoy/ssl:context_config_interface", @@ -42,7 +45,6 @@ envoy_cc_library( "//source/common/config:tls_context_json_lib", "//source/common/json:json_loader_lib", "//source/common/protobuf:utility_lib", - "@envoy_api//envoy/api/v2/auth:cert_cc", ], ) @@ -75,10 +77,12 @@ envoy_cc_library( name = "tls_certificate_config_impl_lib", srcs = ["tls_certificate_config_impl.cc"], hdrs = ["tls_certificate_config_impl.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/auth:cert_cc", + ], deps = [ "//include/envoy/ssl:tls_certificate_config_interface", "//source/common/config:datasource_lib", - "@envoy_api//envoy/api/v2/auth:cert_cc", ], ) diff --git a/source/common/stats/BUILD b/source/common/stats/BUILD index 4c9997138bd1..e109408a0ba9 100644 --- a/source/common/stats/BUILD +++ b/source/common/stats/BUILD @@ -16,6 +16,9 @@ envoy_cc_library( "abseil_optional", "libcircllhist", ], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/metrics/v2:stats_cc", + ], deps = [ "//include/envoy/common:time_interface", "//include/envoy/server:options_interface", @@ -29,7 +32,6 @@ envoy_cc_library( "//source/common/config:well_known_names", "//source/common/protobuf", "//source/common/singleton:const_singleton", - "@envoy_api//envoy/config/metrics/v2:stats_cc", ], ) diff --git a/source/common/tcp_proxy/BUILD b/source/common/tcp_proxy/BUILD index fcd3000620fb..3e5ddf6cf469 100644 --- a/source/common/tcp_proxy/BUILD +++ b/source/common/tcp_proxy/BUILD @@ -12,6 +12,9 @@ envoy_cc_library( name = "tcp_proxy", srcs = ["tcp_proxy.cc"], hdrs = ["tcp_proxy.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/network/tcp_proxy/v2:tcp_proxy_cc", + ], deps = [ "//include/envoy/access_log:access_log_interface", "//include/envoy/buffer:buffer_interface", @@ -35,6 +38,5 @@ envoy_cc_library( "//source/common/network:utility_lib", "//source/common/request_info:request_info_lib", "//source/common/router:metadatamatchcriteria_lib", - "@envoy_api//envoy/config/filter/network/tcp_proxy/v2:tcp_proxy_cc", ], ) diff --git a/source/common/upstream/BUILD b/source/common/upstream/BUILD index f938b86ae079..937ffee3c9f1 100644 --- a/source/common/upstream/BUILD +++ b/source/common/upstream/BUILD @@ -13,6 +13,9 @@ envoy_cc_library( name = "cds_api_lib", srcs = ["cds_api_impl.cc"], hdrs = ["cds_api_impl.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2:cds_cc", + ], deps = [ ":cds_subscription_lib", "//include/envoy/config:subscription_interface", @@ -24,7 +27,6 @@ envoy_cc_library( "//source/common/config:subscription_factory_lib", "//source/common/config:utility_lib", "//source/common/protobuf:utility_lib", - "@envoy_api//envoy/api/v2:cds_cc", ], ) @@ -32,6 +34,9 @@ envoy_cc_library( name = "cds_subscription_lib", srcs = ["cds_subscription.cc"], hdrs = ["cds_subscription.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2:cds_cc", + ], deps = [ "//include/envoy/config:subscription_interface", "//include/envoy/event:dispatcher_interface", @@ -45,7 +50,6 @@ envoy_cc_library( "//source/common/http:rest_api_fetcher_lib", "//source/common/json:config_schemas_lib", "//source/common/json:json_loader_lib", - "@envoy_api//envoy/api/v2:cds_cc", ], ) @@ -53,6 +57,10 @@ envoy_cc_library( name = "cluster_manager_lib", srcs = ["cluster_manager_impl.cc"], hdrs = ["cluster_manager_impl.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/admin/v2alpha:config_dump_cc", + "@envoy_api//envoy/api/v2/core:base_cc", + ], deps = [ ":cds_api_lib", ":load_balancer_lib", @@ -83,8 +91,6 @@ envoy_cc_library( "//source/common/router:shadow_writer_lib", "//source/common/tcp:conn_pool_lib", "//source/common/upstream:upstream_lib", - "@envoy_api//envoy/admin/v2alpha:config_dump_cc", - "@envoy_api//envoy/api/v2/core:base_cc", ], ) @@ -98,11 +104,13 @@ envoy_cc_library( name = "health_checker_base_lib", srcs = ["health_checker_base_impl.cc"], hdrs = ["health_checker_base_impl.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:health_check_cc", + "@envoy_api//envoy/data/core/v2alpha:health_check_event_cc", + ], deps = [ "//include/envoy/upstream:health_checker_interface", "//source/common/router:router_lib", - "@envoy_api//envoy/api/v2/core:health_check_cc", - "@envoy_api//envoy/data/core/v2alpha:health_check_event_cc", ], ) @@ -151,13 +159,15 @@ envoy_cc_library( name = "load_stats_reporter_lib", srcs = ["load_stats_reporter.cc"], hdrs = ["load_stats_reporter.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/service/load_stats/v2:lrs_cc", + ], deps = [ "//include/envoy/event:dispatcher_interface", "//include/envoy/stats:stats_macros", "//include/envoy/upstream:cluster_manager_interface", "//source/common/common:minimal_logger_lib", "//source/common/grpc:async_client_lib", - "@envoy_api//envoy/service/load_stats/v2:lrs_cc", ], ) @@ -165,21 +175,25 @@ envoy_cc_library( name = "health_discovery_service_lib", srcs = ["health_discovery_service.cc"], hdrs = ["health_discovery_service.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/service/discovery/v2:hds_cc", + ], deps = [ "//include/envoy/event:dispatcher_interface", "//include/envoy/stats:stats_macros", "//source/common/common:minimal_logger_lib", "//source/common/grpc:async_client_lib", - "@envoy_api//envoy/service/discovery/v2:hds_cc", ], ) envoy_cc_library( name = "locality_lib", hdrs = ["locality.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:base_cc", + ], deps = [ "//source/common/protobuf:utility_lib", - "@envoy_api//envoy/api/v2/core:base_cc", ], ) @@ -216,6 +230,9 @@ envoy_cc_library( name = "outlier_detection_lib", srcs = ["outlier_detection_impl.cc"], hdrs = ["outlier_detection_impl.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2:cds_cc", + ], deps = [ "//include/envoy/access_log:access_log_interface", "//include/envoy/event:dispatcher_interface", @@ -227,7 +244,6 @@ envoy_cc_library( "//source/common/common:utility_lib", "//source/common/http:codes_lib", "//source/common/protobuf", - "@envoy_api//envoy/api/v2:cds_cc", ], ) @@ -274,6 +290,11 @@ envoy_cc_library( name = "eds_lib", srcs = ["eds.cc"], hdrs = ["eds.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2:eds_cc", + "@envoy_api//envoy/api/v2/core:base_cc", + "@envoy_api//envoy/api/v2/endpoint:endpoint_cc", + ], deps = [ ":locality_lib", ":sds_subscription_lib", @@ -289,9 +310,6 @@ envoy_cc_library( "//source/common/network:resolver_lib", "//source/common/network:utility_lib", "//source/common/protobuf:utility_lib", - "@envoy_api//envoy/api/v2:eds_cc", - "@envoy_api//envoy/api/v2/core:base_cc", - "@envoy_api//envoy/api/v2/endpoint:endpoint_cc", ], ) @@ -299,6 +317,11 @@ envoy_cc_library( name = "sds_subscription_lib", srcs = ["sds_subscription.cc"], hdrs = ["sds_subscription.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2:eds_cc", + "@envoy_api//envoy/api/v2/core:base_cc", + "@envoy_api//envoy/api/v2/endpoint:endpoint_cc", + ], deps = [ "//include/envoy/config:subscription_interface", "//source/common/common:assert_lib", @@ -310,9 +333,6 @@ envoy_cc_library( "//source/common/json:json_loader_lib", "//source/common/protobuf", "//source/common/router:router_lib", - "@envoy_api//envoy/api/v2:eds_cc", - "@envoy_api//envoy/api/v2/core:base_cc", - "@envoy_api//envoy/api/v2/endpoint:endpoint_cc", ], ) @@ -338,6 +358,9 @@ envoy_cc_library( envoy_cc_library( name = "upstream_lib", srcs = ["upstream_impl.cc"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:base_cc", + ], deps = [ ":eds_lib", ":health_checker_lib", @@ -362,13 +385,16 @@ envoy_cc_library( "//source/common/protobuf", "//source/common/protobuf:utility_lib", "//source/extensions/transport_sockets:well_known_names", - "@envoy_api//envoy/api/v2/core:base_cc", ], ) envoy_cc_library( name = "upstream_includes", hdrs = ["upstream_impl.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:base_cc", + "@envoy_api//envoy/api/v2/endpoint:endpoint_cc", + ], deps = [ ":load_balancer_lib", ":outlier_detection_lib", @@ -390,7 +416,5 @@ envoy_cc_library( "//source/common/config:metadata_lib", "//source/common/stats:stats_lib", "//source/common/upstream:locality_lib", - "@envoy_api//envoy/api/v2/core:base_cc", - "@envoy_api//envoy/api/v2/endpoint:endpoint_cc", ], ) diff --git a/source/exe/BUILD b/source/exe/BUILD index a6b91acfdf82..8d1e932de1d1 100644 --- a/source/exe/BUILD +++ b/source/exe/BUILD @@ -9,6 +9,7 @@ load( load( "//source/extensions:all_extensions.bzl", "envoy_all_extensions", + "envoy_windows_extensions", ) envoy_package() @@ -37,7 +38,10 @@ envoy_cc_library( "//source/server:options_lib", "//source/server:server_lib", "//source/server:test_hooks_lib", - ] + envoy_all_extensions(), + ] + select({ + "//bazel:windows_x86_64": envoy_windows_extensions(), + "//conditions:default": envoy_all_extensions(), + }), ) envoy_cc_library( diff --git a/source/extensions/access_loggers/file/BUILD b/source/extensions/access_loggers/file/BUILD index e83a33f02a9f..69465874acd2 100644 --- a/source/extensions/access_loggers/file/BUILD +++ b/source/extensions/access_loggers/file/BUILD @@ -25,6 +25,9 @@ envoy_cc_library( name = "config", srcs = ["config.cc"], hdrs = ["config.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/accesslog/v2:file_cc", + ], deps = [ ":file_access_log_lib", "//include/envoy/registry", @@ -32,6 +35,5 @@ envoy_cc_library( "//source/common/access_log:access_log_formatter_lib", "//source/common/protobuf", "//source/extensions/access_loggers:well_known_names", - "@envoy_api//envoy/config/accesslog/v2:file_cc", ], ) diff --git a/source/extensions/access_loggers/http_grpc/BUILD b/source/extensions/access_loggers/http_grpc/BUILD index 8b372ef7b864..fa9587d79f16 100644 --- a/source/extensions/access_loggers/http_grpc/BUILD +++ b/source/extensions/access_loggers/http_grpc/BUILD @@ -15,6 +15,11 @@ envoy_cc_library( name = "grpc_access_log_lib", srcs = ["grpc_access_log_impl.cc"], hdrs = ["grpc_access_log_impl.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/accesslog/v2:als_cc", + "@envoy_api//envoy/config/filter/accesslog/v2:accesslog_cc", + "@envoy_api//envoy/service/accesslog/v2:als_cc", + ], deps = [ "//include/envoy/access_log:access_log_interface", "//include/envoy/grpc:async_client_interface", @@ -24,9 +29,6 @@ envoy_cc_library( "//include/envoy/upstream:cluster_manager_interface", "//source/common/grpc:async_client_lib", "//source/common/network:utility_lib", - "@envoy_api//envoy/config/accesslog/v2:als_cc", - "@envoy_api//envoy/config/filter/accesslog/v2:accesslog_cc", - "@envoy_api//envoy/service/accesslog/v2:als_cc", ], ) diff --git a/source/extensions/all_extensions.bzl b/source/extensions/all_extensions.bzl index f5613b67d55b..1dc1a34aad6b 100644 --- a/source/extensions/all_extensions.bzl +++ b/source/extensions/all_extensions.bzl @@ -1,4 +1,4 @@ -load("@envoy_build_config//:extensions_build_config.bzl", "EXTENSIONS") +load("@envoy_build_config//:extensions_build_config.bzl", "EXTENSIONS", "WINDOWS_EXTENSIONS") # Return all extensions to be compiled into Envoy. def envoy_all_extensions(): @@ -14,3 +14,17 @@ def envoy_all_extensions(): all_extensions.append(path) return all_extensions + +def envoy_windows_extensions(): + # These extensions are registered using the extension system but are required for the core + # Envoy build. + windows_extensions = [ + "//source/extensions/transport_sockets/raw_buffer:config", + "//source/extensions/transport_sockets/ssl:config", + ] + + # These extensions can be removed on a site specific basis. + for path in WINDOWS_EXTENSIONS.values(): + windows_extensions.append(path) + + return windows_extensions diff --git a/source/extensions/extensions_build_config.bzl b/source/extensions/extensions_build_config.bzl index 04b1d40a6adb..c12d4fb425a9 100644 --- a/source/extensions/extensions_build_config.bzl +++ b/source/extensions/extensions_build_config.bzl @@ -95,3 +95,96 @@ EXTENSIONS = { "envoy.transport_sockets.alts": "//source/extensions/transport_sockets/alts:tsi_handshaker", "envoy.transport_sockets.capture": "//source/extensions/transport_sockets/capture:config", } + +WINDOWS_EXTENSIONS = { + # + # Access loggers + # + + "envoy.access_loggers.file": "//source/extensions/access_loggers/file:config", + #"envoy.access_loggers.http_grpc": "//source/extensions/access_loggers/http_grpc:config", + + # + # gRPC Credentials Plugins + # + + #"envoy.grpc_credentials.file_based_metadata": "//source/extensions/grpc_credentials/file_based_metadata:config", + + # + # Health checkers + # + + #"envoy.health_checkers.redis": "//source/extensions/health_checkers/redis:config", + + # + # HTTP filters + # + + #"envoy.filters.http.buffer": "//source/extensions/filters/http/buffer:config", + #"envoy.filters.http.cors": "//source/extensions/filters/http/cors:config", + #"envoy.filters.http.dynamo": "//source/extensions/filters/http/dynamo:config", + #"envoy.filters.http.ext_authz": "//source/extensions/filters/http/ext_authz:config", + #"envoy.filters.http.fault": "//source/extensions/filters/http/fault:config", + #"envoy.filters.http.grpc_http1_bridge": "//source/extensions/filters/http/grpc_http1_bridge:config", + #"envoy.filters.http.grpc_json_transcoder": "//source/extensions/filters/http/grpc_json_transcoder:config", + #"envoy.filters.http.grpc_web": "//source/extensions/filters/http/grpc_web:config", + #"envoy.filters.http.gzip": "//source/extensions/filters/http/gzip:config", + #"envoy.filters.http.health_check": "//source/extensions/filters/http/health_check:config", + #"envoy.filters.http.ip_tagging": "//source/extensions/filters/http/ip_tagging:config", + #"envoy.filters.http.lua": "//source/extensions/filters/http/lua:config", + #"envoy.filters.http.ratelimit": "//source/extensions/filters/http/ratelimit:config", + #"envoy.filters.http.rbac": "//source/extensions/filters/http/rbac:config", + #"envoy.filters.http.router": "//source/extensions/filters/http/router:config", + #"envoy.filters.http.squash": "//source/extensions/filters/http/squash:config", + + # + # Listener filters + # + + # NOTE: The proxy_protocol filter is implicitly loaded if proxy_protocol functionality is + # configured on the listener. Do not remove it in that case or configs will fail to load. + #"envoy.filters.listener.proxy_protocol": "//source/extensions/filters/listener/proxy_protocol:config", + + # NOTE: The original_dst filter is implicitly loaded if original_dst functionality is + # configured on the listener. Do not remove it in that case or configs will fail to load. + #"envoy.filters.listener.original_dst": "//source/extensions/filters/listener/original_dst:config", + + #"envoy.filters.listener.tls_inspector": "//source/extensions/filters/listener/tls_inspector:config", + + # + # Network filters + # + + #"envoy.filters.network.client_ssl_auth": "//source/extensions/filters/network/client_ssl_auth:config", + #"envoy.filters.network.echo": "//source/extensions/filters/network/echo:config", + #"envoy.filters.network.ext_authz": "//source/extensions/filters/network/ext_authz:config", + #"envoy.filters.network.http_connection_manager": "//source/extensions/filters/network/http_connection_manager:config", + #"envoy.filters.network.mongo_proxy": "//source/extensions/filters/network/mongo_proxy:config", + #"envoy.filters.network.redis_proxy": "//source/extensions/filters/network/redis_proxy:config", + #"envoy.filters.network.ratelimit": "//source/extensions/filters/network/ratelimit:config", + #"envoy.filters.network.tcp_proxy": "//source/extensions/filters/network/tcp_proxy:config", + # TODO(zuercher): switch to config target once a filter exists + #"envoy.filters.network.thrift_proxy": "//source/extensions/filters/network/thrift_proxy:transport_lib", + + # + # Stat sinks + # + + #"envoy.stat_sinks.dog_statsd": "//source/extensions/stat_sinks/dog_statsd:config", + #"envoy.stat_sinks.metrics_service": "//source/extensions/stat_sinks/metrics_service:config", + #"envoy.stat_sinks.statsd": "//source/extensions/stat_sinks/statsd:config", + + # + # Tracers + # + + #"envoy.tracers.dynamic_ot": "//source/extensions/tracers/dynamic_ot:config", + #"envoy.tracers.lightstep": "//source/extensions/tracers/lightstep:config", + #"envoy.tracers.zipkin": "//source/extensions/tracers/zipkin:config", + + # + # Transport sockets + # + + #"envoy.transport_sockets.capture": "//source/extensions/transport_sockets/capture:config", +} diff --git a/source/extensions/filters/common/ext_authz/BUILD b/source/extensions/filters/common/ext_authz/BUILD index d954a8acd6b9..db3e907d5cd5 100644 --- a/source/extensions/filters/common/ext_authz/BUILD +++ b/source/extensions/filters/common/ext_authz/BUILD @@ -11,10 +11,12 @@ envoy_package() envoy_cc_library( name = "ext_authz_interface", hdrs = ["ext_authz.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/service/auth/v2alpha:external_auth_cc", + ], deps = [ "//include/envoy/http:codes_interface", "//source/common/tracing:http_tracer_lib", - "@envoy_api//envoy/service/auth/v2alpha:external_auth_cc", ], ) @@ -60,12 +62,14 @@ envoy_cc_library( name = "check_request_utils_lib", srcs = ["check_request_utils.cc"], hdrs = ["check_request_utils.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/service/auth/v2alpha:external_auth_cc", + ], deps = [ "//include/envoy/grpc:async_client_interface", "//include/envoy/grpc:async_client_manager_interface", "//include/envoy/http:filter_interface", "//include/envoy/upstream:cluster_manager_interface", "//source/common/grpc:async_client_lib", - "@envoy_api//envoy/service/auth/v2alpha:external_auth_cc", ], ) diff --git a/source/extensions/filters/common/rbac/BUILD b/source/extensions/filters/common/rbac/BUILD index 0170fc2d7b8f..2332dde8a450 100644 --- a/source/extensions/filters/common/rbac/BUILD +++ b/source/extensions/filters/common/rbac/BUILD @@ -12,6 +12,10 @@ envoy_cc_library( name = "matchers_lib", srcs = ["matchers.cc"], hdrs = ["matchers.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:base_cc", + "@envoy_api//envoy/config/rbac/v2alpha:rbac_cc", + ], deps = [ "//include/envoy/http:header_map_interface", "//include/envoy/network:connection_interface", @@ -19,8 +23,6 @@ envoy_cc_library( "//source/common/common:matchers_lib", "//source/common/http:header_utility_lib", "//source/common/network:cidr_range_lib", - "@envoy_api//envoy/api/v2/core:base_cc", - "@envoy_api//envoy/config/rbac/v2alpha:rbac_cc", ], ) @@ -38,10 +40,12 @@ envoy_cc_library( name = "engine_lib", srcs = ["engine_impl.cc"], hdrs = ["engine_impl.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:base_cc", + "@envoy_api//envoy/config/filter/http/rbac/v2:rbac_cc", + ], deps = [ "//source/extensions/filters/common/rbac:engine_interface", "//source/extensions/filters/common/rbac:matchers_lib", - "@envoy_api//envoy/api/v2/core:base_cc", - "@envoy_api//envoy/config/filter/http/rbac/v2:rbac_cc", ], ) diff --git a/source/extensions/filters/http/buffer/BUILD b/source/extensions/filters/http/buffer/BUILD index 9245b81f09c9..9b02d796f2ed 100644 --- a/source/extensions/filters/http/buffer/BUILD +++ b/source/extensions/filters/http/buffer/BUILD @@ -15,6 +15,9 @@ envoy_cc_library( name = "buffer_filter_lib", srcs = ["buffer_filter.cc"], hdrs = ["buffer_filter.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/http/buffer/v2:buffer_cc", + ], deps = [ "//include/envoy/event:dispatcher_interface", "//include/envoy/event:timer_interface", @@ -30,7 +33,6 @@ envoy_cc_library( "//source/common/http:headers_lib", "//source/common/http:utility_lib", "//source/extensions/filters/http:well_known_names", - "@envoy_api//envoy/config/filter/http/buffer/v2:buffer_cc", ], ) diff --git a/source/extensions/filters/http/ext_authz/BUILD b/source/extensions/filters/http/ext_authz/BUILD index 5fbcd5b1b242..fd0d20e99617 100644 --- a/source/extensions/filters/http/ext_authz/BUILD +++ b/source/extensions/filters/http/ext_authz/BUILD @@ -15,6 +15,9 @@ envoy_cc_library( name = "ext_authz", srcs = ["ext_authz.cc"], hdrs = ["ext_authz.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/http/ext_authz/v2alpha:ext_authz_cc", + ], deps = [ "//include/envoy/http:codes_interface", "//source/common/buffer:buffer_lib", @@ -25,7 +28,6 @@ envoy_cc_library( "//source/common/http:codes_lib", "//source/common/router:config_lib", "//source/extensions/filters/common/ext_authz:ext_authz_grpc_lib", - "@envoy_api//envoy/config/filter/http/ext_authz/v2alpha:ext_authz_cc", ], ) diff --git a/source/extensions/filters/http/fault/BUILD b/source/extensions/filters/http/fault/BUILD index 847e32b50e92..e3977c47681f 100644 --- a/source/extensions/filters/http/fault/BUILD +++ b/source/extensions/filters/http/fault/BUILD @@ -15,6 +15,9 @@ envoy_cc_library( name = "fault_filter_lib", srcs = ["fault_filter.cc"], hdrs = ["fault_filter.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/http/fault/v2:fault_cc", + ], deps = [ "//include/envoy/event:timer_interface", "//include/envoy/http:codes_interface", @@ -30,7 +33,6 @@ envoy_cc_library( "//source/common/http:header_utility_lib", "//source/common/http:headers_lib", "//source/common/protobuf:utility_lib", - "@envoy_api//envoy/config/filter/http/fault/v2:fault_cc", ], ) diff --git a/source/extensions/filters/http/grpc_json_transcoder/BUILD b/source/extensions/filters/http/grpc_json_transcoder/BUILD index 81b357aa6d71..32c1d46d0213 100644 --- a/source/extensions/filters/http/grpc_json_transcoder/BUILD +++ b/source/extensions/filters/http/grpc_json_transcoder/BUILD @@ -19,7 +19,10 @@ envoy_cc_library( external_deps = [ "path_matcher", "grpc_transcoding", - "http_api_protos", + ], + http_api_protos_dep = True, + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/http/transcoder/v2:transcoder_cc", ], deps = [ ":transcoder_input_stream_lib", @@ -29,7 +32,6 @@ envoy_cc_library( "//source/common/grpc:common_lib", "//source/common/http:headers_lib", "//source/common/protobuf", - "@envoy_api//envoy/config/filter/http/transcoder/v2:transcoder_cc", ], ) @@ -38,7 +40,10 @@ envoy_cc_library( srcs = ["transcoder_input_stream_impl.cc"], hdrs = ["transcoder_input_stream_impl.h"], external_deps = ["grpc_transcoding"], - deps = ["//source/common/buffer:zero_copy_input_stream_lib"], + deps = [ + "//source/common/buffer:zero_copy_input_stream_lib", + "//source/common/protobuf", + ], ) envoy_cc_library( diff --git a/source/extensions/filters/http/gzip/BUILD b/source/extensions/filters/http/gzip/BUILD index 91efd5965891..a64617422a08 100644 --- a/source/extensions/filters/http/gzip/BUILD +++ b/source/extensions/filters/http/gzip/BUILD @@ -15,6 +15,9 @@ envoy_cc_library( name = "gzip_filter_lib", srcs = ["gzip_filter.cc"], hdrs = ["gzip_filter.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/http/gzip/v2:gzip_cc", + ], deps = [ "//include/envoy/http:filter_interface", "//include/envoy/json:json_object_interface", @@ -26,7 +29,6 @@ envoy_cc_library( "//source/common/json:config_schemas_lib", "//source/common/json:json_validator_lib", "//source/common/protobuf", - "@envoy_api//envoy/config/filter/http/gzip/v2:gzip_cc", ], ) diff --git a/source/extensions/filters/http/header_to_metadata/BUILD b/source/extensions/filters/http/header_to_metadata/BUILD index b31109c6333c..ea5af5375b73 100644 --- a/source/extensions/filters/http/header_to_metadata/BUILD +++ b/source/extensions/filters/http/header_to_metadata/BUILD @@ -15,10 +15,12 @@ envoy_cc_library( name = "header_to_metadata_filter_lib", srcs = ["header_to_metadata_filter.cc"], hdrs = ["header_to_metadata_filter.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/http/header_to_metadata/v2:header_to_metadata_cc", + ], deps = [ "//include/envoy/server:filter_config_interface", "//source/extensions/filters/http:well_known_names", - "@envoy_api//envoy/config/filter/http/header_to_metadata/v2:header_to_metadata_cc", ], ) diff --git a/source/extensions/filters/http/health_check/BUILD b/source/extensions/filters/http/health_check/BUILD index 6ecc7f75df0a..8816528f322c 100644 --- a/source/extensions/filters/http/health_check/BUILD +++ b/source/extensions/filters/http/health_check/BUILD @@ -15,6 +15,9 @@ envoy_cc_library( name = "health_check_lib", srcs = ["health_check.cc"], hdrs = ["health_check.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/http/health_check/v2:health_check_cc", + ], deps = [ "//include/envoy/event:dispatcher_interface", "//include/envoy/event:timer_interface", @@ -29,7 +32,6 @@ envoy_cc_library( "//source/common/http:headers_lib", "//source/common/http:utility_lib", "//source/common/protobuf:utility_lib", - "@envoy_api//envoy/config/filter/http/health_check/v2:health_check_cc", ], ) diff --git a/source/extensions/filters/http/ip_tagging/BUILD b/source/extensions/filters/http/ip_tagging/BUILD index 583893eadb23..b70798c2c62d 100644 --- a/source/extensions/filters/http/ip_tagging/BUILD +++ b/source/extensions/filters/http/ip_tagging/BUILD @@ -15,6 +15,9 @@ envoy_cc_library( name = "ip_tagging_filter_lib", srcs = ["ip_tagging_filter.cc"], hdrs = ["ip_tagging_filter.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/http/ip_tagging/v2:ip_tagging_cc", + ], deps = [ "//include/envoy/http:filter_interface", "//include/envoy/runtime:runtime_interface", @@ -22,7 +25,6 @@ envoy_cc_library( "//source/common/http:header_map_lib", "//source/common/http:headers_lib", "//source/common/network:lc_trie_lib", - "@envoy_api//envoy/config/filter/http/ip_tagging/v2:ip_tagging_cc", ], ) diff --git a/source/extensions/filters/http/jwt_authn/BUILD b/source/extensions/filters/http/jwt_authn/BUILD index 88a9b691d99f..1d878c0c6b11 100644 --- a/source/extensions/filters/http/jwt_authn/BUILD +++ b/source/extensions/filters/http/jwt_authn/BUILD @@ -12,9 +12,11 @@ envoy_cc_library( name = "extractor_lib", srcs = ["extractor.cc"], hdrs = ["extractor.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/http/jwt_authn/v2alpha:jwt_authn_cc", + ], deps = [ "//source/common/http:utility_lib", - "@envoy_api//envoy/config/filter/http/jwt_authn/v2alpha:jwt_authn_cc", ], ) @@ -25,11 +27,13 @@ envoy_cc_library( external_deps = [ "jwt_verify_lib", ], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/http/jwt_authn/v2alpha:jwt_authn_cc", + ], deps = [ "//source/common/common:minimal_logger_lib", "//source/common/config:datasource_lib", "//source/common/protobuf:utility_lib", - "@envoy_api//envoy/config/filter/http/jwt_authn/v2alpha:jwt_authn_cc", ], ) diff --git a/source/extensions/filters/http/ratelimit/BUILD b/source/extensions/filters/http/ratelimit/BUILD index f656f229a0d7..c930e4e4ea47 100644 --- a/source/extensions/filters/http/ratelimit/BUILD +++ b/source/extensions/filters/http/ratelimit/BUILD @@ -15,6 +15,9 @@ envoy_cc_library( name = "ratelimit_lib", srcs = ["ratelimit.cc"], hdrs = ["ratelimit.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/http/rate_limit/v2:rate_limit_cc", + ], deps = [ "//include/envoy/http:codes_interface", "//source/common/common:assert_lib", @@ -22,7 +25,6 @@ envoy_cc_library( "//source/common/common:enum_to_int", "//source/common/http:codes_lib", "//source/common/router:config_lib", - "@envoy_api//envoy/config/filter/http/rate_limit/v2:rate_limit_cc", ], ) diff --git a/source/extensions/filters/http/rbac/BUILD b/source/extensions/filters/http/rbac/BUILD index 0dfa0574e1a1..96cc3030b539 100644 --- a/source/extensions/filters/http/rbac/BUILD +++ b/source/extensions/filters/http/rbac/BUILD @@ -24,12 +24,14 @@ envoy_cc_library( name = "rbac_filter_lib", srcs = ["rbac_filter.cc"], hdrs = ["rbac_filter.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/http/rbac/v2:rbac_cc", + ], deps = [ "//include/envoy/http:filter_interface", "//include/envoy/stats:stats_macros", "//source/common/http:utility_lib", "//source/extensions/filters/common/rbac:engine_lib", "//source/extensions/filters/http:well_known_names", - "@envoy_api//envoy/config/filter/http/rbac/v2:rbac_cc", ], ) diff --git a/source/extensions/filters/http/squash/BUILD b/source/extensions/filters/http/squash/BUILD index ab986ca18443..5b6f276951d2 100644 --- a/source/extensions/filters/http/squash/BUILD +++ b/source/extensions/filters/http/squash/BUILD @@ -15,6 +15,9 @@ envoy_cc_library( name = "squash_filter_lib", srcs = ["squash_filter.cc"], hdrs = ["squash_filter.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/http/squash/v2:squash_cc", + ], deps = [ "//include/envoy/event:timer_interface", "//include/envoy/http:codes_interface", @@ -27,7 +30,6 @@ envoy_cc_library( "//source/common/http:message_lib", "//source/common/http:utility_lib", "//source/common/protobuf:utility_lib", - "@envoy_api//envoy/config/filter/http/squash/v2:squash_cc", ], ) diff --git a/source/extensions/filters/network/client_ssl_auth/BUILD b/source/extensions/filters/network/client_ssl_auth/BUILD index 3a99d2418231..ff03a39a7180 100644 --- a/source/extensions/filters/network/client_ssl_auth/BUILD +++ b/source/extensions/filters/network/client_ssl_auth/BUILD @@ -15,6 +15,9 @@ envoy_cc_library( name = "client_ssl_auth", srcs = ["client_ssl_auth.cc"], hdrs = ["client_ssl_auth.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/network/client_ssl_auth/v2:client_ssl_auth_cc", + ], deps = [ "//include/envoy/network:connection_interface", "//include/envoy/network:filter_interface", @@ -32,7 +35,6 @@ envoy_cc_library( "//source/common/json:json_loader_lib", "//source/common/network:cidr_range_lib", "//source/common/network:utility_lib", - "@envoy_api//envoy/config/filter/network/client_ssl_auth/v2:client_ssl_auth_cc", ], ) diff --git a/source/extensions/filters/network/ext_authz/BUILD b/source/extensions/filters/network/ext_authz/BUILD index f0e866d13307..9a4a6e38a1c0 100644 --- a/source/extensions/filters/network/ext_authz/BUILD +++ b/source/extensions/filters/network/ext_authz/BUILD @@ -15,6 +15,9 @@ envoy_cc_library( name = "ext_authz", srcs = ["ext_authz.cc"], hdrs = ["ext_authz.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/network/ext_authz/v2:ext_authz_cc", + ], deps = [ "//include/envoy/network:connection_interface", "//include/envoy/network:filter_interface", @@ -25,7 +28,6 @@ envoy_cc_library( "//source/common/tracing:http_tracer_lib", "//source/extensions/filters/common/ext_authz:ext_authz_grpc_lib", "//source/extensions/filters/common/ext_authz:ext_authz_interface", - "@envoy_api//envoy/config/filter/network/ext_authz/v2:ext_authz_cc", ], ) @@ -33,12 +35,14 @@ envoy_cc_library( name = "config", srcs = ["config.cc"], hdrs = ["config.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/network/ext_authz/v2:ext_authz_cc", + ], deps = [ "//include/envoy/registry", "//source/common/protobuf:utility_lib", "//source/extensions/filters/network:well_known_names", "//source/extensions/filters/network/common:factory_base_lib", "//source/extensions/filters/network/ext_authz", - "@envoy_api//envoy/config/filter/network/ext_authz/v2:ext_authz_cc", ], ) diff --git a/source/extensions/filters/network/mongo_proxy/BUILD b/source/extensions/filters/network/mongo_proxy/BUILD index e3e0efd147a1..03b175043802 100644 --- a/source/extensions/filters/network/mongo_proxy/BUILD +++ b/source/extensions/filters/network/mongo_proxy/BUILD @@ -55,6 +55,9 @@ envoy_cc_library( name = "proxy_lib", srcs = ["proxy.cc"], hdrs = ["proxy.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/network/mongo_proxy/v2:mongo_proxy_cc", + ], deps = [ ":codec_interface", ":codec_lib", @@ -75,7 +78,6 @@ envoy_cc_library( "//source/common/network:filter_lib", "//source/common/protobuf:utility_lib", "//source/common/singleton:const_singleton", - "@envoy_api//envoy/config/filter/network/mongo_proxy/v2:mongo_proxy_cc", ], ) diff --git a/source/extensions/filters/network/ratelimit/BUILD b/source/extensions/filters/network/ratelimit/BUILD index 78f936015344..42da5ae27631 100644 --- a/source/extensions/filters/network/ratelimit/BUILD +++ b/source/extensions/filters/network/ratelimit/BUILD @@ -15,6 +15,9 @@ envoy_cc_library( name = "ratelimit_lib", srcs = ["ratelimit.cc"], hdrs = ["ratelimit.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/network/rate_limit/v2:rate_limit_cc", + ], deps = [ "//include/envoy/network:connection_interface", "//include/envoy/network:filter_interface", @@ -22,7 +25,6 @@ envoy_cc_library( "//include/envoy/runtime:runtime_interface", "//include/envoy/stats:stats_macros", "//source/common/tracing:http_tracer_lib", - "@envoy_api//envoy/config/filter/network/rate_limit/v2:rate_limit_cc", ], ) diff --git a/source/extensions/filters/network/redis_proxy/BUILD b/source/extensions/filters/network/redis_proxy/BUILD index 7dafa10e3da5..17d888bcfd2c 100644 --- a/source/extensions/filters/network/redis_proxy/BUILD +++ b/source/extensions/filters/network/redis_proxy/BUILD @@ -63,6 +63,9 @@ envoy_cc_library( name = "conn_pool_lib", srcs = ["conn_pool_impl.cc"], hdrs = ["conn_pool_impl.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/network/redis_proxy/v2:redis_proxy_cc", + ], deps = [ ":codec_lib", ":conn_pool_interface", @@ -73,7 +76,6 @@ envoy_cc_library( "//source/common/common:assert_lib", "//source/common/network:filter_lib", "//source/common/protobuf:utility_lib", - "@envoy_api//envoy/config/filter/network/redis_proxy/v2:redis_proxy_cc", ], ) @@ -81,6 +83,9 @@ envoy_cc_library( name = "proxy_filter_lib", srcs = ["proxy_filter.cc"], hdrs = ["proxy_filter.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/filter/network/redis_proxy/v2:redis_proxy_cc", + ], deps = [ ":codec_interface", ":command_splitter_interface", @@ -90,7 +95,6 @@ envoy_cc_library( "//source/common/buffer:buffer_lib", "//source/common/common:assert_lib", "//source/common/config:utility_lib", - "@envoy_api//envoy/config/filter/network/redis_proxy/v2:redis_proxy_cc", ], ) diff --git a/source/extensions/filters/network/thrift_proxy/BUILD b/source/extensions/filters/network/thrift_proxy/BUILD index 48555347641b..a84234426c35 100644 --- a/source/extensions/filters/network/thrift_proxy/BUILD +++ b/source/extensions/filters/network/thrift_proxy/BUILD @@ -23,13 +23,15 @@ envoy_cc_library( name = "config", srcs = ["config.cc"], hdrs = ["config.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/extensions/filters/network/thrift_proxy/v2alpha1:thrift_proxy_cc", + ], deps = [ ":filter_lib", "//include/envoy/registry", "//source/common/config:filter_json_lib", "//source/extensions/filters/network:well_known_names", "//source/extensions/filters/network/common:factory_base_lib", - "@envoy_api//envoy/extensions/filters/network/thrift_proxy/v2alpha1:thrift_proxy_cc", ], ) diff --git a/source/extensions/grpc_credentials/file_based_metadata/BUILD b/source/extensions/grpc_credentials/file_based_metadata/BUILD index 30e63efddd0b..bca486e34c43 100644 --- a/source/extensions/grpc_credentials/file_based_metadata/BUILD +++ b/source/extensions/grpc_credentials/file_based_metadata/BUILD @@ -15,6 +15,9 @@ envoy_cc_library( srcs = ["config.cc"], hdrs = ["config.h"], external_deps = ["grpc"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/grpc_credential/v2alpha:file_based_metadata_cc", + ], deps = [ "//include/envoy/grpc:google_grpc_creds_interface", "//include/envoy/registry", @@ -22,6 +25,5 @@ envoy_cc_library( "//source/common/grpc:common_lib", "//source/common/grpc:google_grpc_creds_lib", "//source/extensions/grpc_credentials:well_known_names", - "@envoy_api//envoy/config/grpc_credential/v2alpha:file_based_metadata_cc", ], ) diff --git a/source/extensions/health_checkers/redis/BUILD b/source/extensions/health_checkers/redis/BUILD index ba83c6899e96..be8b8fff6099 100644 --- a/source/extensions/health_checkers/redis/BUILD +++ b/source/extensions/health_checkers/redis/BUILD @@ -14,11 +14,13 @@ envoy_cc_library( name = "redis", srcs = ["redis.cc"], hdrs = ["redis.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2/core:health_check_cc", + "@envoy_api//envoy/config/health_checker/redis/v2:redis_cc", + ], deps = [ "//source/common/upstream:health_checker_base_lib", "//source/extensions/filters/network/redis_proxy:conn_pool_lib", - "@envoy_api//envoy/api/v2/core:health_check_cc", - "@envoy_api//envoy/config/health_checker/redis/v2:redis_cc", ], ) @@ -39,7 +41,7 @@ envoy_cc_library( envoy_cc_library( name = "utility", hdrs = ["utility.h"], - deps = [ + protobuf_cc_deps = [ "@envoy_api//envoy/api/v2/core:health_check_cc", "@envoy_api//envoy/config/health_checker/redis/v2:redis_cc", ], diff --git a/source/extensions/stat_sinks/dog_statsd/BUILD b/source/extensions/stat_sinks/dog_statsd/BUILD index 83273b1afe42..99d05e6dcb81 100644 --- a/source/extensions/stat_sinks/dog_statsd/BUILD +++ b/source/extensions/stat_sinks/dog_statsd/BUILD @@ -15,6 +15,9 @@ envoy_cc_library( name = "config", srcs = ["config.cc"], hdrs = ["config.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/metrics/v2:stats_cc", + ], deps = [ "//include/envoy/registry", "//source/common/network:address_lib", @@ -22,6 +25,5 @@ envoy_cc_library( "//source/extensions/stat_sinks:well_known_names", "//source/extensions/stat_sinks/common/statsd:statsd_lib", "//source/server:configuration_lib", - "@envoy_api//envoy/config/metrics/v2:stats_cc", ], ) diff --git a/source/extensions/stat_sinks/hystrix/BUILD b/source/extensions/stat_sinks/hystrix/BUILD index 334121f54e07..12a1bf68a812 100644 --- a/source/extensions/stat_sinks/hystrix/BUILD +++ b/source/extensions/stat_sinks/hystrix/BUILD @@ -14,6 +14,9 @@ envoy_cc_library( name = "config", srcs = ["config.cc"], hdrs = ["config.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/metrics/v2:stats_cc", + ], deps = [ "//include/envoy/registry", "//source/common/network:address_lib", @@ -21,7 +24,6 @@ envoy_cc_library( "//source/extensions/stat_sinks:well_known_names", "//source/extensions/stat_sinks/hystrix:hystrix_lib", "//source/server:configuration_lib", - "@envoy_api//envoy/config/metrics/v2:stats_cc", ], ) diff --git a/source/extensions/stat_sinks/metrics_service/BUILD b/source/extensions/stat_sinks/metrics_service/BUILD index 82a6110311b9..a80a00dde6ac 100644 --- a/source/extensions/stat_sinks/metrics_service/BUILD +++ b/source/extensions/stat_sinks/metrics_service/BUILD @@ -14,6 +14,9 @@ envoy_cc_library( name = "metrics_service_grpc_lib", srcs = ["grpc_metrics_service_impl.cc"], hdrs = ["grpc_metrics_service_impl.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/service/metrics/v2:metrics_service_cc", + ], deps = [ "//include/envoy/grpc:async_client_interface", "//include/envoy/local_info:local_info_interface", @@ -22,7 +25,6 @@ envoy_cc_library( "//include/envoy/upstream:cluster_manager_interface", "//source/common/common:assert_lib", "//source/common/grpc:async_client_lib", - "@envoy_api//envoy/service/metrics/v2:metrics_service_cc", ], ) @@ -30,12 +32,14 @@ envoy_cc_library( name = "config", srcs = ["config.cc"], hdrs = ["config.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/metrics/v2:stats_cc", + "@envoy_api//envoy/service/metrics/v2:metrics_service_cc", + ], deps = [ "//include/envoy/registry", "//source/extensions/stat_sinks:well_known_names", "//source/extensions/stat_sinks/metrics_service:metrics_service_grpc_lib", "//source/server:configuration_lib", - "@envoy_api//envoy/config/metrics/v2:stats_cc", - "@envoy_api//envoy/service/metrics/v2:metrics_service_cc", ], ) diff --git a/source/extensions/stat_sinks/statsd/BUILD b/source/extensions/stat_sinks/statsd/BUILD index 23ea5f1470ad..910647bd38e6 100644 --- a/source/extensions/stat_sinks/statsd/BUILD +++ b/source/extensions/stat_sinks/statsd/BUILD @@ -14,6 +14,9 @@ envoy_cc_library( name = "config", srcs = ["config.cc"], hdrs = ["config.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/metrics/v2:stats_cc", + ], deps = [ "//include/envoy/registry", "//source/common/network:address_lib", @@ -21,6 +24,5 @@ envoy_cc_library( "//source/extensions/stat_sinks:well_known_names", "//source/extensions/stat_sinks/common/statsd:statsd_lib", "//source/server:configuration_lib", - "@envoy_api//envoy/config/metrics/v2:stats_cc", ], ) diff --git a/source/extensions/transport_sockets/capture/BUILD b/source/extensions/transport_sockets/capture/BUILD index 88490ea7077f..a4d08ce3e394 100644 --- a/source/extensions/transport_sockets/capture/BUILD +++ b/source/extensions/transport_sockets/capture/BUILD @@ -14,14 +14,16 @@ envoy_cc_library( name = "capture_lib", srcs = ["capture.cc"], hdrs = ["capture.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/transport_socket/capture/v2alpha:capture_cc", + "@envoy_api//envoy/data/tap/v2alpha:capture_cc", + ], deps = [ "//include/envoy/network:transport_socket_interface", "//source/common/buffer:buffer_lib", "//source/common/common:assert_lib", "//source/common/network:utility_lib", "//source/common/protobuf", - "@envoy_api//envoy/config/transport_socket/capture/v2alpha:capture_cc", - "@envoy_api//envoy/data/tap/v2alpha:capture_cc", ], ) @@ -29,6 +31,9 @@ envoy_cc_library( name = "config", srcs = ["config.cc"], hdrs = ["config.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/transport_socket/capture/v2alpha:capture_cc", + ], deps = [ ":capture_lib", "//include/envoy/network:transport_socket_interface", @@ -37,6 +42,5 @@ envoy_cc_library( "//source/common/config:utility_lib", "//source/common/protobuf:utility_lib", "//source/extensions/transport_sockets:well_known_names", - "@envoy_api//envoy/config/transport_socket/capture/v2alpha:capture_cc", ], ) diff --git a/source/server/BUILD b/source/server/BUILD index 6ff07ca41dd8..41978fd11a0a 100644 --- a/source/server/BUILD +++ b/source/server/BUILD @@ -24,6 +24,11 @@ envoy_cc_library( name = "configuration_lib", srcs = ["configuration_impl.cc"], hdrs = ["configuration_impl.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2:lds_cc", + "@envoy_api//envoy/config/bootstrap/v2:bootstrap_cc", + "@envoy_api//envoy/config/trace/v2:trace_cc", + ], deps = [ "//include/envoy/http:filter_interface", "//include/envoy/network:connection_interface", @@ -43,9 +48,6 @@ envoy_cc_library( "//source/common/protobuf:utility_lib", "//source/common/ratelimit:ratelimit_lib", "//source/common/tracing:http_tracer_lib", - "@envoy_api//envoy/api/v2:lds_cc", - "@envoy_api//envoy/config/bootstrap/v2:bootstrap_cc", - "@envoy_api//envoy/config/trace/v2:trace_cc", ], ) @@ -162,6 +164,9 @@ envoy_cc_library( name = "lds_api_lib", srcs = ["lds_api.cc"], hdrs = ["lds_api.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2:lds_cc", + ], deps = [ ":lds_subscription_lib", "//include/envoy/config:subscription_interface", @@ -172,7 +177,6 @@ envoy_cc_library( "//source/common/config:subscription_factory_lib", "//source/common/config:utility_lib", "//source/common/protobuf:utility_lib", - "@envoy_api//envoy/api/v2:lds_cc", ], ) @@ -180,6 +184,9 @@ envoy_cc_library( name = "lds_subscription_lib", srcs = ["lds_subscription.cc"], hdrs = ["lds_subscription.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/api/v2:lds_cc", + ], deps = [ "//include/envoy/config:subscription_interface", "//source/common/common:assert_lib", @@ -188,7 +195,6 @@ envoy_cc_library( "//source/common/http:rest_api_fetcher_lib", "//source/common/json:config_schemas_lib", "//source/common/json:json_validator_lib", - "@envoy_api//envoy/api/v2:lds_cc", ], ) @@ -196,6 +202,10 @@ envoy_cc_library( name = "listener_manager_lib", srcs = ["listener_manager_impl.cc"], hdrs = ["listener_manager_impl.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/admin/v2alpha:config_dump_cc", + "@envoy_api//envoy/api/v2:lds_cc", + ], deps = [ ":configuration_lib", ":drain_manager_lib", @@ -217,8 +227,6 @@ envoy_cc_library( "//source/extensions/filters/listener:well_known_names", "//source/extensions/filters/network:well_known_names", "//source/extensions/transport_sockets:well_known_names", - "@envoy_api//envoy/admin/v2alpha:config_dump_cc", - "@envoy_api//envoy/api/v2:lds_cc", ], ) @@ -226,9 +234,7 @@ envoy_cc_library( name = "proto_descriptors_lib", srcs = ["proto_descriptors.cc"], hdrs = ["proto_descriptors.h"], - deps = [ - "//source/common/config:protobuf_link_hacks", - "//source/common/protobuf", + protobuf_cc_deps = [ "@envoy_api//envoy/api/v2:cds_cc", "@envoy_api//envoy/api/v2:eds_cc", "@envoy_api//envoy/api/v2:lds_cc", @@ -239,6 +245,10 @@ envoy_cc_library( "@envoy_api//envoy/service/metrics/v2:metrics_service_cc", "@envoy_api//envoy/service/ratelimit/v2:rls_cc", ], + deps = [ + "//source/common/config:protobuf_link_hacks", + "//source/common/protobuf", + ], ) envoy_cc_library( @@ -246,6 +256,9 @@ envoy_cc_library( srcs = ["server.cc"], hdrs = ["server.h"], external_deps = ["abseil_optional"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/bootstrap/v2:bootstrap_cc", + ], deps = [ ":configuration_lib", ":connection_handler_lib", @@ -284,7 +297,6 @@ envoy_cc_library( "//source/common/upstream:cluster_manager_lib", "//source/common/upstream:health_discovery_service_lib", "//source/server/http:admin_lib", - "@envoy_api//envoy/config/bootstrap/v2:bootstrap_cc", ], ) diff --git a/source/server/config_validation/BUILD b/source/server/config_validation/BUILD index bab593b37ae3..f722952560e2 100644 --- a/source/server/config_validation/BUILD +++ b/source/server/config_validation/BUILD @@ -82,6 +82,9 @@ envoy_cc_library( srcs = ["server.cc"], hdrs = ["server.h"], external_deps = ["abseil_optional"], + protobuf_cc_deps = [ + "@envoy_api//envoy/config/bootstrap/v2:bootstrap_cc", + ], deps = [ ":admin_lib", ":api_lib", @@ -107,6 +110,5 @@ envoy_cc_library( "//source/server:configuration_lib", "//source/server:server_lib", "//source/server/http:admin_lib", - "@envoy_api//envoy/config/bootstrap/v2:bootstrap_cc", ], ) diff --git a/source/server/http/BUILD b/source/server/http/BUILD index 375f9a96c58d..cf9a3a56f507 100644 --- a/source/server/http/BUILD +++ b/source/server/http/BUILD @@ -12,6 +12,10 @@ envoy_cc_library( name = "admin_lib", srcs = ["admin.cc"], hdrs = ["admin.h"], + protobuf_cc_deps = [ + "@envoy_api//envoy/admin/v2alpha:clusters_cc", + "@envoy_api//envoy/admin/v2alpha:config_dump_cc", + ], deps = [ ":config_tracker_lib", "//include/envoy/filesystem:filesystem_interface", @@ -55,8 +59,6 @@ envoy_cc_library( "//source/common/stats:stats_lib", "//source/common/upstream:host_utility_lib", "//source/extensions/access_loggers/file:file_access_log_lib", - "@envoy_api//envoy/admin/v2alpha:clusters_cc", - "@envoy_api//envoy/admin/v2alpha:config_dump_cc", ], ) diff --git a/windows/setup/workstation_setup.ps1 b/windows/setup/workstation_setup.ps1 new file mode 100644 index 000000000000..e965c95f3d05 --- /dev/null +++ b/windows/setup/workstation_setup.ps1 @@ -0,0 +1,54 @@ +$ErrorActionPreference = "Stop"; +$ProgressPreference="SilentlyContinue" + +trap { $host.SetShouldExit(1) } + +Invoke-WebRequest -UseBasicParsing "https://aka.ms/vs/15/release/vs_buildtools.exe" -OutFile "$env:TEMP\vs_buildtools.exe" + +# Install VS Build Tools in a directory without spaces to work around: https://github.com/bazelbuild/bazel/issues/4496 +# otherwise none of the go code will build (c++ is fine) + +$vsInstallDir="c:\VSBuildTools\2017" +echo "Installing VS Build Tools..." +cmd.exe /s /c "$env:TEMP\vs_buildtools.exe --installPath $vsInstallDir --passive --wait --norestart --nocache --add Microsoft.VisualStudio.Component.VC.CoreBuildTools --add Microsoft.VisualStudio.Component.VC.Redist.14.Latest --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK --add Microsoft.VisualStudio.Component.Windows10SDK.17134" + +if ($LASTEXITCODE -ne 0) { + echo "VS Build Tools install failed: $LASTEXITCODE" + exit $LASTEXITCODE +} +Remove-Item "$env:TEMP\vs_buildtools.exe" +echo "Done" + +Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) + +choco install make bazel cmake ninja git -y +if ($LASTEXITCODE -ne 0) { + echo "choco install failed: $LASTEXITCODE" + exit $LASTEXITCODE +} + +$envoyBazelRootDir = "c:\_eb" + +$env:ENVOY_BAZEL_ROOT=$envoyBazelRootDir +setx ENVOY_BAZEL_ROOT $envoyBazelRootDir > $nul +if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE +} + +$env:PATH ="$env:PATH;c:\tools\msys64\usr\bin;c:\make\bin;c:\Program Files\CMake\bin;C:\Python27;c:\programdata\chocolatey\bin;C:\Program Files\Git\bin" +setx PATH $env:PATH > $nul +if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE +} + +$env:BAZEL_VC="$vsInstallDir\VC" +setx BAZEL_VC $env:BAZEL_VC > $nul +if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE +} + +$env:BAZEL_SH="C:\tools\msys64\usr\bin\bash.exe" +setx BAZEL_SH $env:BAZEL_SH > $nul +if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE +} diff --git a/windows/tools/bazel.rc b/windows/tools/bazel.rc new file mode 100644 index 000000000000..1aeeb3507d26 --- /dev/null +++ b/windows/tools/bazel.rc @@ -0,0 +1,6 @@ +# Windows/Envoy specific Bazel build/test options. + +build --experimental_shortened_obj_file_path +build --define signal_trace=disabled +build --define hot_restart=disabled +build --define tcmalloc=disabled