From 8ad8a2d779441329f07668336ab34c5c418a3fab Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Wed, 22 Sep 2021 17:41:04 +0000 Subject: [PATCH 01/10] use clang 12 Signed-off-by: Lizan Zhou --- .bazelrc | 42 +++++++++++------------ .devcontainer/Dockerfile | 2 +- bazel/dependency_imports.bzl | 2 -- bazel/external/envoy_build_tools.patch | 39 +++++++++++++++++++++ bazel/repositories.bzl | 6 +++- bazel/repository_locations.bzl | 6 ++-- examples/wasm-cc/docker-compose-wasm.yaml | 4 +-- 7 files changed, 71 insertions(+), 30 deletions(-) create mode 100644 bazel/external/envoy_build_tools.patch diff --git a/.bazelrc b/.bazelrc index aa0bd7859825..0028a084e27f 100644 --- a/.bazelrc +++ b/.bazelrc @@ -167,17 +167,17 @@ build:fuzz-coverage --run_under=@envoy//bazel/coverage:fuzz_coverage_wrapper.sh build:rbe-toolchain --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 build:rbe-toolchain-clang --config=rbe-toolchain -build:rbe-toolchain-clang --platforms=@rbe_ubuntu_clang//config:platform -build:rbe-toolchain-clang --host_platform=@rbe_ubuntu_clang//config:platform -build:rbe-toolchain-clang --crosstool_top=@rbe_ubuntu_clang//cc:toolchain -build:rbe-toolchain-clang --extra_toolchains=@rbe_ubuntu_clang//config:cc-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-libc++ --config=rbe-toolchain -build:rbe-toolchain-clang-libc++ --platforms=@rbe_ubuntu_clang_libcxx//config:platform -build:rbe-toolchain-clang-libc++ --host_platform=@rbe_ubuntu_clang_libcxx//config:platform -build:rbe-toolchain-clang-libc++ --crosstool_top=@rbe_ubuntu_clang_libcxx//cc:toolchain -build:rbe-toolchain-clang-libc++ --extra_toolchains=@rbe_ubuntu_clang_libcxx//config:cc-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++ --action_env=CXXFLAGS=-stdlib=libc++ build:rbe-toolchain-clang-libc++ --action_env=LDFLAGS=-stdlib=libc++ @@ -202,20 +202,20 @@ 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=@rbe_ubuntu_gcc//config:platform -build:rbe-toolchain-gcc --host_platform=@rbe_ubuntu_gcc//config:platform -build:rbe-toolchain-gcc --crosstool_top=@rbe_ubuntu_gcc//cc:toolchain -build:rbe-toolchain-gcc --extra_toolchains=@rbe_ubuntu_gcc//config:cc-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=@rbe_windows_msvc_cl//config:platform -build:rbe-toolchain-msvc-cl --platforms=@rbe_windows_msvc_cl//config:platform -build:rbe-toolchain-msvc-cl --crosstool_top=@rbe_windows_msvc_cl//cc:toolchain -build:rbe-toolchain-msvc-cl --extra_toolchains=@rbe_windows_msvc_cl//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=@rbe_windows_clang_cl//config:platform -build:rbe-toolchain-clang-cl --platforms=@rbe_windows_clang_cl//config:platform -build:rbe-toolchain-clang-cl --crosstool_top=@rbe_windows_clang_cl//cc:toolchain -build:rbe-toolchain-clang-cl --extra_toolchains=@rbe_windows_clang_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:remote --spawn_strategy=remote,sandboxed,local build:remote --strategy=Javac=remote,sandboxed,local @@ -265,7 +265,7 @@ build:remote-clang-cl --config=rbe-toolchain-clang-cl # 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:55d9e4719d2bd0accce8f829b44dab70cd42112a +build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:8ca107a75ee98b255aa59db2ab40fd0800a3ce99 build:docker-sandbox --spawn_strategy=docker build:docker-sandbox --strategy=Javac=docker build:docker-sandbox --strategy=Closure=docker diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 378a45b4f1af..5f9ca2079ec8 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM gcr.io/envoy-ci/envoy-build:55d9e4719d2bd0accce8f829b44dab70cd42112a +FROM gcr.io/envoy-ci/envoy-build:8ca107a75ee98b255aa59db2ab40fd0800a3ce99 ARG USERNAME=vscode ARG USER_UID=501 diff --git a/bazel/dependency_imports.bzl b/bazel/dependency_imports.bzl index 7c806b08c98a..3523df854809 100644 --- a/bazel/dependency_imports.bzl +++ b/bazel/dependency_imports.bzl @@ -1,6 +1,5 @@ load("@rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependencies") load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") -load("@envoy_build_tools//toolchains:rbe_toolchains_config.bzl", "rbe_toolchains_config") load("@bazel_toolchains//rules/exec_properties:exec_properties.bzl", "create_rbe_exec_properties_dict", "custom_exec_properties") load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies") @@ -17,7 +16,6 @@ def envoy_dependency_imports(go_version = GO_VERSION): rules_foreign_cc_dependencies() go_rules_dependencies() go_register_toolchains(go_version) - rbe_toolchains_config() gazelle_dependencies() apple_rules_dependencies() rust_repositories() diff --git a/bazel/external/envoy_build_tools.patch b/bazel/external/envoy_build_tools.patch new file mode 100644 index 000000000000..e8f292953a71 --- /dev/null +++ b/bazel/external/envoy_build_tools.patch @@ -0,0 +1,39 @@ +diff --git a/toolchains/configs/linux/clang/cc/cc_toolchain_config.bzl b/toolchains/configs/linux/clang/cc/cc_toolchain_config.bzl +index 5dbaa86..3c90e3b 100755 +--- a/toolchains/configs/linux/clang/cc/cc_toolchain_config.bzl ++++ b/toolchains/configs/linux/clang/cc/cc_toolchain_config.bzl +@@ -386,7 +386,7 @@ def _impl(ctx): + ], + flag_groups = [ + flag_group( +- flags = ["-gsplit-dwarf"], ++ flags = ["-gsplit-dwarf", "-g2"], + expand_if_available = "per_object_debug_info_file", + ), + ], +diff --git a/toolchains/configs/linux/clang_libcxx/cc/cc_toolchain_config.bzl b/toolchains/configs/linux/clang_libcxx/cc/cc_toolchain_config.bzl +index 5dbaa86..3c90e3b 100755 +--- a/toolchains/configs/linux/clang_libcxx/cc/cc_toolchain_config.bzl ++++ b/toolchains/configs/linux/clang_libcxx/cc/cc_toolchain_config.bzl +@@ -386,7 +386,7 @@ def _impl(ctx): + ], + flag_groups = [ + flag_group( +- flags = ["-gsplit-dwarf"], ++ flags = ["-gsplit-dwarf", "-g2"], + expand_if_available = "per_object_debug_info_file", + ), + ], +diff --git a/toolchains/configs/linux/gcc/cc/cc_toolchain_config.bzl b/toolchains/configs/linux/gcc/cc/cc_toolchain_config.bzl +index 5dbaa86..3c90e3b 100755 +--- a/toolchains/configs/linux/gcc/cc/cc_toolchain_config.bzl ++++ b/toolchains/configs/linux/gcc/cc/cc_toolchain_config.bzl +@@ -386,7 +386,7 @@ def _impl(ctx): + ], + flag_groups = [ + flag_group( +- flags = ["-gsplit-dwarf"], ++ flags = ["-gsplit-dwarf", "-g2"], + expand_if_available = "per_object_debug_info_file", + ), + ], diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index cb8967cd6fae..570bfd2f523d 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -226,7 +226,11 @@ def envoy_dependencies(skip_targets = []): external_http_archive("com_github_google_flatbuffers") external_http_archive("bazel_toolchains") external_http_archive("bazel_compdb") - external_http_archive("envoy_build_tools") + external_http_archive( + name = "envoy_build_tools", + patch_args = ["-p1"], + patches = ["@envoy//bazel/external:envoy_build_tools.patch"], + ) external_http_archive("rules_cc") external_http_archive("rules_pkg") diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index d76537a00b84..6783b208b4c1 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -65,11 +65,11 @@ REPOSITORY_LOCATIONS_SPEC = dict( project_name = "envoy-build-tools", project_desc = "Common build tools shared by the Envoy/UDPA ecosystem", project_url = "https://github.com/envoyproxy/envoy-build-tools", - version = "a955a00bed5f35777a83899ee680f8530eee4718", - sha256 = "b0830dc6fc1e3a095c5d817ca768c89c407bdd71894e1641daf500d28cb269da", + version = "a9db6cde8e8d4404621e9631bba237c45e04ceed", + sha256 = "f2c7d4d5c4b18d85321d4c43686b8c5b5473a4ad9b1f8f4245d863a10367a9c0", strip_prefix = "envoy-build-tools-{version}", urls = ["https://github.com/envoyproxy/envoy-build-tools/archive/{version}.tar.gz"], - release_date = "2021-05-25", + release_date = "2021-09-17", use_category = ["build"], ), boringssl = dict( diff --git a/examples/wasm-cc/docker-compose-wasm.yaml b/examples/wasm-cc/docker-compose-wasm.yaml index 072928843f42..2d88bf48f173 100644 --- a/examples/wasm-cc/docker-compose-wasm.yaml +++ b/examples/wasm-cc/docker-compose-wasm.yaml @@ -2,7 +2,7 @@ version: "3.7" services: wasm_compile_update: - image: envoyproxy/envoy-build-ubuntu:55d9e4719d2bd0accce8f829b44dab70cd42112a + image: envoyproxy/envoy-build-ubuntu:8ca107a75ee98b255aa59db2ab40fd0800a3ce99 command: | bash -c "bazel build //examples/wasm-cc:envoy_filter_http_wasm_updated_example.wasm && cp -a bazel-bin/examples/wasm-cc/* /build" working_dir: /source @@ -11,7 +11,7 @@ services: - ./lib:/build wasm_compile: - image: envoyproxy/envoy-build-ubuntu:55d9e4719d2bd0accce8f829b44dab70cd42112a + image: envoyproxy/envoy-build-ubuntu:8ca107a75ee98b255aa59db2ab40fd0800a3ce99 command: | bash -c "bazel build //examples/wasm-cc:envoy_filter_http_wasm_example.wasm && cp -a bazel-bin/examples/wasm-cc/* /build" working_dir: /source From 1d67d212553cad249e311864fc96e5912727084c Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Thu, 23 Sep 2021 03:12:04 +0000 Subject: [PATCH 02/10] format Signed-off-by: Lizan Zhou --- api/envoy/config/filter/http/jwt_authn/v2alpha/config.proto | 3 ++- api/envoy/extensions/filters/http/jwt_authn/v3/config.proto | 3 ++- test/common/http/header_map_impl_test.cc | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/api/envoy/config/filter/http/jwt_authn/v2alpha/config.proto b/api/envoy/config/filter/http/jwt_authn/v2alpha/config.proto index 07044f92201e..847e36f163ba 100644 --- a/api/envoy/config/filter/http/jwt_authn/v2alpha/config.proto +++ b/api/envoy/config/filter/http/jwt_authn/v2alpha/config.proto @@ -390,7 +390,8 @@ message FilterStateRule { // A map of string keys to requirements. The string key is the string value // in the FilterState with the name specified in the *name* field above. - map requires = 3; + map + requires = 3; } // This is the Envoy HTTP filter config for JWT authentication. diff --git a/api/envoy/extensions/filters/http/jwt_authn/v3/config.proto b/api/envoy/extensions/filters/http/jwt_authn/v3/config.proto index 1f9a54ed7ff9..6d15956e1479 100644 --- a/api/envoy/extensions/filters/http/jwt_authn/v3/config.proto +++ b/api/envoy/extensions/filters/http/jwt_authn/v3/config.proto @@ -582,7 +582,8 @@ message FilterStateRule { // A map of string keys to requirements. The string key is the string value // in the FilterState with the name specified in the *name* field above. - map requires = 3; + map + requires = 3; } // This is the Envoy HTTP filter config for JWT authentication. diff --git a/test/common/http/header_map_impl_test.cc b/test/common/http/header_map_impl_test.cc index 98c35fae521c..ce4bb8a7ccd1 100644 --- a/test/common/http/header_map_impl_test.cc +++ b/test/common/http/header_map_impl_test.cc @@ -423,8 +423,9 @@ TEST_P(HeaderMapImplTest, AllInlineHeaders) { INLINE_REQ_RESP_STRING_HEADERS(TEST_INLINE_STRING_HEADER_FUNCS) } { - // No request trailer O(1) headers. - } { + // No request trailer O(1) headers. + } + { auto header_map = ResponseHeaderMapImpl::create(); INLINE_RESP_STRING_HEADERS(TEST_INLINE_STRING_HEADER_FUNCS) INLINE_REQ_RESP_STRING_HEADERS(TEST_INLINE_STRING_HEADER_FUNCS) From 6beae6576d9aa19658085b0ce6dc486f9562f42f Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Fri, 24 Sep 2021 22:03:56 +0000 Subject: [PATCH 03/10] fix Signed-off-by: Lizan Zhou --- bazel/dependency_imports.bzl | 3 +++ bazel/external/rules_cc.patch | 13 +++++++++++++ bazel/repositories.bzl | 6 +++++- bazel/repository_locations.bzl | 6 +++--- 4 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 bazel/external/rules_cc.patch diff --git a/bazel/dependency_imports.bzl b/bazel/dependency_imports.bzl index 3523df854809..27420706f0fd 100644 --- a/bazel/dependency_imports.bzl +++ b/bazel/dependency_imports.bzl @@ -8,6 +8,7 @@ load("@upb//bazel:workspace_deps.bzl", "upb_deps") load("@rules_rust//rust:repositories.bzl", "rust_repositories") load("@rules_antlr//antlr:deps.bzl", "antlr_dependencies") load("@proxy_wasm_rust_sdk//bazel:dependencies.bzl", "proxy_wasm_rust_sdk_dependencies") +load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains") # go version for rules_go GO_VERSION = "1.15.5" @@ -26,6 +27,8 @@ def envoy_dependency_imports(go_version = GO_VERSION): oss_fuzz = True, honggfuzz = False, ) + rules_cc_dependencies() + rules_cc_toolchains() custom_exec_properties( name = "envoy_large_machine_exec_property", diff --git a/bazel/external/rules_cc.patch b/bazel/external/rules_cc.patch new file mode 100644 index 000000000000..95994e57f236 --- /dev/null +++ b/bazel/external/rules_cc.patch @@ -0,0 +1,13 @@ +diff --git a/cc/private/toolchain/unix_cc_toolchain_config.bzl b/cc/private/toolchain/unix_cc_toolchain_config.bzl +index c3cf3ba..d207bbd 100644 +--- a/cc/private/toolchain/unix_cc_toolchain_config.bzl ++++ b/cc/private/toolchain/unix_cc_toolchain_config.bzl +@@ -313,7 +313,7 @@ def _impl(ctx): + ], + flag_groups = [ + flag_group( +- flags = ["-gsplit-dwarf"], ++ flags = ["-gsplit-dwarf", "-g2"], + expand_if_available = "per_object_debug_info_file", + ), + ], diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 570bfd2f523d..56ceb2eb2aa6 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -231,7 +231,11 @@ def envoy_dependencies(skip_targets = []): patch_args = ["-p1"], patches = ["@envoy//bazel/external:envoy_build_tools.patch"], ) - external_http_archive("rules_cc") + external_http_archive( + "rules_cc", + patch_args = ["-p1"], + patches = ["@envoy//bazel/external:rules_cc.patch"], + ) external_http_archive("rules_pkg") # Unconditional, since we use this only for compiler-agnostic fuzzing utils. diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index 6783b208b4c1..367a45cdfca3 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -653,11 +653,11 @@ REPOSITORY_LOCATIONS_SPEC = dict( project_desc = "Bazel rules for the C++ language", project_url = "https://github.com/bazelbuild/rules_cc", # TODO(lizan): pin to a point releases when there's a released version. - version = "b1c40e1de81913a3c40e5948f78719c28152486d", - sha256 = "71d037168733f26d2a9648ad066ee8da4a34a13f51d24843a42efa6b65c2420f", + version = "dd2758b96dc8f9f4add81eaa4154b7e3d8be6873", + sha256 = "67571de4070cff615f7232281d8b12d8400976d21c19d8274386ab02799269fb", strip_prefix = "rules_cc-{version}", urls = ["https://github.com/bazelbuild/rules_cc/archive/{version}.tar.gz"], - release_date = "2020-11-11", + release_date = "2021-09-17", use_category = ["build"], ), rules_foreign_cc = dict( From adbd679f5b26dcddfa7f3ceb285e6f68d0674325 Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Fri, 24 Sep 2021 22:04:45 +0000 Subject: [PATCH 04/10] fix Signed-off-by: Lizan Zhou --- test/run_envoy_bazel_coverage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/run_envoy_bazel_coverage.sh b/test/run_envoy_bazel_coverage.sh index 7a315a141635..e28a216078e4 100755 --- a/test/run_envoy_bazel_coverage.sh +++ b/test/run_envoy_bazel_coverage.sh @@ -2,7 +2,7 @@ set -e -LLVM_VERSION="11.0.1" +LLVM_VERSION="12.0.1" CLANG_VERSION=$(clang --version | grep version | sed -e 's/\ *clang version \(.*\)\ */\1/') LLVM_COV_VERSION=$(llvm-cov --version | grep version | sed -e 's/\ *LLVM version \(.*\)/\1/') LLVM_PROFDATA_VERSION=$(llvm-profdata show --version | grep version | sed -e 's/\ *LLVM version \(.*\)/\1/') From b0975944208df016c302a60b9cfc660c88935971 Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Fri, 24 Sep 2021 22:19:14 +0000 Subject: [PATCH 05/10] fix Signed-off-by: Lizan Zhou --- bazel/repository_locations.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index 367a45cdfca3..7a22cf95f5c3 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -640,7 +640,7 @@ REPOSITORY_LOCATIONS_SPEC = dict( sha256 = "69de5c704a05ff37862f7e0f5534d4f479418afc21806c887db544a316f3cb6b", urls = ["https://github.com/bazelbuild/rules_go/releases/download/v{version}/rules_go-v{version}.tar.gz"], use_category = ["build", "api"], - release_date = "2021-03-17", + release_date = "2021-03-18", implied_untracked_deps = [ "com_github_golang_protobuf", "io_bazel_rules_nogo", From 867de156d921cfc218ce82bcc07be4653a65acd6 Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Mon, 27 Sep 2021 19:36:57 +0000 Subject: [PATCH 06/10] -g instead of -g2 Signed-off-by: Lizan Zhou --- .devcontainer/devcontainer.json | 2 +- bazel/external/envoy_build_tools.patch | 6 +++--- bazel/external/rules_cc.patch | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 77852d506a02..53571c41d4a1 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,7 +7,7 @@ "--cap-add=NET_RAW", "--cap-add=NET_ADMIN", "--security-opt=seccomp=unconfined", - "--volume=${env:HOME}:${env:HOME}", + "--volume=/home:/home", "--volume=envoy-build:/build", "--network=host", // Uncomment next line if you have devcontainer.env diff --git a/bazel/external/envoy_build_tools.patch b/bazel/external/envoy_build_tools.patch index e8f292953a71..33d5362b45f6 100644 --- a/bazel/external/envoy_build_tools.patch +++ b/bazel/external/envoy_build_tools.patch @@ -7,7 +7,7 @@ index 5dbaa86..3c90e3b 100755 flag_groups = [ flag_group( - flags = ["-gsplit-dwarf"], -+ flags = ["-gsplit-dwarf", "-g2"], ++ flags = ["-gsplit-dwarf", "-g"], expand_if_available = "per_object_debug_info_file", ), ], @@ -20,7 +20,7 @@ index 5dbaa86..3c90e3b 100755 flag_groups = [ flag_group( - flags = ["-gsplit-dwarf"], -+ flags = ["-gsplit-dwarf", "-g2"], ++ flags = ["-gsplit-dwarf", "-g"], expand_if_available = "per_object_debug_info_file", ), ], @@ -33,7 +33,7 @@ index 5dbaa86..3c90e3b 100755 flag_groups = [ flag_group( - flags = ["-gsplit-dwarf"], -+ flags = ["-gsplit-dwarf", "-g2"], ++ flags = ["-gsplit-dwarf", "-g"], expand_if_available = "per_object_debug_info_file", ), ], diff --git a/bazel/external/rules_cc.patch b/bazel/external/rules_cc.patch index 95994e57f236..057545c920f3 100644 --- a/bazel/external/rules_cc.patch +++ b/bazel/external/rules_cc.patch @@ -7,7 +7,7 @@ index c3cf3ba..d207bbd 100644 flag_groups = [ flag_group( - flags = ["-gsplit-dwarf"], -+ flags = ["-gsplit-dwarf", "-g2"], ++ flags = ["-gsplit-dwarf", "-g"], expand_if_available = "per_object_debug_info_file", ), ], From c8a83445aeaef9745eddaf4d380e18633ad00c75 Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Mon, 27 Sep 2021 20:04:03 +0000 Subject: [PATCH 07/10] relatch coverage numbers Signed-off-by: Lizan Zhou --- test/per_file_coverage.sh | 105 ++++++++++++++++--------------- test/run_envoy_bazel_coverage.sh | 4 +- 2 files changed, 56 insertions(+), 53 deletions(-) diff --git a/test/per_file_coverage.sh b/test/per_file_coverage.sh index 6decf6b94275..a15405e643f8 100755 --- a/test/per_file_coverage.sh +++ b/test/per_file_coverage.sh @@ -3,63 +3,66 @@ # directory:coverage_percent # for existing directories with low coverage. declare -a KNOWN_LOW_COVERAGE=( -"source/common:96.5" # Raise when QUIC coverage goes up -"source/common/api:75.3" -"source/common/api/posix:73.9" -"source/common/common/posix:94.1" +"source/common:96.1" # Raise when QUIC coverage goes up +"source/common/api:79.8" +"source/common/api/posix:78.5" +"source/common/common/posix:92.7" +"source/common/config/xds_mux:94.5" "source/common/crypto:0.0" -"source/common/event:94.2" # Emulated edge events guards don't report LCOV -"source/common/filesystem/posix:96.2" -"source/common/json:90.9" -"source/common/network:95.0" # Flaky, `activateFileEvents`, `startSecureTransport` and `ioctl` do not always report LCOV -"source/common/protobuf:94.7" -"source/common/signal:84.5" # Death tests don't report LCOV -"source/common/singleton:95.8" +"source/common/event:94.1" # Emulated edge events guards don't report LCOV +"source/common/filesystem/posix:95.5" +"source/common/json:90.1" +"source/common/matcher:94.2" +"source/common/network:94.8" # Flaky, `activateFileEvents`, `startSecureTransport` and `ioctl` do not always report LCOV +"source/common/protobuf:95.3" +"source/common/quic:91.8" +"source/common/signal:86.9" # Death tests don't report LCOV +"source/common/singleton:95.7" +"source/common/tcp:94.6" "source/common/thread:0.0" # Death tests don't report LCOV -"source/common/matcher:95.0" -"source/common/quic:91.2" "source/common/tracing:96.1" -"source/common/watchdog:42.9" # Death tests don't report LCOV -"source/common/config/xds_mux:94.5" -"source/exe:94.3" -"source/extensions/common/crypto:91.5" -"source/extensions/common/tap:95.9" +"source/common/watchdog:58.6" # Death tests don't report LCOV +"source/exe:92.6" +"source/extensions/common:96.0" +"source/extensions/common/crypto:89.4" +"source/extensions/common/tap:94.2" "source/extensions/common/wasm:95.3" # flaky: be careful adjusting -"source/extensions/common/wasm/null:77.8" -"source/extensions/common/wasm/v8:85.4" -"source/extensions/filters/common/expr:96.4" -"source/extensions/filters/common/fault:94.6" -"source/extensions/filters/common/rbac:88.6" -"source/extensions/filters/http/cache:92.6" -"source/extensions/filters/http/cache/simple_http_cache:95.6" -"source/extensions/filters/http/grpc_json_transcoder:95.6" -"source/extensions/filters/http/ip_tagging:91.2" -"source/extensions/filters/http/kill_request:85.0" # Death tests don't report LCOV -"source/extensions/filters/listener/tls_inspector:92.4" -"source/extensions/filters/network/common:96.2" -"source/extensions/filters/network/common/redis:96.3" -"source/extensions/filters/network/mongo_proxy:94.0" -"source/extensions/filters/network/sni_cluster:90.3" -"source/extensions/filters/network/sni_dynamic_forward_proxy:90.9" -"source/extensions/health_checkers:95.9" -"source/extensions/health_checkers/redis:95.9" -"source/extensions/quic_listeners:85.1" -"source/extensions/stat_sinks/graphite_statsd:85.7" -"source/extensions/stat_sinks/statsd:85.2" -"source/extensions/tracers/opencensus:94.2" -"source/extensions/tracers/xray:96.4" -"source/extensions/transport_sockets:95.8" -"source/extensions/transport_sockets/tls/cert_validator:96.5" -"source/extensions/transport_sockets/tls/private_key:76.9" -"source/extensions/transport_sockets/tls:95.2" +"source/extensions/common/wasm/ext:92.0" +"source/extensions/filters/common:96.1" +"source/extensions/filters/common/fault:94.5" +"source/extensions/filters/common/rbac:88.1" +"source/extensions/filters/http/cache:93.4" +"source/extensions/filters/http/cache/simple_http_cache:96.0" +"source/extensions/filters/http/grpc_json_transcoder:94.7" +"source/extensions/filters/http/ip_tagging:89.1" +"source/extensions/filters/http/kill_request:95.3" # Death tests don't report LCOV +"source/extensions/filters/http/wasm:95.8" +"source/extensions/filters/listener/http_inspector:95.9" +"source/extensions/filters/listener/original_dst:93.3" +"source/extensions/filters/listener/tls_inspector:93.5" +"source/extensions/filters/network/common:96.0" +"source/extensions/filters/network/mongo_proxy:95.5" +"source/extensions/filters/network/sni_cluster:88.9" +"source/extensions/filters/network/sni_dynamic_forward_proxy:95.2" +"source/extensions/filters/network/wasm:95.7" +"source/extensions/health_checkers:95.7" +"source/extensions/health_checkers/redis:95.7" +"source/extensions/stat_sinks/graphite_statsd:88.5" +"source/extensions/stat_sinks/statsd:88.0" +"source/extensions/tracers/opencensus:94.8" +"source/extensions/tracers/zipkin:96.1" +"source/extensions/transport_sockets:95.4" +"source/extensions/transport_sockets/tls:94.6" +"source/extensions/transport_sockets/tls/cert_validator:96.0" +"source/extensions/transport_sockets/tls/private_key:77.8" "source/extensions/wasm_runtime/wamr:0.0" # Not enabled in coverage build "source/extensions/wasm_runtime/wasmtime:0.0" # Not enabled in coverage build "source/extensions/wasm_runtime/wavm:0.0" # Not enabled in coverage build -"source/extensions/watchdog:85.7" # Death tests within extensions -"source/extensions/watchdog/profile_action:85.7" -"source/server:94.4" # flaky: be careful adjusting. See https://github.com/envoyproxy/envoy/issues/15239 -"source/server/admin:95.8" -"source/server/config_validation:79.2" +"source/extensions/watchdog:83.3" # Death tests within extensions +"source/extensions/watchdog/profile_action:83.3" +"source/server:93.5" # flaky: be careful adjusting. See https://github.com/envoyproxy/envoy/issues/15239 +"source/server/admin:95.3" +"source/server/config_validation:76.7" ) [[ -z "${SRCDIR}" ]] && SRCDIR="${PWD}" @@ -67,7 +70,7 @@ COVERAGE_DIR="${SRCDIR}"/generated/coverage COVERAGE_DATA="${COVERAGE_DIR}/coverage.dat" FAILED=0 -DEFAULT_COVERAGE_THRESHOLD=96.6 +DEFAULT_COVERAGE_THRESHOLD=96.2 DIRECTORY_THRESHOLD=$DEFAULT_COVERAGE_THRESHOLD # Unfortunately we have a bunch of preexisting directory with low coverage. diff --git a/test/run_envoy_bazel_coverage.sh b/test/run_envoy_bazel_coverage.sh index e28a216078e4..2e7235ea4deb 100755 --- a/test/run_envoy_bazel_coverage.sh +++ b/test/run_envoy_bazel_coverage.sh @@ -28,7 +28,7 @@ fi [[ -z "${SRCDIR}" ]] && SRCDIR="${PWD}" [[ -z "${VALIDATE_COVERAGE}" ]] && VALIDATE_COVERAGE=true [[ -z "${FUZZ_COVERAGE}" ]] && FUZZ_COVERAGE=false -[[ -z "${COVERAGE_THRESHOLD}" ]] && COVERAGE_THRESHOLD=96.5 +[[ -z "${COVERAGE_THRESHOLD}" ]] && COVERAGE_THRESHOLD=96.2 COVERAGE_TARGET="${COVERAGE_TARGET:-}" read -ra BAZEL_BUILD_OPTIONS <<< "${BAZEL_BUILD_OPTIONS:-}" @@ -92,7 +92,7 @@ fi if [[ "$VALIDATE_COVERAGE" == "true" ]]; then if [[ "${FUZZ_COVERAGE}" == "true" ]]; then - COVERAGE_THRESHOLD=27.0 + COVERAGE_THRESHOLD=24.0 fi COVERAGE_FAILED=$(echo "${COVERAGE_VALUE}<${COVERAGE_THRESHOLD}" | bc) if [[ "${COVERAGE_FAILED}" -eq 1 ]]; then From edf7536543534d410b4716d1e16ba2f41c97f5b2 Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Mon, 27 Sep 2021 20:15:26 +0000 Subject: [PATCH 08/10] fix Signed-off-by: Lizan Zhou --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 53571c41d4a1..77852d506a02 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,7 +7,7 @@ "--cap-add=NET_RAW", "--cap-add=NET_ADMIN", "--security-opt=seccomp=unconfined", - "--volume=/home:/home", + "--volume=${env:HOME}:${env:HOME}", "--volume=envoy-build:/build", "--network=host", // Uncomment next line if you have devcontainer.env From 0b9fcdc758d9400915322655a07c0aa92f20ae1e Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Mon, 27 Sep 2021 20:37:20 +0000 Subject: [PATCH 09/10] fix Signed-off-by: Lizan Zhou --- test/per_file_coverage.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/test/per_file_coverage.sh b/test/per_file_coverage.sh index a15405e643f8..f9d6c1caa0cf 100755 --- a/test/per_file_coverage.sh +++ b/test/per_file_coverage.sh @@ -11,16 +11,19 @@ declare -a KNOWN_LOW_COVERAGE=( "source/common/crypto:0.0" "source/common/event:94.1" # Emulated edge events guards don't report LCOV "source/common/filesystem/posix:95.5" +"source/common/http:96.5" "source/common/json:90.1" "source/common/matcher:94.2" "source/common/network:94.8" # Flaky, `activateFileEvents`, `startSecureTransport` and `ioctl` do not always report LCOV "source/common/protobuf:95.3" "source/common/quic:91.8" +"source/common/secret:96.3" "source/common/signal:86.9" # Death tests don't report LCOV "source/common/singleton:95.7" "source/common/tcp:94.6" "source/common/thread:0.0" # Death tests don't report LCOV "source/common/tracing:96.1" +"source/common/upstream:96.5" "source/common/watchdog:58.6" # Death tests don't report LCOV "source/exe:92.6" "source/extensions/common:96.0" @@ -29,7 +32,9 @@ declare -a KNOWN_LOW_COVERAGE=( "source/extensions/common/wasm:95.3" # flaky: be careful adjusting "source/extensions/common/wasm/ext:92.0" "source/extensions/filters/common:96.1" +"source/extensions/filters/common/expr:96.2" "source/extensions/filters/common/fault:94.5" +"source/extensions/filters/common/lua:96.5" "source/extensions/filters/common/rbac:88.1" "source/extensions/filters/http/cache:93.4" "source/extensions/filters/http/cache/simple_http_cache:96.0" @@ -37,23 +42,34 @@ declare -a KNOWN_LOW_COVERAGE=( "source/extensions/filters/http/ip_tagging:89.1" "source/extensions/filters/http/kill_request:95.3" # Death tests don't report LCOV "source/extensions/filters/http/wasm:95.8" +"source/extensions/filters/listener:96.2" "source/extensions/filters/listener/http_inspector:95.9" "source/extensions/filters/listener/original_dst:93.3" "source/extensions/filters/listener/tls_inspector:93.5" "source/extensions/filters/network/common:96.0" +"source/extensions/filters/network/common/redis:96.2" "source/extensions/filters/network/mongo_proxy:95.5" "source/extensions/filters/network/sni_cluster:88.9" "source/extensions/filters/network/sni_dynamic_forward_proxy:95.2" +"source/extensions/filters/network/thrift_proxy/router:96.4" "source/extensions/filters/network/wasm:95.7" +"source/extensions/filters/udp:96.4" +"source/extensions/filters/udp/dns_filter:96.2" "source/extensions/health_checkers:95.7" "source/extensions/health_checkers/redis:95.7" +"source/extensions/io_socket:96.2" +"source/extensions/io_socket/user_space:96.2" +"source/extensions/stat_sinks/common:96.4" +"source/extensions/stat_sinks/common/statsd:96.4" "source/extensions/stat_sinks/graphite_statsd:88.5" "source/extensions/stat_sinks/statsd:88.0" "source/extensions/tracers/opencensus:94.8" +"source/extensions/tracers/xray:96.2" "source/extensions/tracers/zipkin:96.1" "source/extensions/transport_sockets:95.4" "source/extensions/transport_sockets/tls:94.6" "source/extensions/transport_sockets/tls/cert_validator:96.0" +"source/extensions/transport_sockets/tls/ocsp:96.5" "source/extensions/transport_sockets/tls/private_key:77.8" "source/extensions/wasm_runtime/wamr:0.0" # Not enabled in coverage build "source/extensions/wasm_runtime/wasmtime:0.0" # Not enabled in coverage build @@ -70,7 +86,7 @@ COVERAGE_DIR="${SRCDIR}"/generated/coverage COVERAGE_DATA="${COVERAGE_DIR}/coverage.dat" FAILED=0 -DEFAULT_COVERAGE_THRESHOLD=96.2 +DEFAULT_COVERAGE_THRESHOLD=96.6 DIRECTORY_THRESHOLD=$DEFAULT_COVERAGE_THRESHOLD # Unfortunately we have a bunch of preexisting directory with low coverage. From f0c5938ebfe7336e36cd9808406d06fd757e29dc Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Mon, 27 Sep 2021 20:52:46 +0000 Subject: [PATCH 10/10] update compiler-rt Signed-off-by: Lizan Zhou --- bazel/repository_locations.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index 2c30d94d6a4b..fa67600f9813 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -906,12 +906,12 @@ REPOSITORY_LOCATIONS_SPEC = dict( project_name = "compiler-rt", project_desc = "LLVM compiler runtime library", project_url = "https://compiler-rt.llvm.org", - version = "11.0.1", - sha256 = "087be3f1116e861cd969c9b0b0903c27028b52eaf45157276f50a9c2500687fc", + version = "12.0.1", + sha256 = "b4c8d5f2a802332987c1c0a95b5afb35b1a66a96fe44add4e4ed4792c4cba0a4", # Only allow peeking at fuzzer related files for now. strip_prefix = "compiler-rt-{version}.src", urls = ["https://github.com/llvm/llvm-project/releases/download/llvmorg-{version}/compiler-rt-{version}.src.tar.xz"], - release_date = "2021-01-06", + release_date = "2021-07-09", use_category = ["test_only"], ), upb = dict(