Skip to content

Commit

Permalink
Update to Envoy 1.24.0 (#755)
Browse files Browse the repository at this point in the history
Closes #462

Signed-off-by: Teju Nareddy <nareddyt@google.com>
  • Loading branch information
nareddyt authored Nov 29, 2022
1 parent 66e00de commit c865900
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 35 deletions.
34 changes: 15 additions & 19 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@

# Required by envoy and its tests
build --define=grpc_no_ares=true
build --cxxopt='-std=c++17'
build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17

# We already have absl in the build, define absl=1 to tell googletest to use absl for backtrace.
build --define absl=1

# Compile a Position Independent Executable
# Ref: github.com/envoyproxy/envoy#8792
build --copt=-fPIC

# Other flags for the C++ compiler
build --show_timestamps
build --copt -Wno-unknown-warning-option
build --copt -Wno-error=vla-parameter

# Compilation modes
build:release -c opt
build:debug -c dbg

build --experimental_local_memory_estimate
build --experimental_strict_action_env=true
build --incompatible_strict_action_env=true
build --host_force_python=PY3
build --action_env=BAZEL_LINKLIBS=-l%:libstdc++.a
build --action_env=BAZEL_LINKOPTS=-lm
Expand All @@ -27,8 +28,8 @@ build --action_env=BAZEL_LINKOPTS=-lm
build --define absl=1

# Pass PATH variable from the environment. CC and CXX are always clang (no gcc).
build --action_env=CC=clang-13
build --action_env=CXX=clang++-13
build --action_env=CC=clang-14
build --action_env=CXX=clang++-14
build --action_env=PATH

# Disable ICU linking for googleurl.
Expand All @@ -42,7 +43,7 @@ build:sanitizer --test_tag_filters=-no_san

# Common flags for Clang
build:clang --action_env=BAZEL_COMPILER=clang
build:clang --linkopt=-fuse-ld=lld-13
build:clang --linkopt=-fuse-ld=lld-14

# Compile with the Scudo allocator
# https://llvm.org/docs/ScudoHardenedAllocator.html
Expand All @@ -63,13 +64,8 @@ build:asan --config=debug
build:asan --define signal_trace=disabled
build:asan --define ENVOY_CONFIG_ASAN=1

# FIXME(nareddyt): Enable ubsan builds
# See https://github.com/GoogleCloudPlatform/esp-v2/issues/462
#
# build:asan --copt -fsanitize=address,undefined
# build:asan --linkopt -fsanitize=address,undefined
build:asan --copt -fsanitize=address
build:asan --linkopt -fsanitize=address
build:asan --copt -fsanitize=address,undefined
build:asan --linkopt -fsanitize=address,undefined


build:asan --copt -DADDRESS_SANITIZER=1
Expand All @@ -80,7 +76,7 @@ build:asan --test_env=ASAN_SYMBOLIZER_PATH

build:clang-asan --config=asan
build:clang-asan --action_env=ENVOY_UBSAN_VPTR=1
build:clang-asan --linkopt -fuse-ld=lld-13
build:clang-asan --linkopt -fuse-ld=lld-14
build:clang-asan --copt -fno-sanitize=vptr,function
build:clang-asan --linkopt -fno-sanitize=vptr,function
build:clang-asan --copt -fno-optimize-sibling-calls
Expand All @@ -97,8 +93,8 @@ build:clang-tsan --copt -DEVENT__DISABLE_DEBUG_MODE
# Fuzz builds
build:asan-fuzzer --config=clang-asan
build:asan-fuzzer -c opt
build:asan-fuzzer --action_env=CC=clang-13
build:asan-fuzzer --action_env=CXX=clang++-13
build:asan-fuzzer --action_env=CC=clang-14
build:asan-fuzzer --action_env=CXX=clang++-14
build:asan-fuzzer --nocache_test_results
build:asan-fuzzer --define=FUZZING_ENGINE=libfuzzer
build:asan-fuzzer --copt=-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
Expand All @@ -110,8 +106,8 @@ build:asan-fuzzer --test_env=UBSAN_OPTIONS=print_stacktrace=1
coverage --config=coverage
build:coverage --action_env=BAZEL_USE_LLVM_NATIVE_COVERAGE=1
build:coverage --action_env=GCOV=llvm-profdata
build:coverage --action_env=CC=clang-13
build:coverage --action_env=CXX=clang++-13
build:coverage --action_env=CC=clang-14
build:coverage --action_env=CXX=clang++-14
build:coverage --copt=-DNDEBUG
build:coverage --test_timeout=900
build:coverage --define=ENVOY_CONFIG_COVERAGE=1
Expand Down
6 changes: 3 additions & 3 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ It is recommended to use [Bazelisk](https://github.com/bazelbuild/bazelisk) inst

To get started building Envoy locally, following the instructions from [Envoy](https://github.com/envoyproxy/envoy/blob/master/bazel/README.md#quick-start-bazel-build-for-developers).

## Install Clang-13
## Install Clang-14

Add the package sources with the following commands.
If these commands fail, reference [the official clang installation instructions](https://apt.llvm.org/) for your OS.
Expand All @@ -37,8 +37,8 @@ Install the following packages:

```
sudo apt-get update
sudo apt-get install -y llvm-13-dev libclang-13-dev clang-13 \
clang-tools-13 clang-format-13 xz-utils lld-13
sudo apt-get install -y llvm-14-dev libclang-14-dev clang-14 \
clang-tools-14 clang-format-14 xz-utils lld-14
```

## Install build tools
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ test-envoy: clang-format

test-envoy-asan: clang-format
@echo "--> running envoy's unit tests (asan)"
ASAN_SYMBOLIZER_PATH=$(which llvm-symbolizer-13) bazelisk test --config=clang-asan --test_output=errors //src/...
ASAN_SYMBOLIZER_PATH=$(which llvm-symbolizer-14) bazelisk test --config=clang-asan --test_output=errors //src/...

test-envoy-tsan: clang-format
@echo "--> running envoy's unit tests (tsan)"
ASAN_SYMBOLIZER_PATH=$(which llvm-symbolizer-13) bazelisk test --config=clang-tsan --test_output=errors //src/...
ASAN_SYMBOLIZER_PATH=$(which llvm-symbolizer-14) bazelisk test --config=clang-tsan --test_output=errors //src/...

.PHONY: integration-test-run-sequential integration-test-run-parallel integration-test integration-test-asan integration-test-tsan integration-debug
integration-test-run-sequential:
Expand Down Expand Up @@ -295,7 +295,7 @@ format: tools.goimports tools.buildifier
.PHONY: clang-format shell-format
clang-format:
@echo "--> formatting code with 'clang-format' tool"
@echo $(CPP_PROTO_FILES) | xargs clang-format-13 -i
@echo $(CPP_PROTO_FILES) | xargs clang-format-14 -i

shell-format: tools.beautysh
@echo "--> formatting shell scripts with 'beautysh' tool"
Expand Down
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# 3) Check if envoy_build_config/extensions_build_config.bzl is up-to-date.
# Try to match it with the one in source/extensions and comment out unneeded extensions.

ENVOY_SHA1 = "ce49c7f65668a22b80d1e83c35d170741bb8d46a" # v1.23.0 2022-07-15
ENVOY_SHA1 = "15baf56003f33a07e0ab44f82f75a660040db438" # v1.24.0 2022-10-19

ENVOY_SHA256 = "33975319b86087ad1bd22162c0bc8cf573b6be4aae9c53897dee148e955eb27c"
ENVOY_SHA256 = "ef227c0938d149ed9b7f69bb3d8eb3bc97e05cfacb8bb1b66dd4823662b34dde"

http_archive(
name = "envoy",
Expand Down
12 changes: 6 additions & 6 deletions docker/Dockerfile-prow-env
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ RUN apt-get install -y nodejs
RUN wget -O /usr/local/bin/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64 && \
chmod +x /usr/local/bin/bazelisk

# install clang-10 and associated tools (new envoy)
# install clang-14 and associated tools (new envoy)
RUN wget -O- https://apt.llvm.org/llvm-snapshot.gpg.key| apt-key add - && \
echo "deb https://apt.llvm.org/buster/ llvm-toolchain-buster-13 main" >> /etc/apt/sources.list && \
echo "deb https://apt.llvm.org/buster/ llvm-toolchain-buster-14 main" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y llvm-13 llvm-13-dev libclang-13-dev clang-13 \
lld-13 clang-tools-13 clang-format-13 libc++-dev xz-utils
apt-get install -y llvm-14 llvm-14-dev libclang-14-dev clang-14 \
lld-14 clang-tools-14 clang-format-14 libc++-dev xz-utils

ENV CC clang-13
ENV CXX clang++-13
ENV CC clang-14
ENV CXX clang++-14

# install golang and setup Go standard envs
ENV GOPATH /go
Expand Down
2 changes: 1 addition & 1 deletion scripts/all-utilities.sh
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ function try_setup_bazel_remote_cache() {
local root_dir=$3
local presubmit_test_case=$4
local gcp_project_id="cloudesf-testing"
local silo_uuid="v6"
local silo_uuid="v7"

# Determine if this job is running on a non-Prow host. All Prow jobs must have this env var
# https://github.com/kubernetes/test-infra/blob/master/prow/jobs.md#job-environment-variables
Expand Down
2 changes: 1 addition & 1 deletion src/envoy/http/service_control/filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Envoy::Http::FilterHeadersStatus ServiceControlFilter::decodeHeaders(
// Update later filters that the HTTP method has changed by clearing the
// route cache.
ENVOY_LOG(debug, "HTTP method override occurred, recalculating route");
decoder_callbacks_->clearRouteCache();
decoder_callbacks_->downstreamCallbacks()->clearRouteCache();
}

// Make sure route is calculated
Expand Down

0 comments on commit c865900

Please sign in to comment.