Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
Update Envoy to 031f75d (Mar 14th 2021) (#2061)
Browse files Browse the repository at this point in the history
* Update Envoy to 8e6b176b89240d1b8ce3f3e4a8e276e4a40fcd1e


* Update Envoy to 867b9e23d2e48350bd1b0d1fbc392a8355f20e35

Envoy fetcher test asserts on shutdown. No fix included here.

* ran tools/fix-format.sh, small cleanup

* Update Envoy to 031f75d (Mar 14th 2021)

* Update travis.yml
  • Loading branch information
oschaaf authored Mar 19, 2021
1 parent b0edead commit d8070cf
Show file tree
Hide file tree
Showing 22 changed files with 163 additions and 81 deletions.
139 changes: 93 additions & 46 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# This file is inspired by its counterpart over at the Envoy repository.
# The following .bazelrc content is forked from the main Envoy repository. This is necessary since
# this needs to be available before we can access the Envoy repository contents via Bazel.

build:clang-asan --test_timeout=900
build:clang-tsan --test_timeout=900
# See https://github.com/envoyproxy/nighthawk/issues/405
build:macos --copt -UDEBUG

# The following .bazelrc content is forked from the main Envoy repository. # unique
# This is necessary since this needs to be available before we can access # unique
# the Envoy repository contents via Bazel. # unique
# unique
build:clang-asan --test_timeout=900 # unique
build:clang-tsan --test_timeout=900 # unique
# See https://github.com/envoyproxy/nighthawk/issues/405 # unique
build:macos --copt -UDEBUG # unique
# unique
# Envoy specific Bazel build/test options.

# Bazel doesn't need more than 200MB of memory for local build based on memory profiling:
# https://docs.bazel.build/versions/master/skylark/performance.html#memory-profiling
# The default JVM max heapsize is 1/4 of physical memory up to 32GB which could be large
# enough to consume all memory constrained by cgroup in large host, which is the case in CircleCI.
# enough to consume all memory constrained by cgroup in large host.
# Limiting JVM heapsize here to let it do GC more when approaching the limit to
# leave room for compiler/linker.
# The number 2G is choosed heuristically to both support in CircleCI and large enough for RBE.
# The number 2G is chosen heuristically to both support large VM and small VM with RBE.
# Startup options cannot be selected via config.
startup --host_jvm_args=-Xmx2g

Expand All @@ -28,7 +28,8 @@ build --host_javabase=@bazel_tools//tools/jdk:remote_jdk11
build --javabase=@bazel_tools//tools/jdk:remote_jdk11
build --enable_platform_specific_config

# Enable position independent code, this option is not supported on Windows and default on on macOS.
# Enable position independent code (this is the default on macOS and Windows)
# (Workaround for https://github.com/bazelbuild/rules_foreign_cc/issues/421)
build:linux --copt=-fPIC
build:linux --cxxopt=-std=c++17
build:linux --conlyopt=-fexceptions
Expand All @@ -44,9 +45,6 @@ build --action_env=CXX
build --action_env=LLVM_CONFIG
build --action_env=PATH

# Skip system ICU linking.
build --@com_googlesource_googleurl//build_config:system_icu=0

# Common flags for sanitizers
build:sanitizer --define tcmalloc=disabled
build:sanitizer --linkopt -ldl
Expand All @@ -63,8 +61,10 @@ 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 --copt -fsanitize=address,undefined
build:asan --linkopt -fsanitize=address,undefined
# The following two lines were manually edited due to #593. # unique
# Flag undefined was dropped from both the lines to allow CI/ASAN to pass. # unique
build:asan --copt -fsanitize=address # unique
build:asan --linkopt -fsanitize=address # unique
# vptr and function sanitizer are enabled in clang-asan if it is set up via bazel/setup_clang.sh.
build:asan --copt -fno-sanitize=vptr,function
build:asan --linkopt -fno-sanitize=vptr,function
Expand All @@ -73,6 +73,9 @@ build:asan --copt -D__SANITIZE_ADDRESS__
build:asan --test_env=ASAN_OPTIONS=handle_abort=1:allow_addr2line=true:check_initialization_order=true:strict_init_order=true:detect_odr_violation=1
build:asan --test_env=UBSAN_OPTIONS=halt_on_error=true:print_stacktrace=1
build:asan --test_env=ASAN_SYMBOLIZER_PATH
# ASAN needs -O1 to get reasonable performance.
build:asan --copt -O1
build:asan --copt -fno-optimize-sibling-calls

# Clang ASAN/UBSAN
build:clang-asan --config=asan
Expand Down Expand Up @@ -121,7 +124,8 @@ build:libc++ --config=clang
build:libc++ --action_env=CXXFLAGS=-stdlib=libc++
build:libc++ --action_env=LDFLAGS=-stdlib=libc++
build:libc++ --action_env=BAZEL_CXXOPTS=-stdlib=libc++
build:libc++ --action_env=BAZEL_LINKLIBS=-l%:libc++.a:-l%:libc++abi.a:-lm
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

# Optimize build for binary size reduction.
Expand All @@ -138,6 +142,7 @@ build:coverage --action_env=GCOV=llvm-profdata
build:coverage --copt=-DNDEBUG
# 1.5x original timeout + 300s for trace merger in all categories
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
Expand All @@ -149,10 +154,10 @@ build:coverage --strategy=CoverageReport=sandboxed,local
build:coverage --experimental_use_llvm_covmap
build:coverage --collect_code_coverage
build:coverage --test_tag_filters=-nocoverage
build:coverage --instrumentation_filter="//source(?!/extensions/quic_listeners/quiche/platform)[/:],//include[/:]"
coverage:test-coverage --test_arg="-l trace"
coverage:fuzz-coverage --config=plain-fuzzer
coverage:fuzz-coverage --run_under=@envoy//bazel/coverage:fuzz_coverage_wrapper.sh
build:coverage --instrumentation_filter="//source(?!/common/chromium_url|/extensions/quic_listeners/quiche/platform)[/:],//include[/:]"
build:test-coverage --test_arg="-l trace"
build:fuzz-coverage --config=plain-fuzzer
build:fuzz-coverage --run_under=@envoy//bazel/coverage:fuzz_coverage_wrapper.sh

# Remote execution: https://docs.bazel.build/versions/master/remote-execution.html
build:rbe-toolchain --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
Expand All @@ -174,6 +179,16 @@ 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 --linkopt -fuse-ld=lld
build:rbe-toolchain-asan --action_env=ENVOY_UBSAN_VPTR=1
build:rbe-toolchain-asan --copt=-fsanitize=vptr,function
build:rbe-toolchain-asan --linkopt=-fsanitize=vptr,function
build:rbe-toolchain-asan --linkopt=-L/opt/llvm/lib/clang/11.0.1/lib/linux
build:rbe-toolchain-asan --linkopt=-l:libclang_rt.ubsan_standalone-x86_64.a
build:rbe-toolchain-asan --linkopt=-l:libclang_rt.ubsan_standalone_cxx-x86_64.a

build:rbe-toolchain-msan --linkopt=-L/opt/libcxx_msan/lib
build:rbe-toolchain-msan --linkopt=-Wl,-rpath,/opt/libcxx_msan/lib
build:rbe-toolchain-msan --config=clang-msan
Expand Down Expand Up @@ -224,6 +239,10 @@ build:remote-clang-libc++ --config=rbe-toolchain-clang-libc++
build:remote-gcc --config=remote
build:remote-gcc --config=rbe-toolchain-gcc

build:remote-asan --config=remote
build:remote-asan --config=rbe-toolchain-clang-libc++
build:remote-asan --config=rbe-toolchain-asan

build:remote-msan --config=remote
build:remote-msan --config=rbe-toolchain-clang-libc++
build:remote-msan --config=rbe-toolchain-msan
Expand All @@ -237,8 +256,8 @@ build:remote-clang-cl --config=clang-cl
build:remote-clang-cl --config=rbe-toolchain-clang-cl

# Docker sandbox
# NOTE: Update this from https://github.com/envoyproxy/envoy-build-tools/blob/master/toolchains/rbe_toolchains_config.bzl#L8
build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:e7ea4e81bbd5028abb9d3a2f2c0afe063d9b62c0
# 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:e33c93e6d79804bf95ff80426d10bdcc9096c785
build:docker-sandbox --spawn_strategy=docker
build:docker-sandbox --strategy=Javac=docker
build:docker-sandbox --strategy=Closure=docker
Expand Down Expand Up @@ -269,20 +288,41 @@ build:remote-ci --remote_cache=grpcs://remotebuildexecution.googleapis.com
build:remote-ci --remote_executor=grpcs://remotebuildexecution.googleapis.com

# Fuzz builds
# -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION is passed in in the bazel build target
# rules for fuzz tests. Passing it in the CLI will cause dependencies to be build
# with the macro. Causing issues in RouteMatcherTest.TestRoutes that expect prod
# behavior from RE2 library.

# Shared fuzzing configuration.
build:fuzzing --define=ENVOY_CONFIG_ASAN=1
build:fuzzing --copt=-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
build:fuzzing --config=libc++

# Fuzzing without ASAN. This is useful for profiling fuzzers without any ASAN artifacts.
build:plain-fuzzer --config=fuzzing
build:plain-fuzzer --define=FUZZING_ENGINE=libfuzzer
# The fuzzing rules provide their own instrumentation, but it is currently
# disabled due to bazelbuild/bazel#12888. Instead, we provide instrumentation at
# the top level through these options.
build:plain-fuzzer --copt=-fsanitize=fuzzer-no-link
build:plain-fuzzer --linkopt=-fsanitize=fuzzer-no-link

build:asan-fuzzer --config=plain-fuzzer
build:asan-fuzzer --config=asan
build:asan-fuzzer --define=FUZZING_ENGINE=libfuzzer
build:asan-fuzzer --copt=-fsanitize=fuzzer-no-link
build:asan-fuzzer --copt=-fno-omit-frame-pointer
# Remove UBSAN halt_on_error to avoid crashing on protobuf errors.
build:asan-fuzzer --test_env=UBSAN_OPTIONS=print_stacktrace=1

# Fuzzing without ASAN. This is useful for profiling fuzzers without any ASAN artifacts.
build:plain-fuzzer --define=FUZZING_ENGINE=libfuzzer
build:plain-fuzzer --define ENVOY_CONFIG_ASAN=1
build:oss-fuzz --config=fuzzing
build:oss-fuzz --define=FUZZING_ENGINE=oss-fuzz
build:oss-fuzz --@rules_fuzzing//fuzzing:cc_engine_instrumentation=oss-fuzz
build:oss-fuzz --@rules_fuzzing//fuzzing:cc_engine_sanitizer=none
build:oss-fuzz --dynamic_mode=off
build:oss-fuzz --strip=never
build:oss-fuzz --copt=-fno-sanitize=vptr
build:oss-fuzz --linkopt=-fno-sanitize=vptr
build:oss-fuzz --define=tcmalloc=disabled
build:oss-fuzz --define=signal_trace=disabled
build:oss-fuzz --copt=-D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
build:oss-fuzz --define=force_libcpp=enabled
build:oss-fuzz --linkopt=-lc++
build:oss-fuzz --linkopt=-pthread

# Compile database generation config
build:compdb --build_tag_filters=-nocompdb
Expand All @@ -292,30 +332,37 @@ build:windows --action_env=TMPDIR
build:windows --define signal_trace=disabled
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"

# Should not be required after upstream fix to bazel,
# and already a no-op to linux/macos builds
# see issue https://github.com/bazelbuild/rules_foreign_cc/issues/301
# TODO(wrowe,sunjayBhatia): Resolve bugs upstream in curl and rules_foreign_cc
# See issue https://github.com/bazelbuild/rules_foreign_cc/issues/301
build:windows --copt="-DCARES_STATICLIB"
build:windows --copt="-DNGHTTP2_STATICLIB"
build:windows --copt="-DCURL_STATICLIB"
build:windows --cxxopt="/std:c++17"

# Required to work around build defects on Windows MSVC cl
# Unguarded gcc pragmas in quiche are not recognized by MSVC
build:msvc-cl --copt="/wd4068"
# Allows 'nodiscard' function return values to be discarded
build:msvc-cl --copt="/wd4834"
# Allows inline functions to be undefined
build:msvc-cl --copt="/wd4506"
build:msvc-cl --copt="-D_SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING"
# Override any clang preference if building msvc-cl
# Drop the determinism feature (-DDATE etc are a no-op in msvc-cl)
build:msvc-cl --action_env=USE_CLANG_CL=""
build:msvc-cl --define clang_cl=0
build:msvc-cl --features=-determinism

# Windows build behaviors when using clang-cl
build:clang-cl --action_env=USE_CLANG_CL=1
build:clang-cl --define clang_cl=1

# Required to work around Windows clang-cl build defects
# Ignore conflicting definitions of _WIN32_WINNT
# Overriding __TIME__ etc is problematic (and is actually an invalid no-op)
# Override determinism flags (DATE etc) is valid on clang-cl compiler
build:clang-cl --copt="-Wno-macro-redefined"
build:clang-cl --copt="-Wno-builtin-macro-redefined"
# Workaround problematic missing override declarations of mocks
# TODO: resolve this class of problematic mocks, e.g.
# ./test/mocks/http/stream.h(16,21): error: 'addCallbacks'
# overrides a member function but is not marked 'override'
# MOCK_METHOD(void, addCallbacks, (StreamCallbacks & callbacks));
build:clang-cl --copt="-Wno-inconsistent-missing-override"
build:clang-cl --action_env=USE_CLANG_CL=1

# Defaults to 'auto' - Off for windows, so override to linux behavior
Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.4.1
3.7.2
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ before_install:
- sudo apt-get update -q
- sudo apt-get install -q -y git
- sudo apt-get install pkg-config zip g++ zlib1g-dev unzip python3 ninja-build cmake gperf memcached apache2-dev python2 clang-10
- wget https://github.com/bazelbuild/bazel/releases/download/3.4.1/bazel-3.4.1-installer-linux-x86_64.sh
- chmod +x bazel-3.4.1-installer-linux-x86_64.sh
- ./bazel-3.4.1-installer-linux-x86_64.sh --user
- wget https://github.com/bazelbuild/bazel/releases/download/3.7.2/bazel-3.7.2-installer-linux-x86_64.sh
- chmod +x bazel-3.7.2-installer-linux-x86_64.sh
- ./bazel-3.7.2-installer-linux-x86_64.sh --user
- sudo service memcached start
- sudo service redis-server start
env:
Expand Down
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{
"label": "test-all fastbuild",
"type": "shell",
"command": "bazel test --test_env=REDIS_PORT=6379 --test_env=MEMCACHED_PORT=11211 //...",
"command": "bazel test --test_env=REDIS_PORT=6379 --test_env=MEMCACHED_PORT=11211 -- //... -//benchmark/...",
"problemMatcher": [
"$gcc"
],
Expand Down
4 changes: 2 additions & 2 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ load(":aprutil.bzl", "aprutil_build_rule")
load(":serf.bzl", "serf_build_rule")
load(":closure_compiler.bzl", "closure_library_rules")

ENVOY_COMMIT = "25db910b0f12ec22ddad82f5f1ea49efe3df635a" # September 9th, 2020
ENVOY_SHA = "cf26c7ed8b170e4f45ca57b11d21d2c339a3584488d273d0c0a62baaf6265cd5"
ENVOY_COMMIT = "031f75dd113e2f7be41b94a0365145e7bf1e6c12" # March 14th, 2021
ENVOY_SHA = "20f5f98cc9a5c1ddd2c3de434b019273e3dbe02afe52396b90d74fab38dba4ba"
BROTLI_COMMIT = "d6d98957ca8ccb1ef45922e978bb10efca0ea541"
BROTLI_SHA = "ba8be5d701b369f86d14f3701c81d6bf6c6c34015c183ff98352c12ea5f5226b"
HIREDIS_COMMIT = "0.14.1" # July 24th, 2020
Expand Down
6 changes: 3 additions & 3 deletions benchmark/net/instaweb/rewriter/rewrite_driver_speed_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
#include "pagespeed/kernel/http/user_agent_matcher.h"
#include "pagespeed/opt/http/property_cache.h"
#include "test/net/instaweb/http/mock_url_fetcher.h"
#include "test/net/instaweb/rewriter/test_rewrite_driver_factory.h"
#include "test/net/instaweb/rewriter/rewrite_test_base.h"
#include "test/net/instaweb/rewriter/test_rewrite_driver_factory.h"

// clang-format off
#include "benchmark/benchmark.h"
Expand All @@ -61,8 +61,8 @@ class SpeedTestContext {
SpeedTestContext() {
StopBenchmarkTiming();
RewriteDriverFactory::Initialize();
factory_.reset(
new TestRewriteDriverFactory(RewriteTestBase::process_context(), "/tmp", &fetcher_));
factory_.reset(new TestRewriteDriverFactory(
RewriteTestBase::process_context(), "/tmp", &fetcher_));
TestRewriteDriverFactory::InitStats(factory_->statistics());
server_context_ = factory_->CreateServerContext();
StartBenchmarkTiming();
Expand Down
3 changes: 3 additions & 0 deletions extensions_build_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ EXTENSIONS = {
"envoy.transport_sockets.raw_buffer": "//source/extensions/transport_sockets/raw_buffer:config",
}

DISABLED_BY_DEFAULT_EXTENSIONS = {
}

# These can be changed to ["//visibility:public"], for downstream builds which
# need to directly reference Envoy extensions.
EXTENSION_CONFIG_VISIBILITY = ["//visibility:public"]
Expand Down
3 changes: 3 additions & 0 deletions pagespeed/envoy/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ envoy_cc_library(
"@envoy//source/common/network:dns_lib_with_external_headers",
"@envoy//source/common/network:utility_lib_with_external_headers",
"@envoy//source/common/protobuf:message_validator_lib_with_external_headers",
"@envoy//source/common/router:context_lib_with_external_headers",
"@envoy//source/common/runtime:runtime_lib_with_external_headers",
"@envoy//source/common/secret:secret_manager_impl_lib_with_external_headers",
"@envoy//source/common/singleton:manager_impl_lib_with_external_headers",
Expand All @@ -146,6 +147,8 @@ envoy_cc_library(
"@envoy//source/extensions/transport_sockets:well_known_names_with_external_headers",
"@envoy//source/extensions/transport_sockets/tls:context_lib_with_external_headers",
"@envoy//source/server/config_validation:admin_lib_with_external_headers",
"@envoy//source/server:options_lib_with_external_headers",
"@envoy//source/server:server_lib_with_external_headers",
],
)

Expand Down
Loading

0 comments on commit d8070cf

Please sign in to comment.