From 0a088716a0cc04409ad926e7364363c6de4a83a5 Mon Sep 17 00:00:00 2001 From: Nathan Fudenberg Date: Thu, 31 Oct 2024 11:49:32 -0400 Subject: [PATCH] bazel: 1.32 (#371) * bazel: try 1.32 naively * bazel: extension check * bazel: options from upstream, note the envoy_build_tools no longer existing * bump: upstream for ci changes, warm our cache * envoyproxy/envoy/pull/36171/ abseil moved from external deps * envoy/commit/8d74446c8a3d219572380731bae42ab328426996, benchmarking * changelog * Rename update-to-upstream-envoy-v1.31.yaml to update-to-upstream-envoy-v1.32.yaml --- .bazelrc | 227 +++++++++++++----- bazel/extensions/extensions_build_config.bzl | 30 ++- ...1-ratelimit-filter-state-hits-addend.patch | 86 ------- bazel/repositories.bzl | 4 +- bazel/repository_locations.bzl | 4 +- .../update-to-upstream-envoy-v1.32.yaml | 10 + source/common/matcher/BUILD | 2 +- source/common/nats/nuid/BUILD | 1 - source/common/nats/streaming/BUILD | 4 +- source/common/regex/BUILD | 2 +- .../filters/http/transformation/BUILD | 4 +- 11 files changed, 211 insertions(+), 163 deletions(-) delete mode 100644 bazel/foreign_cc/0001-ratelimit-filter-state-hits-addend.patch create mode 100644 changelog/v1.32.1-patch1/update-to-upstream-envoy-v1.32.yaml diff --git a/.bazelrc b/.bazelrc index 2b2faa596..0ab42e5aa 100644 --- a/.bazelrc +++ b/.bazelrc @@ -14,9 +14,11 @@ try-import %workspace%/upstream.bazelrc # Startup options cannot be selected via config. startup --host_jvm_args=-Xmx3g +fetch --color=yes run --color=yes build --color=yes +build --jobs=HOST_CPUS-1 build --workspace_status_command="bash bazel/get_workspace_status" build --incompatible_strict_action_env build --java_runtime_version=remotejdk_11 @@ -26,8 +28,11 @@ build --platform_mappings=bazel/platform_mappings build --copt=-DABSL_MIN_LOG_LEVEL=4 build --define envoy_mobile_listener=enabled build --experimental_repository_downloader_retries=2 +build --enable_platform_specific_config +build --incompatible_merge_fixed_and_default_shell_env -# Pass PATH, CC, CXX and LLVM_CONFIG variables from the environment. +# Pass CC, CXX and LLVM_CONFIG variables from the environment. +# We assume they have stable values, so this won't cause action cache misses. build --action_env=CC --host_action_env=CC build --action_env=CXX --host_action_env=CXX build --action_env=LLVM_CONFIG --host_action_env=LLVM_CONFIG @@ -41,14 +46,16 @@ build --action_env=BAZEL_VOLATILE_DIRTY --host_action_env=BAZEL_VOLATILE_DIRTY # Requires setting `BAZEL_FAKE_SCM_REVISION` in the env. build --action_env=BAZEL_FAKE_SCM_REVISION --host_action_env=BAZEL_FAKE_SCM_REVISION -build --enable_platform_specific_config build --test_summary=terse +build:docs-ci --action_env=DOCS_RST_CHECK=1 --host_action_env=DOCS_RST_CHECK=1 + # TODO(keith): Remove once these 2 are the default build --incompatible_config_setting_private_default_visibility build --incompatible_enforce_config_setting_visibility test --test_verbose_timeout_warnings +test --experimental_ui_max_stdouterr_bytes=11712829 #default 1048576 # Allow tags to influence execution requirements common --experimental_allow_tags_propagation @@ -59,7 +66,7 @@ build:linux --copt=-fdebug-types-section build:linux --copt=-fPIC build:linux --copt=-Wno-deprecated-declarations build:linux --cxxopt=-std=c++20 --host_cxxopt=-std=c++20 -build:linux --cxxopt=-fsized-deallocation --host_cxxopt=-fsized-deallocation # needed to compile CEL on Envoy 1.30.x and above +build:linux --cxxopt=-fsized-deallocation --host_cxxopt=-fsized-deallocation build:linux --conlyopt=-fexceptions build:linux --fission=dbg,opt build:linux --features=per_object_debug_info @@ -75,27 +82,38 @@ build --@com_googlesource_googleurl//build_config:system_icu=0 # Common flags for sanitizers build:sanitizer --define tcmalloc=disabled build:sanitizer --linkopt -ldl -build:sanitizer --build_tag_filters=-no_san -build:sanitizer --test_tag_filters=-no_san # Common flags for Clang build:clang --action_env=BAZEL_COMPILER=clang -build:clang --action_env=CC=clang --action_env=CXX=clang++ build:clang --linkopt=-fuse-ld=lld +build:clang --action_env=CC=clang --host_action_env=CC=clang +build:clang --action_env=CXX=clang++ --host_action_env=CXX=clang++ # Flags for Clang + PCH build:clang-pch --spawn_strategy=local build:clang-pch --define=ENVOY_CLANG_PCH=1 # Use gold linker for gcc compiler. -build:gcc --linkopt=-fuse-ld=gold +build:gcc --linkopt=-fuse-ld=gold --host_linkopt=-fuse-ld=gold +build:gcc --test_env=HEAPCHECK= +build:gcc --action_env=BAZEL_COMPILER=gcc +build:gcc --action_env=CC=gcc --action_env=CXX=g++ + +# Clang-tidy +# TODO(phlax): enable this, its throwing some errors as well as finding more issues +# build:clang-tidy --@envoy_toolshed//format/clang_tidy:executable=@envoy//tools/clang-tidy +build:clang-tidy --@envoy_toolshed//format/clang_tidy:config=//:clang_tidy_config +build:clang-tidy --aspects @envoy_toolshed//format/clang_tidy:clang_tidy.bzl%clang_tidy_aspect +build:clang-tidy --output_groups=report +build:clang-tidy --build_tag_filters=-notidy # Basic ASAN/UBSAN that works for gcc -build:asan --action_env=ENVOY_ASAN=1 build:asan --config=sanitizer # ASAN install its signal handler, disable ours so the stacktrace will be printed by ASAN build:asan --define signal_trace=disabled build:asan --define ENVOY_CONFIG_ASAN=1 +build:asan --build_tag_filters=-no_san +build:asan --test_tag_filters=-no_san build:asan --copt -fsanitize=address,undefined build:asan --linkopt -fsanitize=address,undefined # vptr and function sanitizer are enabled in clang-asan if it is set up via bazel/setup_clang.sh. @@ -112,11 +130,18 @@ build:asan --copt -O1 build:asan --copt -fno-optimize-sibling-calls # Clang ASAN/UBSAN -build:clang-asan --config=clang -build:clang-asan --config=asan -build:clang-asan --linkopt -fuse-ld=lld -build:clang-asan --linkopt --rtlib=compiler-rt -build:clang-asan --linkopt --unwindlib=libgcc +build:clang-asan-common --config=clang +build:clang-asan-common --config=asan +build:clang-asan-common --linkopt -fuse-ld=lld +build:clang-asan-common --linkopt --rtlib=compiler-rt +build:clang-asan-common --linkopt --unwindlib=libgcc + +build:clang-asan --config=clang-asan-common +build:clang-asan --linkopt=-l:libclang_rt.ubsan_standalone.a +build:clang-asan --linkopt=-l:libclang_rt.ubsan_standalone_cxx.a +build:clang-asan --action_env=ENVOY_UBSAN_VPTR=1 +build:clang-asan --copt=-fsanitize=vptr,function +build:clang-asan --linkopt=-fsanitize=vptr,function # macOS build:macos --cxxopt=-std=c++20 --host_cxxopt=-std=c++20 @@ -149,12 +174,15 @@ build:clang-tsan --copt -DEVENT__DISABLE_DEBUG_MODE # https://github.com/abseil/abseil-cpp/issues/760 # https://github.com/google/sanitizers/issues/953 build:clang-tsan --test_env="TSAN_OPTIONS=report_atomic_races=0" +build:clang-tsan --test_timeout=120,600,1500,4800 # Clang MSAN - this is the base config for remote-msan and docker-msan. To run this config without # our build image, follow https://github.com/google/sanitizers/wiki/MemorySanitizerLibcxxHowTo # with libc++ instruction and provide corresponding `--copt` and `--linkopt` as well. build:clang-msan --action_env=ENVOY_MSAN=1 build:clang-msan --config=sanitizer +build:clang-msan --build_tag_filters=-no_san +build:clang-msan --test_tag_filters=-no_san build:clang-msan --define ENVOY_CONFIG_MSAN=1 build:clang-msan --copt -fsanitize=memory build:clang-msan --linkopt -fsanitize=memory @@ -174,10 +202,11 @@ build:libc++ --action_env=BAZEL_CXXOPTS=-stdlib=libc++ build:libc++ --action_env=BAZEL_LINKLIBS=-l%:libc++.a:-l%:libc++abi.a build:libc++ --action_env=BAZEL_LINKOPTS=-lm:-pthread build:libc++ --define force_libcpp=enabled +build:clang-libc++ --config=libc++ build:libc++20 --config=libc++ # gRPC has a lot of deprecated-enum-enum-conversion warning. Remove once it is addressed -build:libc++20 --cxxopt=-std=c++20 --copt=-Wno-error=deprecated-enum-enum-conversion +build:libc++20 --copt=-Wno-error=deprecated-enum-enum-conversion # Optimize build for binary size reduction. build:sizeopt -c opt --copt -Os @@ -188,6 +217,7 @@ build --test_env=HEAPCHECK=normal --test_env=PPROF_PATH # Coverage options coverage --config=coverage coverage --build_tests_only + build:coverage --action_env=BAZEL_USE_LLVM_NATIVE_COVERAGE=1 build:coverage --action_env=GCOV=llvm-profdata build:coverage --copt=-DNDEBUG @@ -196,43 +226,53 @@ build:coverage --test_timeout=390,750,1500,5700 build:coverage --define=dynamic_link_tests=true build:coverage --define=ENVOY_CONFIG_COVERAGE=1 build:coverage --cxxopt="-DENVOY_CONFIG_COVERAGE=1" -build:coverage --coverage_support=@envoy//bazel/coverage:coverage_support -build:coverage --test_env=CC_CODE_COVERAGE_SCRIPT=bazel/coverage/collect_cc_coverage.sh build:coverage --test_env=HEAPCHECK= build:coverage --combined_report=lcov -build:coverage --strategy=TestRunner=sandboxed,local +build:coverage --strategy=TestRunner=remote,sandboxed,local build:coverage --strategy=CoverageReport=sandboxed,local build:coverage --experimental_use_llvm_covmap +build:coverage --experimental_generate_llvm_lcov +build:coverage --experimental_split_coverage_postprocessing +build:coverage --experimental_fetch_all_coverage_outputs build:coverage --collect_code_coverage -build:coverage --test_tag_filters=-nocoverage -build:coverage --instrumentation_filter="//source(?!/common/quic/platform)[/:],//envoy[/:],//contrib(?!/.*/test)[/:]" +build:coverage --instrumentation_filter="^//source(?!/common/quic/platform)[/:],^//envoy[/:],^//contrib(?!/.*/test)[/:]" +build:coverage --remote_download_minimal +build:coverage --define=tcmalloc=gperftools +build:coverage --define=no_debug_info=1 +# `--no-relax` is required for coverage to not err with `relocation R_X86_64_REX_GOTPCRELX` +build:coverage --linkopt=-Wl,-s,--no-relax +build:coverage --test_env=ENVOY_IP_TEST_VERSIONS=v4only + build:test-coverage --test_arg="-l trace" build:test-coverage --test_arg="--log-path /dev/null" +build:test-coverage --test_tag_filters=-nocoverage,-fuzz_target build:fuzz-coverage --config=plain-fuzzer build:fuzz-coverage --run_under=@envoy//bazel/coverage:fuzz_coverage_wrapper.sh +build:fuzz-coverage --test_tag_filters=-nocoverage + +build:cache-local --remote_cache=grpc://localhost:9092 # Remote execution: https://docs.bazel.build/versions/master/remote-execution.html build:rbe-toolchain --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 build:rbe-toolchain-clang --config=rbe-toolchain -build:rbe-toolchain-clang --platforms=@envoy_build_tools//toolchains:rbe_linux_clang_platform -build:rbe-toolchain-clang --host_platform=@envoy_build_tools//toolchains:rbe_linux_clang_platform -build:rbe-toolchain-clang --crosstool_top=@envoy_build_tools//toolchains/configs/linux/clang/cc:toolchain -build:rbe-toolchain-clang --extra_toolchains=@envoy_build_tools//toolchains/configs/linux/clang/config:cc-toolchain -build:rbe-toolchain-clang --action_env=CC=clang --action_env=CXX=clang++ --action_env=PATH=/usr/sbin:/usr/bin:/sbin:/bin:/opt/llvm/bin +build:rbe-toolchain-clang --platforms=@envoy//bazel/rbe/toolchains:rbe_linux_clang_platform +build:rbe-toolchain-clang --host_platform=@envoy//bazel/rbe/toolchains:rbe_linux_clang_platform +build:rbe-toolchain-clang --crosstool_top=@envoy//bazel/rbe/toolchains/configs/linux/clang/cc:toolchain +build:rbe-toolchain-clang --extra_toolchains=@envoy//bazel/rbe/toolchains/configs/linux/clang/config:cc-toolchain +build:rbe-toolchain-clang --action_env=CC=clang --action_env=CXX=clang++ build:rbe-toolchain-clang-libc++ --config=rbe-toolchain -build:rbe-toolchain-clang-libc++ --platforms=@envoy_build_tools//toolchains:rbe_linux_clang_libcxx_platform -build:rbe-toolchain-clang-libc++ --host_platform=@envoy_build_tools//toolchains:rbe_linux_clang_libcxx_platform -build:rbe-toolchain-clang-libc++ --crosstool_top=@envoy_build_tools//toolchains/configs/linux/clang_libcxx/cc:toolchain -build:rbe-toolchain-clang-libc++ --extra_toolchains=@envoy_build_tools//toolchains/configs/linux/clang_libcxx/config:cc-toolchain -build:rbe-toolchain-clang-libc++ --action_env=CC=clang --action_env=CXX=clang++ --action_env=PATH=/usr/sbin:/usr/bin:/sbin:/bin:/opt/llvm/bin +build:rbe-toolchain-clang-libc++ --platforms=@envoy//bazel/rbe/toolchains:rbe_linux_clang_libcxx_platform +build:rbe-toolchain-clang-libc++ --host_platform=@envoy//bazel/rbe/toolchains:rbe_linux_clang_libcxx_platform +build:rbe-toolchain-clang-libc++ --crosstool_top=@envoy//bazel/rbe/toolchains/configs/linux/clang_libcxx/cc:toolchain +build:rbe-toolchain-clang-libc++ --extra_toolchains=@envoy//bazel/rbe/toolchains/configs/linux/clang_libcxx/config:cc-toolchain +build:rbe-toolchain-clang-libc++ --action_env=CC=clang --action_env=CXX=clang++ build:rbe-toolchain-clang-libc++ --action_env=CXXFLAGS=-stdlib=libc++ build:rbe-toolchain-clang-libc++ --action_env=LDFLAGS=-stdlib=libc++ build:rbe-toolchain-clang-libc++ --define force_libcpp=enabled -# Do not inherit from "clang-asan" to avoid picking up flags from local clang.bazelrc. -build:rbe-toolchain-asan --config=asan +build:rbe-toolchain-asan --config=clang-asan build:rbe-toolchain-asan --linkopt -fuse-ld=lld build:rbe-toolchain-asan --action_env=ENVOY_UBSAN_VPTR=1 build:rbe-toolchain-asan --copt=-fsanitize=vptr,function @@ -250,35 +290,22 @@ build:rbe-toolchain-tsan --linkopt=-Wl,-rpath,/opt/libcxx_tsan/lib build:rbe-toolchain-tsan --config=clang-tsan build:rbe-toolchain-gcc --config=rbe-toolchain -build:rbe-toolchain-gcc --platforms=@envoy_build_tools//toolchains:rbe_linux_gcc_platform -build:rbe-toolchain-gcc --host_platform=@envoy_build_tools//toolchains:rbe_linux_gcc_platform -build:rbe-toolchain-gcc --crosstool_top=@envoy_build_tools//toolchains/configs/linux/gcc/cc:toolchain -build:rbe-toolchain-gcc --extra_toolchains=@envoy_build_tools//toolchains/configs/linux/gcc/config:cc-toolchain - -build:rbe-toolchain-msvc-cl --host_platform=@envoy_build_tools//toolchains:rbe_windows_msvc_cl_platform -build:rbe-toolchain-msvc-cl --platforms=@envoy_build_tools//toolchains:rbe_windows_msvc_cl_platform -build:rbe-toolchain-msvc-cl --crosstool_top=@envoy_build_tools//toolchains/configs/windows/msvc-cl/cc:toolchain -build:rbe-toolchain-msvc-cl --extra_toolchains=@envoy_build_tools//toolchains/configs/windows/msvc-cl/config:cc-toolchain - -build:rbe-toolchain-clang-cl --host_platform=@envoy_build_tools//toolchains:rbe_windows_clang_cl_platform -build:rbe-toolchain-clang-cl --platforms=@envoy_build_tools//toolchains:rbe_windows_clang_cl_platform -build:rbe-toolchain-clang-cl --crosstool_top=@envoy_build_tools//toolchains/configs/windows/clang-cl/cc:toolchain -build:rbe-toolchain-clang-cl --extra_toolchains=@envoy_build_tools//toolchains/configs/windows/clang-cl/config:cc-toolchain +build:rbe-toolchain-gcc --platforms=@envoy//bazel/rbe/toolchains:rbe_linux_gcc_platform +build:rbe-toolchain-gcc --host_platform=@envoy//bazel/rbe/toolchains:rbe_linux_gcc_platform +build:rbe-toolchain-gcc --crosstool_top=@envoy//bazel/rbe/toolchains/configs/linux/gcc/cc:toolchain +build:rbe-toolchain-gcc --extra_toolchains=@envoy//bazel/rbe/toolchains/configs/linux/gcc/config:cc-toolchain build:remote --spawn_strategy=remote,sandboxed,local build:remote --strategy=Javac=remote,sandboxed,local build:remote --strategy=Closure=remote,sandboxed,local build:remote --strategy=Genrule=remote,sandboxed,local -build:remote --remote_timeout=7200 -build:remote --google_default_credentials=true -build:remote --remote_download_toplevel -build:remote --nobuild_runfile_links # Windows bazel does not allow sandboxed as a spawn strategy build:remote-windows --spawn_strategy=remote,local build:remote-windows --strategy=Javac=remote,local build:remote-windows --strategy=Closure=remote,local build:remote-windows --strategy=Genrule=remote,local +build:remote-windows --strategy=CppLink=local build:remote-windows --remote_timeout=7200 build:remote-windows --google_default_credentials=true build:remote-windows --remote_download_toplevel @@ -290,6 +317,7 @@ build:remote-clang-libc++ --config=remote build:remote-clang-libc++ --config=rbe-toolchain-clang-libc++ build:remote-gcc --config=remote +build:remote-gcc --config=gcc build:remote-gcc --config=rbe-toolchain-gcc build:remote-asan --config=remote @@ -312,9 +340,28 @@ build:remote-clang-cl --config=remote-windows build:remote-clang-cl --config=clang-cl build:remote-clang-cl --config=rbe-toolchain-clang-cl +## Compile-time-options testing +# Right now, none of the available compile-time options conflict with each other. If this +# changes, this build type may need to be broken up. +build:compile-time-options --define=admin_html=disabled +build:compile-time-options --define=signal_trace=disabled +build:compile-time-options --define=hot_restart=disabled +build:compile-time-options --define=google_grpc=disabled +build:compile-time-options --define=boringssl=fips +build:compile-time-options --define=log_debug_assert_in_release=enabled +build:compile-time-options --define=path_normalization_by_default=true +build:compile-time-options --define=deprecated_features=disabled +build:compile-time-options --define=tcmalloc=gperftools +build:compile-time-options --define=zlib=ng +build:compile-time-options --define=uhv=enabled +build:compile-time-options --config=libc++20 +build:compile-time-options --test_env=ENVOY_HAS_EXTRA_EXTENSIONS=true +build:compile-time-options --@envoy//bazel:http3=False +build:compile-time-options --@envoy//source/extensions/filters/http/kill_request:enabled + # Docker sandbox # NOTE: Update this from https://github.com/envoyproxy/envoy-build-tools/blob/main/toolchains/rbe_toolchains_config.bzl#L8 -build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:f94a38f62220a2b017878b790b6ea98a0f6c5f9c +build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:f94a38f62220a2b017878b790b6ea98a0f6c5f9c@sha256:2dd96b6f43c08ccabd5f4747fce5854f5f96af509b32e5cf6493f136e9833649 build:docker-sandbox --spawn_strategy=docker build:docker-sandbox --strategy=Javac=docker build:docker-sandbox --strategy=Closure=docker @@ -345,16 +392,13 @@ build:docker-tsan --config=rbe-toolchain-clang-libc++ build:docker-tsan --config=rbe-toolchain-tsan # CI configurations -build:remote-ci --remote_cache=grpcs://remotebuildexecution.googleapis.com -build:remote-ci --remote_executor=grpcs://remotebuildexecution.googleapis.com build:remote-ci --config=ci +build:remote-ci --remote_download_minimal + # Note this config is used by mobile CI also. build:ci --noshow_progress build:ci --noshow_loading_progress - -# Build Event Service -build:google-bes --bes_backend=grpcs://buildeventservice.googleapis.com -build:google-bes --bes_results_url=https://source.cloud.google.com/results/invocations/ +build:ci --test_output=errors # Fuzz builds @@ -403,7 +447,7 @@ build:windows --define hot_restart=disabled build:windows --define tcmalloc=disabled build:windows --define wasm=disabled build:windows --define manual_stamp=manual_stamp -build:windows --cxxopt="/std:c++17" +build:windows --cxxopt="/std:c++20" build:windows --output_groups=+pdb_file # TODO(wrowe,sunjayBhatia): Resolve bugs upstream in curl and rules_foreign_cc @@ -445,6 +489,75 @@ build:windows --features=fully_static_link build:windows --features=static_link_msvcrt build:windows --dynamic_mode=off +# RBE (Google) +build:cache-google --google_default_credentials=true +build:cache-google --remote_cache=grpcs://remotebuildexecution.googleapis.com +build:cache-google --remote_instance_name=projects/envoy-ci/instances/default_instance +build:cache-google --remote_timeout=7200 +build:rbe-google --remote_executor=grpcs://remotebuildexecution.googleapis.com +build:rbe-google --config=cache-google + +build:rbe-google-bes --bes_backend=grpcs://buildeventservice.googleapis.com +build:rbe-google-bes --bes_results_url=https://source.cloud.google.com/results/invocations/ +build:rbe-google-bes --bes_upload_mode=fully_async + +# RBE (Engflow mobile) +build:rbe-engflow --google_default_credentials=false +build:rbe-engflow --remote_cache=grpcs://envoy.cluster.engflow.com +build:rbe-engflow --remote_executor=grpcs://envoy.cluster.engflow.com +build:rbe-engflow --bes_backend=grpcs://envoy.cluster.engflow.com/ +build:rbe-engflow --bes_results_url=https://envoy.cluster.engflow.com/invocation/ +build:rbe-engflow --credential_helper=*.engflow.com=%workspace%/bazel/engflow-bazel-credential-helper.sh +build:rbe-engflow --grpc_keepalive_time=30s +build:rbe-engflow --remote_timeout=3600s +build:rbe-engflow --bes_timeout=3600s +build:rbe-engflow --bes_upload_mode=fully_async +build:rbe-engflow --nolegacy_important_outputs + +# RBE (Engflow Envoy) +build:common-envoy-engflow --google_default_credentials=false +build:common-envoy-engflow --credential_helper=*.engflow.com=%workspace%/bazel/engflow-bazel-credential-helper.sh +build:common-envoy-engflow --grpc_keepalive_time=30s + +build:cache-envoy-engflow --remote_cache=grpcs://morganite.cluster.engflow.com +build:cache-envoy-engflow --remote_timeout=3600s +build:bes-envoy-engflow --bes_backend=grpcs://morganite.cluster.engflow.com/ +build:bes-envoy-engflow --bes_results_url=https://morganite.cluster.engflow.com/invocation/ +build:bes-envoy-engflow --bes_timeout=3600s +build:bes-envoy-engflow --bes_upload_mode=fully_async +build:bes-envoy-engflow --nolegacy_important_outputs +build:rbe-envoy-engflow --remote_executor=grpcs://morganite.cluster.engflow.com +build:rbe-envoy-engflow --remote_default_exec_properties=container-image=docker://gcr.io/envoy-ci/envoy-build@sha256:7adc40c09508f957624c4d2e0f5aeecb73a59207ee6ded53b107eac828c091b2 +build:rbe-envoy-engflow --jobs=200 +build:rbe-envoy-engflow --define=engflow_rbe=true + +build:remote-envoy-engflow --config=common-envoy-engflow +build:remote-envoy-engflow --config=cache-envoy-engflow +build:remote-envoy-engflow --config=bes-envoy-engflow +build:remote-envoy-engflow --config=rbe-envoy-engflow + +############################################################################# +# debug: Various Bazel debugging flags +############################################################################# +# debug/bazel +common:debug-bazel --announce_rc +common:debug-bazel -s +# debug/sandbox +common:debug-sandbox --verbose_failures +common:debug-sandbox --sandbox_debug +# debug/coverage +common:debug-coverage --action_env=VERBOSE_COVERAGE=true +common:debug-coverage --test_env=VERBOSE_COVERAGE=true +common:debug-coverage --test_env=DISPLAY_LCOV_CMD=true +common:debug-coverage --config=debug-tests +# debug/tests +common:debug-tests --test_output=all +# debug/everything +common:debug --config=debug-bazel +common:debug --config=debug-sandbox +common:debug --config=debug-coverage +common:debug --config=debug-tests + try-import %workspace%/clang.bazelrc try-import %workspace%/user.bazelrc try-import %workspace%/test.bazelrc diff --git a/bazel/extensions/extensions_build_config.bzl b/bazel/extensions/extensions_build_config.bzl index c19d88e41..44b89513d 100644 --- a/bazel/extensions/extensions_build_config.bzl +++ b/bazel/extensions/extensions_build_config.bzl @@ -81,6 +81,7 @@ EXTENSIONS = { "envoy.matching.matchers.ip": "//source/extensions/matching/input_matchers/ip:config", "envoy.matching.matchers.runtime_fraction": "//source/extensions/matching/input_matchers/runtime_fraction:config", "envoy.matching.matchers.cel_matcher": "//source/extensions/matching/input_matchers/cel_matcher:config", + "envoy.matching.matchers.metadata_matcher": "//source/extensions/matching/input_matchers/metadata:config", # # Network Matchers @@ -109,6 +110,11 @@ EXTENSIONS = { # "envoy.matching.inputs.cel_data_input": "//source/extensions/matching/http/cel_input:cel_input_lib", + # + # Dynamic Metadata Matching Input + # + "envoy.matching.inputs.dynamic_metadata": "//source/extensions/matching/http/metadata_input:metadata_input_lib", + # # Matching actions # @@ -118,7 +124,7 @@ EXTENSIONS = { # # StringMatchers # - # "envoy.string_matcher.lua": "//source/extensions/string_matcher/lua:config", + "envoy.string_matcher.lua": "//source/extensions/string_matcher/lua:config", # # HTTP filters @@ -170,6 +176,7 @@ EXTENSIONS = { "envoy.filters.http.oauth2": "//source/extensions/filters/http/oauth2:config", "envoy.filters.http.on_demand": "//source/extensions/filters/http/on_demand:config", "envoy.filters.http.original_src": "//source/extensions/filters/http/original_src:config", + "envoy.filters.http.proto_message_extraction": "//source/extensions/filters/http/proto_message_extraction: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", @@ -218,6 +225,7 @@ EXTENSIONS = { "envoy.filters.network.sni_dynamic_forward_proxy": "//source/extensions/filters/network/sni_dynamic_forward_proxy:config", "envoy.filters.network.wasm": "//source/extensions/filters/network/wasm:config", "envoy.filters.network.zookeeper_proxy": "//source/extensions/filters/network/zookeeper_proxy:config", + "envoy.filters.network.generic_proxy": "//source/extensions/filters/network/generic_proxy:config", # # UDP filters @@ -239,7 +247,8 @@ EXTENSIONS = { "envoy.resource_monitors.fixed_heap": "//source/extensions/resource_monitors/fixed_heap:config", "envoy.resource_monitors.injected_resource": "//source/extensions/resource_monitors/injected_resource:config", - "envoy.resource_monitors.downstream_connections": "//source/extensions/resource_monitors/downstream_connections:config", + "envoy.resource_monitors.global_downstream_max_connections": "//source/extensions/resource_monitors/downstream_connections:config", + "envoy.resource_monitors.cpu_utilization": "//source/extensions/resource_monitors/cpu_utilization:config", # # Stat sinks @@ -257,16 +266,15 @@ EXTENSIONS = { # Thrift filters # - "envoy.filters.thrift.router": "//source/extensions/filters/network/thrift_proxy/router:config", - "envoy.filters.thrift.header_to_metadata": "//source/extensions/filters/network/thrift_proxy/filters/header_to_metadata:config", + # "envoy.filters.thrift.router": "//source/extensions/filters/network/thrift_proxy/router:config", + # "envoy.filters.thrift.header_to_metadata": "//source/extensions/filters/network/thrift_proxy/filters/header_to_metadata:config", # "envoy.filters.thrift.payload_to_metadata": "//source/extensions/filters/network/thrift_proxy/filters/payload_to_metadata:config", - "envoy.filters.thrift.rate_limit": "//source/extensions/filters/network/thrift_proxy/filters/ratelimit:config", + # "envoy.filters.thrift.rate_limit": "//source/extensions/filters/network/thrift_proxy/filters/ratelimit:config", # # Tracers # - "envoy.tracers.dynamic_ot": "//source/extensions/tracers/dynamic_ot:config", "envoy.tracers.datadog": "//source/extensions/tracers/datadog:config", "envoy.tracers.zipkin": "//source/extensions/tracers/zipkin:config", "envoy.tracers.opencensus": "//source/extensions/tracers/opencensus:config", @@ -287,7 +295,7 @@ EXTENSIONS = { # "envoy.tracers.opentelemetry.samplers.always_on": "//source/extensions/tracers/opentelemetry/samplers/always_on:config", - # "envoy.tracers.opentelemetry.samplers.dynatrace": "//source/extensions/tracers/opentelemetry/samplers/dynatrace:config", + "envoy.tracers.opentelemetry.samplers.dynatrace": "//source/extensions/tracers/opentelemetry/samplers/dynatrace:config", # # Transport sockets @@ -488,6 +496,7 @@ EXTENSIONS = { "envoy.load_balancing_policies.ring_hash": "//source/extensions/load_balancing_policies/ring_hash:config", "envoy.load_balancing_policies.subset": "//source/extensions/load_balancing_policies/subset:config", "envoy.load_balancing_policies.cluster_provided": "//source/extensions/load_balancing_policies/cluster_provided:config", + "envoy.load_balancing_policies.client_side_weighted_round_robin": "//source/extensions/load_balancing_policies/client_side_weighted_round_robin:config", # # HTTP Early Header Mutation @@ -519,6 +528,13 @@ EXTENSIONS = { # "envoy.router.cluster_specifier_plugin.lua": "//source/extensions/router/cluster_specifiers/lua:config", + + # + # Extensions for generic proxy + # + # "envoy.filters.generic.router": "//source/extensions/filters/network/generic_proxy/router:config", + # "envoy.generic_proxy.codecs.dubbo": "//source/extensions/filters/network/generic_proxy/codecs/dubbo:config", + # "envoy.generic_proxy.codecs.http1": "//source/extensions/filters/network/generic_proxy/codecs/http1:config", } # These can be changed to ["//visibility:public"], for downstream builds which diff --git a/bazel/foreign_cc/0001-ratelimit-filter-state-hits-addend.patch b/bazel/foreign_cc/0001-ratelimit-filter-state-hits-addend.patch deleted file mode 100644 index c3b1c8ab5..000000000 --- a/bazel/foreign_cc/0001-ratelimit-filter-state-hits-addend.patch +++ /dev/null @@ -1,86 +0,0 @@ -diff --git source/extensions/filters/http/ratelimit/BUILD source/extensions/filters/http/ratelimit/BUILD -index fd4c15c81a..6d56028db5 100644 ---- source/extensions/filters/http/ratelimit/BUILD -+++ source/extensions/filters/http/ratelimit/BUILD -@@ -20,11 +20,13 @@ envoy_cc_library( - ":ratelimit_headers_lib", - "//envoy/http:codes_interface", - "//envoy/ratelimit:ratelimit_interface", -+ "//envoy/stream_info:uint32_accessor_interface", - "//source/common/common:assert_lib", - "//source/common/common:empty_string", - "//source/common/common:enum_to_int", - "//source/common/http:codes_lib", - "//source/common/router:config_lib", -+ "//source/common/stream_info:uint32_accessor_lib", - "//source/extensions/filters/common/ratelimit:ratelimit_client_interface", - "//source/extensions/filters/common/ratelimit:stat_names_lib", - "@envoy_api//envoy/extensions/filters/http/ratelimit/v3:pkg_cc_proto", -diff --git source/extensions/filters/http/ratelimit/ratelimit.cc source/extensions/filters/http/ratelimit/ratelimit.cc -index 382029e5f3..ec108cd5cb 100644 ---- source/extensions/filters/http/ratelimit/ratelimit.cc -+++ source/extensions/filters/http/ratelimit/ratelimit.cc -@@ -4,6 +4,7 @@ - #include - - #include "envoy/http/codes.h" -+#include "envoy/stream_info/stream_info.h" - - #include "source/common/common/assert.h" - #include "source/common/common/enum_to_int.h" -@@ -11,6 +12,7 @@ - #include "source/common/http/codes.h" - #include "source/common/http/header_utility.h" - #include "source/common/router/config_impl.h" -+#include "source/common/stream_info/uint32_accessor_impl.h" - #include "source/extensions/filters/http/ratelimit/ratelimit_headers.h" - - namespace Envoy { -@@ -18,6 +20,26 @@ namespace Extensions { - namespace HttpFilters { - namespace RateLimitFilter { - -+namespace { -+constexpr absl::string_view HitsAddendFilterStateKey = "envoy.ratelimit.hits_addend"; -+ -+class HitsAddendObjectFactory : public StreamInfo::FilterState::ObjectFactory { -+public: -+ std::string name() const override { return std::string(HitsAddendFilterStateKey); } -+ std::unique_ptr -+ createFromBytes(absl::string_view data) const override { -+ uint32_t hits_addend = 0; -+ if (absl::SimpleAtoi(data, &hits_addend)) { -+ return std::make_unique(hits_addend); -+ } -+ return nullptr; -+ } -+}; -+ -+REGISTER_FACTORY(HitsAddendObjectFactory, StreamInfo::FilterState::ObjectFactory); -+ -+} // namespace -+ - struct RcDetailsValues { - // This request went above the configured limits for the rate limit filter. - const std::string RateLimited = "request_rate_limited"; -@@ -64,11 +86,19 @@ void Filter::initiateCall(const Http::RequestHeaderMap& headers) { - break; - } - -+ const StreamInfo::UInt32Accessor* hits_addend_filter_state = -+ callbacks_->streamInfo().filterState()->getDataReadOnly( -+ "envoy.ratelimit.hits_addend"); -+ double hits_addend = 0; -+ if (hits_addend_filter_state != nullptr) { -+ hits_addend = hits_addend_filter_state->value(); -+ } -+ - if (!descriptors.empty()) { - state_ = State::Calling; - initiating_call_ = true; - client_->limit(*this, getDomain(), descriptors, callbacks_->activeSpan(), -- callbacks_->streamInfo(), 0); -+ callbacks_->streamInfo(), hits_addend); - initiating_call_ = false; - } - } diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 314f307e6..51bfc128f 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -66,8 +66,6 @@ def _repository_impl(name, **kwargs): ) def envoy_gloo_dependencies(): - _repository_impl("envoy", patches=[ - "@envoy_gloo//bazel/foreign_cc:0001-ratelimit-filter-state-hits-addend.patch", - ]) + _repository_impl("envoy", patches=[]) _repository_impl("json", build_file = "@envoy_gloo//bazel/external:json.BUILD") _repository_impl("inja", build_file = "@envoy_gloo//bazel/external:inja.BUILD") diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index 4c4f2d77d..88f1a5a2e 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -2,8 +2,8 @@ REPOSITORY_LOCATIONS = dict( # can't have more than one comment between envoy line and commit line in # order to accommodate `check_extensions_build_config.sh` envoy = dict( - # envoy v1.31.2++ ci and checksums - commit = "418f3b1ab891d14c110132e10178282fdf4c5081", + # envoy v1.32.1 + commit = "f7f0a80edac7e3fd6e37330b7307416c67f954ab", remote = "https://github.com/envoyproxy/envoy", ), inja = dict( diff --git a/changelog/v1.32.1-patch1/update-to-upstream-envoy-v1.32.yaml b/changelog/v1.32.1-patch1/update-to-upstream-envoy-v1.32.yaml new file mode 100644 index 000000000..37852919c --- /dev/null +++ b/changelog/v1.32.1-patch1/update-to-upstream-envoy-v1.32.yaml @@ -0,0 +1,10 @@ +changelog: +- type: DEPENDENCY_BUMP + dependencyOwner: envoyproxy + dependencyRepo: envoy + dependencyTag: v1.32.1 + resolvesIssue: false + description: >- + Update Envoy to v1.32 + issueLink: https://github.com/solo-io/envoy-gloo-ee/issues/843 + diff --git a/source/common/matcher/BUILD b/source/common/matcher/BUILD index 2fe07a78f..5e3451a86 100644 --- a/source/common/matcher/BUILD +++ b/source/common/matcher/BUILD @@ -15,7 +15,6 @@ envoy_cc_library( srcs = ["solo_matcher.cc"], hdrs = ["solo_matcher.h"], repository = "@envoy", - external_deps = ["abseil_optional"], deps = [ "@envoy//source/common/router:config_lib", "@envoy//source/common/http:header_utility_lib", @@ -23,6 +22,7 @@ envoy_cc_library( "@envoy_api//envoy/api/v2/route:pkg_cc_proto", "@envoy_api//envoy/config/route/v3:pkg_cc_proto", "//source/common/regex:regex_lib", + "@com_google_absl//absl/types:optional", ], ) diff --git a/source/common/nats/nuid/BUILD b/source/common/nats/nuid/BUILD index 167c285a4..658c0e6a7 100644 --- a/source/common/nats/nuid/BUILD +++ b/source/common/nats/nuid/BUILD @@ -12,7 +12,6 @@ envoy_cc_library( name = "nuid_lib", srcs = ["nuid.cc"], hdrs = ["nuid.h"], - external_deps = ["abseil_optional"], repository = "@envoy", deps = [ "@envoy//envoy/runtime:runtime_interface", diff --git a/source/common/nats/streaming/BUILD b/source/common/nats/streaming/BUILD index 8fe4f3deb..892980d2f 100644 --- a/source/common/nats/streaming/BUILD +++ b/source/common/nats/streaming/BUILD @@ -59,11 +59,11 @@ envoy_cc_library( name = "heartbeat_handler_lib", srcs = ["heartbeat_handler.cc"], hdrs = ["heartbeat_handler.h"], - external_deps = ["abseil_optional"], repository = "@envoy", deps = [ "//include/envoy/nats/streaming:inbox_handler_interface", "//source/common/nats:message_builder_lib", + "@com_google_absl//absl/types:optional", ], ) @@ -71,10 +71,10 @@ envoy_cc_library( name = "message_utility_lib", srcs = ["message_utility.cc"], hdrs = ["message_utility.h"], - external_deps = ["abseil_optional"], repository = "@envoy", deps = [ "//api/envoy/type/streaming:pkg_cc_proto", + "@com_google_absl//absl/types:optional", ], ) diff --git a/source/common/regex/BUILD b/source/common/regex/BUILD index db10faaa0..9f56b10a1 100644 --- a/source/common/regex/BUILD +++ b/source/common/regex/BUILD @@ -15,13 +15,13 @@ envoy_cc_library( srcs = ["regex.cc"], hdrs = ["regex.h"], repository = "@envoy", - external_deps = ["abseil_optional"], deps = [ # "@envoy//source/common/router:config_lib", # "@envoy//source/common/http:header_utility_lib", # "@envoy_api//envoy/api/v2/route:pkg_cc_proto", # "@envoy_api//envoy/config/route/v3:pkg_cc_proto", "@envoy//envoy/common:regex_interface", + "@com_google_absl//absl/types:optional", ], ) diff --git a/test/extensions/filters/http/transformation/BUILD b/test/extensions/filters/http/transformation/BUILD index 27e810ea2..fd8a0b005 100644 --- a/test/extensions/filters/http/transformation/BUILD +++ b/test/extensions/filters/http/transformation/BUILD @@ -47,15 +47,13 @@ envoy_gloo_cc_test( envoy_cc_test_binary( name = "inja_transformer_speed_test", srcs = ["inja_transformer_speed_test.cc"], - external_deps = [ - "benchmark", - ], repository = "@envoy", deps = [ "//source/extensions/filters/http/transformation:inja_transformer_lib", "@envoy//test/mocks/http:http_mocks", "@envoy//test/mocks/server:server_mocks", "@envoy//test/mocks/upstream:upstream_mocks", + "@com_github_google_benchmark//:benchmark", ], )