Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit 4124bee

Browse files
authored
Update to Envoy ff49762696b2e6ed3f408a22e1f7a1b7d2487318 (Oct 11th) (#2104)
* Update Envoy to 1a79dd654d0502816511bc4f43d26a71b9a144a0 (Sep 12th) Add pagespeed.bazelrc with our modifications so that our .bazelrc will be identical to Envoy's * Update to Envoy ff49762696b2e6ed3f408a22e1f7a1b7d2487318 (Oct 11th) - Note: needed to define ABSL_LEGACY_THREAD_ANNOTATIONS. Looks like some of absl's annotations have been renamed - fmt started complaining about StringPiece as an input. Needed to tweak logging and introduce some tech debt to strip newlines at the end of the log line without adding memory copying
1 parent 6e516af commit 4124bee

File tree

5 files changed

+47
-55
lines changed

5 files changed

+47
-55
lines changed

.bazelrc

Lines changed: 5 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
# The following .bazelrc content is forked from the main Envoy repository. # unique
2-
# This is necessary since this needs to be available before we can access # unique
3-
# the Envoy repository contents via Bazel. # unique
4-
# unique
5-
build:clang-asan --test_timeout=900 # unique
6-
build:clang-tsan --test_timeout=900 # unique
7-
# See https://github.com/envoyproxy/nighthawk/issues/405 # unique
8-
build:macos --copt -UDEBUG # unique
9-
# unique
101
# Envoy specific Bazel build/test options.
112

123
# Bazel doesn't need more than 200MB of memory for local build based on memory profiling:
@@ -23,8 +14,6 @@ run --color=yes
2314

2415
build --color=yes
2516
build --workspace_status_command="bash bazel/get_workspace_status"
26-
# TODO: https://github.com/envoyproxy/envoy/issues/22758
27-
build --incompatible_use_platforms_repo_for_constraints=false
2817
build --incompatible_strict_action_env
2918
build --host_force_python=PY3
3019
build --java_runtime_version=remotejdk_11
@@ -49,7 +38,7 @@ common --experimental_allow_tags_propagation
4938
# (Workaround for https://github.com/bazelbuild/rules_foreign_cc/issues/421)
5039
build:linux --copt=-fPIC
5140
build:linux --copt=-Wno-deprecated-declarations
52-
build:linux --cxxopt=-std=c++17
41+
build:linux --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
5342
build:linux --conlyopt=-fexceptions
5443
build:linux --fission=dbg,opt
5544
build:linux --features=per_object_debug_info
@@ -109,11 +98,10 @@ build:clang-asan --linkopt --rtlib=compiler-rt
10998
build:clang-asan --linkopt --unwindlib=libgcc
11099

111100
# macOS
112-
build:macos --cxxopt=-std=c++17
101+
build:macos --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
113102
build:macos --action_env=PATH=/opt/homebrew/bin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin
114103
build:macos --host_action_env=PATH=/opt/homebrew/bin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin
115104
build:macos --define tcmalloc=disabled
116-
build:macos --define wasm=disabled
117105

118106
# macOS ASAN/UBSAN
119107
build:macos-asan --config=asan
@@ -192,7 +180,7 @@ build:coverage --strategy=CoverageReport=sandboxed,local
192180
build:coverage --experimental_use_llvm_covmap
193181
build:coverage --collect_code_coverage
194182
build:coverage --test_tag_filters=-nocoverage
195-
build:coverage --instrumentation_filter="//source(?!/common/quic/platform)[/:],//include[/:],//contrib(?!/.*/test)[/:]"
183+
build:coverage --instrumentation_filter="//source(?!/common/quic/platform)[/:],//envoy[/:],//contrib(?!/.*/test)[/:]"
196184
build:test-coverage --test_arg="-l trace"
197185
build:fuzz-coverage --config=plain-fuzzer
198186
build:fuzz-coverage --run_under=@envoy//bazel/coverage:fuzz_coverage_wrapper.sh
@@ -299,7 +287,7 @@ build:remote-clang-cl --config=rbe-toolchain-clang-cl
299287

300288
# Docker sandbox
301289
# NOTE: Update this from https://github.com/envoyproxy/envoy-build-tools/blob/main/toolchains/rbe_toolchains_config.bzl#L8
302-
build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:3de483a98c5e24973e710b4f97b2dabcd3cb621f
290+
build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:b0ff77ae3f25b0bf595f9b8bba46b489723ab446
303291
build:docker-sandbox --spawn_strategy=docker
304292
build:docker-sandbox --strategy=Javac=docker
305293
build:docker-sandbox --strategy=Closure=docker
@@ -430,32 +418,4 @@ try-import %workspace%/user.bazelrc
430418
try-import %workspace%/local_tsan.bazelrc
431419

432420
###### modifications for pagespeed
433-
build --linkopt -ldl
434-
435-
# objcopy 2.31 doesn't like clang-7's output unless we pass in -fno-addrsig
436-
# https://github.com/travitch/whole-program-llvm/issues/75
437-
# not passing this in will make the scripts that rename symbols fail
438-
#build --copt=-fno-addrsig
439-
440-
build:clang-asan --linkopt=-fno-sanitize=alignment
441-
build:asan --copt=-fno-sanitize=alignment
442-
build:clang-asan --copt=-fno-omit-frame-pointer
443-
444-
test --test_env=REDIS_PORT=6379
445-
test --test_env=MEMCACHED_PORT=11211
446-
test --test_env=HTTPS_TEST=1
447-
448-
build --copt="-Iexternal/aprutil/include/"
449-
build --copt="-Iexternal/aprutil/include/private/"
450-
build --copt="-Iexternal/aprutil/include/arch/unix/"
451-
build --copt="-Iexternal/aprutil/"
452-
build --copt="-Ithird_party/aprutil/gen/arch/linux/x64/include/"
453-
build --copt="-Ithird_party/apr/gen/arch/linux/x64/include/"
454-
build --copt="-Iexternal/apr/include/"
455-
build --copt="-Iexternal/apr/include/arch/unix/"
456-
build --copt="-Iexternal/apr/"
457-
build --copt="-Iexternal/serf/include/"
458-
build --copt="-Iexternal/serf/"
459-
build --copt="-DPAGESPEED_SUPPORT_POSIX_SHARED_MEM=1"
460-
461-
build --action_env=BAZEL_CXXOPTS="-std=c++17"
421+
try-import %workspace%/pagespeed.bazelrc

bazel/repositories.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ load(":aprutil.bzl", "aprutil_build_rule")
1313
load(":serf.bzl", "serf_build_rule")
1414
load(":closure_compiler.bzl", "closure_library_rules")
1515

16-
ENVOY_COMMIT = "dc168055154a99d10a2b170e8da078c6e8d001f3" # Aug 29th, 2022
17-
ENVOY_SHA = "b8cb775ffdae81b734ad9d15dce3af381facd17a28e477d0ba2837c56c2f667c"
16+
ENVOY_COMMIT = "ff49762696b2e6ed3f408a22e1f7a1b7d2487318" # Oct 11th, 2022
17+
ENVOY_SHA = "ff8303892364ec1be7e5be13e112bc45309aee2bc4da5c4ff035885367f24795"
1818

1919
BROTLI_COMMIT = "d6d98957ca8ccb1ef45922e978bb10efca0ea541"
2020
BROTLI_SHA = "ba8be5d701b369f86d14f3701c81d6bf6c6c34015c183ff98352c12ea5f5226b"

pagespeed.bazelrc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# modifications for pagespeed over Envoy's stock config
2+
3+
build --linkopt -ldl
4+
5+
build:clang-asan --linkopt=-fno-sanitize=alignment
6+
build:asan --copt=-fno-sanitize=alignment
7+
build:clang-asan --copt=-fno-omit-frame-pointer
8+
9+
test --test_env=REDIS_PORT=6379
10+
test --test_env=MEMCACHED_PORT=11211
11+
test --test_env=HTTPS_TEST=1
12+
13+
build --copt="-Iexternal/aprutil/include/"
14+
build --copt="-Iexternal/aprutil/include/private/"
15+
build --copt="-Iexternal/aprutil/include/arch/unix/"
16+
build --copt="-Iexternal/aprutil/"
17+
build --copt="-Ithird_party/aprutil/gen/arch/linux/x64/include/"
18+
build --copt="-Ithird_party/apr/gen/arch/linux/x64/include/"
19+
build --copt="-Iexternal/apr/include/"
20+
build --copt="-Iexternal/apr/include/arch/unix/"
21+
build --copt="-Iexternal/apr/"
22+
build --copt="-Iexternal/serf/include/"
23+
build --copt="-Iexternal/serf/"
24+
build --copt="-DPAGESPEED_SUPPORT_POSIX_SHARED_MEM=1"
25+
26+
build --action_env=ABSL_LEGACY_THREAD_ANNOTATIONS=1
27+
build --copt="-DABSL_LEGACY_THREAD_ANNOTATIONS=1"
28+
build --cxxopt="-DABSL_LEGACY_THREAD_ANNOTATIONS=1"
29+
30+
build --action_env=BAZEL_CXXOPTS="-std=c++17"

pagespeed/envoy/log_message_handler.cc

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,23 @@ class Logger : public Envoy::Logger::Loggable<Envoy::Logger::Id::main> {
3737
// TODO(oschaaf): if log level is fatal we need to do more:
3838
// - if debugging, break
3939
// - else log stack trace.
40-
StringPiece message = str;
41-
absl::ConsumeSuffix(&message, "\n");
40+
// TODO(oschaaf): fmt started complaining about StringPiece as an input.
41+
// We need to strip the newline, but not introduce memory copying here.
42+
//StringPiece message = str;
43+
//absl::ConsumeSuffix(&message, "\n");
4244
constexpr char preamble[] = "[pagespeed %s] %s";
4345
switch (severity) {
4446
case logging::LOG_INFO:
45-
ENVOY_LOG(info, preamble, net_instaweb::kModPagespeedVersion, message);
47+
ENVOY_LOG(info, preamble, net_instaweb::kModPagespeedVersion, str);
4648
case logging::LOG_WARNING:
47-
ENVOY_LOG(warn, preamble, net_instaweb::kModPagespeedVersion, message);
49+
ENVOY_LOG(warn, preamble, net_instaweb::kModPagespeedVersion, str);
4850
case logging::LOG_ERROR:
49-
ENVOY_LOG(error, preamble, net_instaweb::kModPagespeedVersion, message);
51+
ENVOY_LOG(error, preamble, net_instaweb::kModPagespeedVersion, str);
5052
case logging::LOG_FATAL:
5153
ENVOY_LOG(critical, preamble, net_instaweb::kModPagespeedVersion,
52-
message);
54+
str);
5355
default: // For VLOG(s)
54-
ENVOY_LOG(debug, preamble, net_instaweb::kModPagespeedVersion, message);
56+
ENVOY_LOG(debug, preamble, net_instaweb::kModPagespeedVersion, str);
5557
}
5658
return true;
5759
}

pagespeed/kernel/base/thread_annotations.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
#pragma once
21-
21+
#define ABSL_LEGACY_THREAD_ANNOTATIONS 1
2222
#include "absl/base/thread_annotations.h"
2323

2424
// TODO(oschaaf): move this out of here.

0 commit comments

Comments
 (0)