From 050bbcb150458754b7a3dc6d70eb88601293bad3 Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Wed, 4 May 2022 00:09:06 +0000 Subject: [PATCH 1/8] build: update LLVM to 14.0.0 Signed-off-by: Keith Smiley Signed-off-by: Lizan Zhou --- .bazelrc | 2 +- .devcontainer/Dockerfile | 2 +- bazel/foreign_cc/BUILD | 2 +- bazel/foreign_cc/llvm.patch | 10 +++++----- bazel/repository_locations.bzl | 12 ++++++------ examples/wasm-cc/docker-compose-wasm.yaml | 4 ++-- test/common/http/header_map_impl_test.cc | 5 ++--- 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/.bazelrc b/.bazelrc index 793470faaa6ad..0075bc4b502eb 100644 --- a/.bazelrc +++ b/.bazelrc @@ -284,7 +284,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:a37d5f539f04b44e284953b4a075826ead117279 +build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:dafbde9825f965460288eb8aa1326187a9fee5e5 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 522acc461fcc8..6d5eaee59633e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM gcr.io/envoy-ci/envoy-build:a37d5f539f04b44e284953b4a075826ead117279 +FROM gcr.io/envoy-ci/envoy-build:dafbde9825f965460288eb8aa1326187a9fee5e5 ARG USERNAME=vscode ARG USER_UID=501 diff --git a/bazel/foreign_cc/BUILD b/bazel/foreign_cc/BUILD index d421ff908872f..88d698d73619c 100644 --- a/bazel/foreign_cc/BUILD +++ b/bazel/foreign_cc/BUILD @@ -150,7 +150,7 @@ configure_make( "ICU_DATA_FILTER_FILE": "$(execpath //bazel/foreign_cc:icu_data_filter.json)", }, lib_source = "@com_github_unicode_org_icu//:all", - linkopts = ["-lstdc++"], + linkopts = ["-l:libstdc++.a"], out_static_libs = [ "libicuuc.a", "libicudata.a", diff --git a/bazel/foreign_cc/llvm.patch b/bazel/foreign_cc/llvm.patch index cd02f28424017..8ca1ffd719657 100644 --- a/bazel/foreign_cc/llvm.patch +++ b/bazel/foreign_cc/llvm.patch @@ -1,7 +1,7 @@ # Workaround for Envoy's CMAKE_BUILD_TYPE=Bazel. --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -247,7 +247,7 @@ +@@ -291,7 +291,7 @@ endif() string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE) if (CMAKE_BUILD_TYPE AND @@ -14,10 +14,10 @@ # different linkers being used during configure and compilation phases. --- a/cmake/modules/HandleLLVMOptions.cmake +++ b/cmake/modules/HandleLLVMOptions.cmake -@@ -718,8 +718,6 @@ endif() - if (UNIX AND CMAKE_GENERATOR STREQUAL "Ninja") - include(CheckLinkerFlag) - check_linker_flag("-Wl,--color-diagnostics" LINKER_SUPPORTS_COLOR_DIAGNOSTICS) +@@ -931,8 +931,6 @@ endif() + if (UNIX AND CMAKE_GENERATOR MATCHES "Ninja") + include(LLVMCheckLinkerFlag) + llvm_check_linker_flag(CXX "-Wl,--color-diagnostics" LINKER_SUPPORTS_COLOR_DIAGNOSTICS) - append_if(LINKER_SUPPORTS_COLOR_DIAGNOSTICS "-Wl,--color-diagnostics" - CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS) endif() diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index d52f3bbd6edee..f433e94f4dd9c 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -64,11 +64,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 = "b37b15362fbea9de808e9a40f6978bfa7cc8abfc", - sha256 = "009651fc5e3f99da90990cd2e07550fa9db0e0d947cc846f39e23c8d20e8c433", + version = "cc97d26baf03e87982c6aaad6eccc6411543cf4c", + sha256 = "5fa11e15baef2f8a314a197b4ba3e5b5fe56d482781afe6f31855200db0968fb", strip_prefix = "envoy-build-tools-{version}", urls = ["https://github.com/envoyproxy/envoy-build-tools/archive/{version}.tar.gz"], - release_date = "2022-04-11", + release_date = "2022-04-26", use_category = ["build"], ), boringssl = dict( @@ -746,11 +746,11 @@ REPOSITORY_LOCATIONS_SPEC = dict( project_name = "LLVM", project_desc = "LLVM Compiler Infrastructure", project_url = "https://llvm.org", - version = "12.0.1", - sha256 = "7d9a8405f557cefc5a21bf5672af73903b64749d9bc3a50322239f56f34ffddf", + version = "14.0.0", + sha256 = "4df7ed50b8b7017b90dc22202f6b59e9006a29a9568238c6af28df9c049c7b9b", strip_prefix = "llvm-{version}.src", urls = ["https://github.com/llvm/llvm-project/releases/download/llvmorg-{version}/llvm-{version}.src.tar.xz"], - release_date = "2021-07-09", + release_date = "2022-03-23", use_category = ["dataplane_ext"], extensions = [ "envoy.wasm.runtime.wamr", diff --git a/examples/wasm-cc/docker-compose-wasm.yaml b/examples/wasm-cc/docker-compose-wasm.yaml index f857f51d784ae..d2dd46e0a74d3 100644 --- a/examples/wasm-cc/docker-compose-wasm.yaml +++ b/examples/wasm-cc/docker-compose-wasm.yaml @@ -2,7 +2,7 @@ version: "3.8" services: wasm_compile_update: - image: envoyproxy/envoy-build-ubuntu:a37d5f539f04b44e284953b4a075826ead117279 + image: envoyproxy/envoy-build-ubuntu:dafbde9825f965460288eb8aa1326187a9fee5e5 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:a37d5f539f04b44e284953b4a075826ead117279 + image: envoyproxy/envoy-build-ubuntu:dafbde9825f965460288eb8aa1326187a9fee5e5 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 diff --git a/test/common/http/header_map_impl_test.cc b/test/common/http/header_map_impl_test.cc index 8f1a45de4dbe2..2db8a05a4227e 100644 --- a/test/common/http/header_map_impl_test.cc +++ b/test/common/http/header_map_impl_test.cc @@ -424,9 +424,8 @@ 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 ece8971a1eac85caef8a0cd4a7ca3efbd6a69b7c Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Wed, 4 May 2022 07:26:22 +0000 Subject: [PATCH 2/8] fix clang setup Signed-off-by: Lizan Zhou --- bazel/foreign_cc/BUILD | 2 +- bazel/setup_clang.sh | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bazel/foreign_cc/BUILD b/bazel/foreign_cc/BUILD index 88d698d73619c..d421ff908872f 100644 --- a/bazel/foreign_cc/BUILD +++ b/bazel/foreign_cc/BUILD @@ -150,7 +150,7 @@ configure_make( "ICU_DATA_FILTER_FILE": "$(execpath //bazel/foreign_cc:icu_data_filter.json)", }, lib_source = "@com_github_unicode_org_icu//:all", - linkopts = ["-l:libstdc++.a"], + linkopts = ["-lstdc++"], out_static_libs = [ "libicuuc.a", "libicudata.a", diff --git a/bazel/setup_clang.sh b/bazel/setup_clang.sh index d0e58478dc0ab..5da22d563140a 100755 --- a/bazel/setup_clang.sh +++ b/bazel/setup_clang.sh @@ -12,12 +12,14 @@ fi PATH="$("${LLVM_PREFIX}"/bin/llvm-config --bindir):${PATH}" export PATH -RT_LIBRARY_PATH="$(dirname "$(find "$(llvm-config --libdir)" -name libclang_rt.ubsan_standalone_cxx-x86_64.a | head -1)")" +RT_LIBRARY_PATH="$(llvm-config --libdir)/clang/$(llvm-config --version)/lib/$(llvm-config --host-target)" +LD_LIBRARY_PATH="$(llvm-config --libdir)/$(llvm-config --host-target)" echo "# Generated file, do not edit. If you want to disable clang, just delete this file. build:clang --action_env='PATH=${PATH}' build:clang --action_env=CC=clang build:clang --action_env=CXX=clang++ +build:clang --action_env=LD_LIBRARY_PATH=${LD_LIBRARY_PATH} build:clang --action_env='LLVM_CONFIG=${LLVM_PREFIX}/bin/llvm-config' build:clang --repo_env='LLVM_CONFIG=${LLVM_PREFIX}/bin/llvm-config' build:clang --linkopt='-L$(llvm-config --libdir)' @@ -27,6 +29,6 @@ build:clang-asan --action_env=ENVOY_UBSAN_VPTR=1 build:clang-asan --copt=-fsanitize=vptr,function build:clang-asan --linkopt=-fsanitize=vptr,function build:clang-asan --linkopt='-L${RT_LIBRARY_PATH}' -build:clang-asan --linkopt=-l:libclang_rt.ubsan_standalone-x86_64.a -build:clang-asan --linkopt=-l:libclang_rt.ubsan_standalone_cxx-x86_64.a -" > "${BAZELRC_FILE}" +build:clang-asan --linkopt=-l:libclang_rt.ubsan_standalone.a +build:clang-asan --linkopt=-l:libclang_rt.ubsan_standalone_cxx.a +" >"${BAZELRC_FILE}" From 76a923eb0981b4c27e2475782dd0f51094c54b6c Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Wed, 4 May 2022 20:36:26 +0000 Subject: [PATCH 3/8] image fix Signed-off-by: Lizan Zhou --- .bazelrc | 2 +- .bazelversion | 2 +- .devcontainer/Dockerfile | 2 +- bazel/repository_locations.bzl | 4 ++-- bazel/setup_clang.sh | 2 -- contrib/hyperscan/matching/input_matchers/source/BUILD | 3 +++ examples/wasm-cc/docker-compose-wasm.yaml | 4 ++-- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.bazelrc b/.bazelrc index 0075bc4b502eb..1ee802a4d9581 100644 --- a/.bazelrc +++ b/.bazelrc @@ -284,7 +284,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:dafbde9825f965460288eb8aa1326187a9fee5e5 +build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:ac5c9b6e73711ca8686de21cba7bc75c87de0ec8 build:docker-sandbox --spawn_strategy=docker build:docker-sandbox --strategy=Javac=docker build:docker-sandbox --strategy=Closure=docker diff --git a/.bazelversion b/.bazelversion index 864f3a11f29e0..6cc5a64544a18 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -6.0.0-pre.20220414.2 +6.0.0-pre.20220421.3 diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 6d5eaee59633e..a2844c3a003eb 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM gcr.io/envoy-ci/envoy-build:dafbde9825f965460288eb8aa1326187a9fee5e5 +FROM gcr.io/envoy-ci/envoy-build:ac5c9b6e73711ca8686de21cba7bc75c87de0ec8 ARG USERNAME=vscode ARG USER_UID=501 diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index f433e94f4dd9c..f4cfa41540bcf 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -64,8 +64,8 @@ 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 = "cc97d26baf03e87982c6aaad6eccc6411543cf4c", - sha256 = "5fa11e15baef2f8a314a197b4ba3e5b5fe56d482781afe6f31855200db0968fb", + version = "ec936648947bf12748652ad957f4d23c786bdb95", + sha256 = "58393ec59cc3baf2d73411da79f0c3872cc199e075bebfd46b6eee83d41f2139", strip_prefix = "envoy-build-tools-{version}", urls = ["https://github.com/envoyproxy/envoy-build-tools/archive/{version}.tar.gz"], release_date = "2022-04-26", diff --git a/bazel/setup_clang.sh b/bazel/setup_clang.sh index 5da22d563140a..45c7f5ed1bc0d 100755 --- a/bazel/setup_clang.sh +++ b/bazel/setup_clang.sh @@ -13,13 +13,11 @@ PATH="$("${LLVM_PREFIX}"/bin/llvm-config --bindir):${PATH}" export PATH RT_LIBRARY_PATH="$(llvm-config --libdir)/clang/$(llvm-config --version)/lib/$(llvm-config --host-target)" -LD_LIBRARY_PATH="$(llvm-config --libdir)/$(llvm-config --host-target)" echo "# Generated file, do not edit. If you want to disable clang, just delete this file. build:clang --action_env='PATH=${PATH}' build:clang --action_env=CC=clang build:clang --action_env=CXX=clang++ -build:clang --action_env=LD_LIBRARY_PATH=${LD_LIBRARY_PATH} build:clang --action_env='LLVM_CONFIG=${LLVM_PREFIX}/bin/llvm-config' build:clang --repo_env='LLVM_CONFIG=${LLVM_PREFIX}/bin/llvm-config' build:clang --linkopt='-L$(llvm-config --libdir)' diff --git a/contrib/hyperscan/matching/input_matchers/source/BUILD b/contrib/hyperscan/matching/input_matchers/source/BUILD index 0fd58e9a7d5fc..435ac680b4b19 100644 --- a/contrib/hyperscan/matching/input_matchers/source/BUILD +++ b/contrib/hyperscan/matching/input_matchers/source/BUILD @@ -27,6 +27,9 @@ envoy_cmake( "CMAKE_INSTALL_LIBDIR": "lib", "RAGEL": "$EXT_BUILD_DEPS/ragel/bin/ragel", }, + env = { + "CXXFLAGS": "-Wno-error=unused-but-set-variable -Wno-error=bitwise-instead-of-logical", + }, lib_source = "@io_hyperscan//:all", out_static_libs = ["libhs.a"], tags = ["skip_on_windows"], diff --git a/examples/wasm-cc/docker-compose-wasm.yaml b/examples/wasm-cc/docker-compose-wasm.yaml index d2dd46e0a74d3..9d156d82db759 100644 --- a/examples/wasm-cc/docker-compose-wasm.yaml +++ b/examples/wasm-cc/docker-compose-wasm.yaml @@ -2,7 +2,7 @@ version: "3.8" services: wasm_compile_update: - image: envoyproxy/envoy-build-ubuntu:dafbde9825f965460288eb8aa1326187a9fee5e5 + image: envoyproxy/envoy-build-ubuntu:ac5c9b6e73711ca8686de21cba7bc75c87de0ec8 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:dafbde9825f965460288eb8aa1326187a9fee5e5 + image: envoyproxy/envoy-build-ubuntu:ac5c9b6e73711ca8686de21cba7bc75c87de0ec8 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 91b48917928c2b150589b0b5620b488d72bf3f87 Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Wed, 4 May 2022 20:38:10 +0000 Subject: [PATCH 4/8] deps 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 f4cfa41540bcf..fd27db1164b32 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -68,7 +68,7 @@ REPOSITORY_LOCATIONS_SPEC = dict( sha256 = "58393ec59cc3baf2d73411da79f0c3872cc199e075bebfd46b6eee83d41f2139", strip_prefix = "envoy-build-tools-{version}", urls = ["https://github.com/envoyproxy/envoy-build-tools/archive/{version}.tar.gz"], - release_date = "2022-04-26", + release_date = "2022-05-04", use_category = ["build"], ), boringssl = dict( From 850066118739c13f7f1ae94afb9d86d6ffb3091b Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Thu, 5 May 2022 01:19:57 +0000 Subject: [PATCH 5/8] fix Signed-off-by: Lizan Zhou --- .bazelrc | 6 +++--- bazel/README.md | 2 +- bazel/foreign_cc/llvm.patch | 10 +++++----- bazel/repository_locations.bzl | 12 ++++++------ test/run_envoy_bazel_coverage.sh | 2 +- tools/code_format/check_format.py | 8 ++++---- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.bazelrc b/.bazelrc index 1ee802a4d9581..f69fea27bb355 100644 --- a/.bazelrc +++ b/.bazelrc @@ -208,9 +208,9 @@ 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/12.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-asan --linkopt='-L/opt/llvm/lib/clang/14.0.0/lib/x86_64-unknown-linux-gnu' +build:rbe-toolchain-asan --linkopt=-l:libclang_rt.ubsan_standalone.a +build:rbe-toolchain-asan --linkopt=-l:libclang_rt.ubsan_standalone_cxx.a build:rbe-toolchain-msan --linkopt=-L/opt/libcxx_msan/lib build:rbe-toolchain-msan --linkopt=-Wl,-rpath,/opt/libcxx_msan/lib diff --git a/bazel/README.md b/bazel/README.md index b7f2ac695d7c9..f88e290d20afc 100644 --- a/bazel/README.md +++ b/bazel/README.md @@ -921,7 +921,7 @@ Note that if you run the `check_spelling.py` script you will need to have `aspel Edit the paths shown here to reflect the installation locations on your system: ```shell -export CLANG_FORMAT="$HOME/ext/clang+llvm-12.0.1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-format" +export CLANG_FORMAT="$HOME/ext/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format" export BUILDIFIER_BIN="/usr/bin/buildifier" ``` diff --git a/bazel/foreign_cc/llvm.patch b/bazel/foreign_cc/llvm.patch index 8ca1ffd719657..cd02f28424017 100644 --- a/bazel/foreign_cc/llvm.patch +++ b/bazel/foreign_cc/llvm.patch @@ -1,7 +1,7 @@ # Workaround for Envoy's CMAKE_BUILD_TYPE=Bazel. --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -291,7 +291,7 @@ endif() +@@ -247,7 +247,7 @@ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE) if (CMAKE_BUILD_TYPE AND @@ -14,10 +14,10 @@ # different linkers being used during configure and compilation phases. --- a/cmake/modules/HandleLLVMOptions.cmake +++ b/cmake/modules/HandleLLVMOptions.cmake -@@ -931,8 +931,6 @@ endif() - if (UNIX AND CMAKE_GENERATOR MATCHES "Ninja") - include(LLVMCheckLinkerFlag) - llvm_check_linker_flag(CXX "-Wl,--color-diagnostics" LINKER_SUPPORTS_COLOR_DIAGNOSTICS) +@@ -718,8 +718,6 @@ endif() + if (UNIX AND CMAKE_GENERATOR STREQUAL "Ninja") + include(CheckLinkerFlag) + check_linker_flag("-Wl,--color-diagnostics" LINKER_SUPPORTS_COLOR_DIAGNOSTICS) - append_if(LINKER_SUPPORTS_COLOR_DIAGNOSTICS "-Wl,--color-diagnostics" - CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS) endif() diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index fd27db1164b32..fd99827c776b2 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -746,11 +746,11 @@ REPOSITORY_LOCATIONS_SPEC = dict( project_name = "LLVM", project_desc = "LLVM Compiler Infrastructure", project_url = "https://llvm.org", - version = "14.0.0", - sha256 = "4df7ed50b8b7017b90dc22202f6b59e9006a29a9568238c6af28df9c049c7b9b", + version = "12.0.1", + sha256 = "7d9a8405f557cefc5a21bf5672af73903b64749d9bc3a50322239f56f34ffddf", strip_prefix = "llvm-{version}.src", urls = ["https://github.com/llvm/llvm-project/releases/download/llvmorg-{version}/llvm-{version}.src.tar.xz"], - release_date = "2022-03-23", + release_date = "2021-07-09", use_category = ["dataplane_ext"], extensions = [ "envoy.wasm.runtime.wamr", @@ -980,12 +980,12 @@ REPOSITORY_LOCATIONS_SPEC = dict( project_name = "compiler-rt", project_desc = "LLVM compiler runtime library", project_url = "https://compiler-rt.llvm.org", - version = "12.0.1", - sha256 = "b4c8d5f2a802332987c1c0a95b5afb35b1a66a96fe44add4e4ed4792c4cba0a4", + version = "14.0.0", + sha256 = "27ab7fcfb21d108093c0be766a9ed5fe18c04e4f74f936069711a312c8ae0377", # 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-07-09", + release_date = "2022-03-23", use_category = ["test_only"], cpe = "cpe:2.3:a:llvm:compiler-rt:*", ), diff --git a/test/run_envoy_bazel_coverage.sh b/test/run_envoy_bazel_coverage.sh index 8d1678cb3cc87..2fd7cf7539c36 100755 --- a/test/run_envoy_bazel_coverage.sh +++ b/test/run_envoy_bazel_coverage.sh @@ -2,7 +2,7 @@ set -e -LLVM_VERSION="12.0.1" +LLVM_VERSION="14.0.0" 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/') diff --git a/tools/code_format/check_format.py b/tools/code_format/check_format.py index 697e2f4747baf..da3cac922bdf0 100755 --- a/tools/code_format/check_format.py +++ b/tools/code_format/check_format.py @@ -146,7 +146,7 @@ "./api/bazel/envoy_http_archive.bzl", ) -CLANG_FORMAT_PATH = os.getenv("CLANG_FORMAT", "clang-format-12") +CLANG_FORMAT_PATH = os.getenv("CLANG_FORMAT", "clang-format-14") BUILDIFIER_PATH = paths.get_buildifier() BUILDOZER_PATH = paths.get_buildozer() ENVOY_BUILD_FIXER_PATH = os.path.join( @@ -308,9 +308,9 @@ def check_tools(self): "installed, but the binary name is different or it's not available in " "PATH, please use CLANG_FORMAT environment variable to specify the path. " "Examples:\n" - " export CLANG_FORMAT=clang-format-12.0.1\n" - " export CLANG_FORMAT=/opt/bin/clang-format-12\n" - " export CLANG_FORMAT=/usr/local/opt/llvm@12/bin/clang-format".format( + " export CLANG_FORMAT=clang-format-14.0.0\n" + " export CLANG_FORMAT=/opt/bin/clang-format-14\n" + " export CLANG_FORMAT=/usr/local/opt/llvm@14/bin/clang-format".format( CLANG_FORMAT_PATH)) def check_bazel_tool(name, path, var): From 8e7ac2a706414de038caba99ef6c5c4f0ac8631a Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Thu, 5 May 2022 05:59:00 +0000 Subject: [PATCH 6/8] fix Signed-off-by: Lizan Zhou --- bazel/foreign_cc/BUILD | 2 +- examples/wasm-cc/docker-compose-wasm.yaml | 4 ++-- test/per_file_coverage.sh | 12 ++++++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/bazel/foreign_cc/BUILD b/bazel/foreign_cc/BUILD index d421ff908872f..042ad78817227 100644 --- a/bazel/foreign_cc/BUILD +++ b/bazel/foreign_cc/BUILD @@ -493,7 +493,7 @@ envoy_cmake( # Workaround for the -DDEBUG flag added in fastbuild on macOS, # which conflicts with DEBUG macro used in LLVM. "CFLAGS": "-UDEBUG", - "CXXFLAGS": "-UDEBUG", + "CXXFLAGS": "-UDEBUG -Wno-error=unused-but-set-variable", "ASMFLAGS": "-UDEBUG", }, lib_source = "@com_github_wavm_wavm//:all", diff --git a/examples/wasm-cc/docker-compose-wasm.yaml b/examples/wasm-cc/docker-compose-wasm.yaml index 9d156d82db759..949c40ba7938b 100644 --- a/examples/wasm-cc/docker-compose-wasm.yaml +++ b/examples/wasm-cc/docker-compose-wasm.yaml @@ -4,7 +4,7 @@ services: wasm_compile_update: image: envoyproxy/envoy-build-ubuntu:ac5c9b6e73711ca8686de21cba7bc75c87de0ec8 command: | - bash -c "bazel build //examples/wasm-cc:envoy_filter_http_wasm_updated_example.wasm && cp -a bazel-bin/examples/wasm-cc/* /build" + bash -c "git config --global --add safe.directory /source && bazel build //examples/wasm-cc:envoy_filter_http_wasm_updated_example.wasm && cp -a bazel-bin/examples/wasm-cc/* /build" working_dir: /source volumes: - ../..:/source @@ -13,7 +13,7 @@ services: wasm_compile: image: envoyproxy/envoy-build-ubuntu:ac5c9b6e73711ca8686de21cba7bc75c87de0ec8 command: | - bash -c "bazel build //examples/wasm-cc:envoy_filter_http_wasm_example.wasm && cp -a bazel-bin/examples/wasm-cc/* /build" + bash -c "git config --global --add safe.directory /source && bazel build //examples/wasm-cc:envoy_filter_http_wasm_example.wasm && cp -a bazel-bin/examples/wasm-cc/* /build" working_dir: /source volumes: - ../..:/source diff --git a/test/per_file_coverage.sh b/test/per_file_coverage.sh index 964f1d2ff4624..0aa174b64e66c 100755 --- a/test/per_file_coverage.sh +++ b/test/per_file_coverage.sh @@ -4,8 +4,8 @@ # for existing directories with low coverage. declare -a KNOWN_LOW_COVERAGE=( "source/common:96.0" -"source/common/api:82.5" -"source/common/api/posix:81.7" +"source/common/api:82.2" +"source/common/api/posix:81.3" "source/common/common:96.2" "source/common/common/posix:92.7" "source/common/config:96.5" @@ -22,9 +22,11 @@ declare -a KNOWN_LOW_COVERAGE=( "source/common/protobuf:94.8" "source/common/quic:91.8" "source/common/router:96.3" +"source/common/runtime:96.4" "source/common/secret:94.9" "source/common/signal:86.9" # Death tests don't report LCOV "source/common/singleton:95.7" +"source/common/stats:96.5" "source/common/tcp:90.6" "source/common/thread:0.0" # Death tests don't report LCOV "source/common/tracing:96.1" @@ -66,13 +68,15 @@ declare -a KNOWN_LOW_COVERAGE=( "source/extensions/health_checkers/redis:95.7" "source/extensions/io_socket:96.2" "source/extensions/io_socket/user_space:96.2" +"source/extensions/rate_limit_descriptors:95.5" +"source/extensions/rate_limit_descriptors/expr:95.5" "source/extensions/stat_sinks/common:96.4" "source/extensions/stat_sinks/common/statsd:96.4" "source/extensions/stat_sinks/graphite_statsd:75.0" "source/extensions/stat_sinks/statsd:76.9" -"source/extensions/tracers/opencensus:94.8" +"source/extensions/tracers/opencensus:93.2" "source/extensions/tracers/xray:96.2" -"source/extensions/tracers/zipkin:95.9" +"source/extensions/tracers/zipkin:95.8" "source/extensions/transport_sockets:95.2" "source/extensions/transport_sockets/tls:94.2" "source/extensions/transport_sockets/tls/cert_validator:94.9" From 460f4876c240cbbdf9e94a530b080a84d0415e88 Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Thu, 5 May 2022 01:15:08 -0700 Subject: [PATCH 7/8] docs Signed-off-by: Lizan Zhou --- bazel/README.md | 4 ++-- changelogs/1.23.0.yaml | 3 +++ ci/README.md | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bazel/README.md b/bazel/README.md index f88e290d20afc..f405bf308c3e0 100644 --- a/bazel/README.md +++ b/bazel/README.md @@ -349,8 +349,8 @@ for more details. ## Supported compiler versions -We now require Clang >= 5.0 due to known issues with std::string thread safety and C++14 support. GCC >= 7 is also -known to work. Currently the CI is running with Clang 10. +We now require Clang >= 9 due to C++17 support and tcmalloc requirement. GCC >= 9 is also known to work. +Currently the CI is running with Clang 14. ## Clang STL debug symbols diff --git a/changelogs/1.23.0.yaml b/changelogs/1.23.0.yaml index 5760af0887e95..2028afdc092b1 100644 --- a/changelogs/1.23.0.yaml +++ b/changelogs/1.23.0.yaml @@ -78,5 +78,8 @@ new_features: - area: build change: | enabled building arm64 envoy-distroless and envoy-tools :ref:`docker images `. +- area: build + change: | + official released binary is now built with Clang 14.0.0. deprecated: diff --git a/ci/README.md b/ci/README.md index df83cff3c6320..724be286d81d0 100644 --- a/ci/README.md +++ b/ci/README.md @@ -32,8 +32,8 @@ running tests that reflects the latest built Windows 2019 Envoy image. Currently there are three build images for Linux and one for Windows: * `envoyproxy/envoy-build` — alias to `envoyproxy/envoy-build-ubuntu`. -* `envoyproxy/envoy-build-ubuntu` — based on Ubuntu 18.04 (Bionic) with GCC 9 and Clang 10 compiler. -* `envoyproxy/envoy-build-centos` — based on CentOS 7 with GCC 9 and Clang 10 compiler, this image is experimental and not well tested. +* `envoyproxy/envoy-build-ubuntu` — based on Ubuntu 18.04 (Bionic) with GCC 9 and Clang 14 compiler. +* `envoyproxy/envoy-build-centos` — based on CentOS 7 with GCC 9 and Clang 14 compiler, this image is experimental and not well tested. * `envoyproxy/envoy-build-windows2019` — based on Windows ltsc2019 with VS 2019 Build Tools, as well as LLVM. The source for these images is located in the [envoyproxy/envoy-build-tools](https://github.com/envoyproxy/envoy-build-tools) From 97272821f4025a11a6954354008c0d828fc93700 Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Fri, 6 May 2022 00:17:35 -0700 Subject: [PATCH 8/8] bump Signed-off-by: Lizan Zhou --- .bazelrc | 2 +- .devcontainer/Dockerfile | 2 +- bazel/repository_locations.bzl | 6 +++--- examples/wasm-cc/docker-compose-wasm.yaml | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.bazelrc b/.bazelrc index 62bf69d8e014a..43223eb0b2f58 100644 --- a/.bazelrc +++ b/.bazelrc @@ -284,7 +284,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:ac5c9b6e73711ca8686de21cba7bc75c87de0ec8 +build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:6fff5a6c67db843ddabde4533e24cab6122c7011 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 a2844c3a003eb..84a09a23796d1 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM gcr.io/envoy-ci/envoy-build:ac5c9b6e73711ca8686de21cba7bc75c87de0ec8 +FROM gcr.io/envoy-ci/envoy-build:6fff5a6c67db843ddabde4533e24cab6122c7011 ARG USERNAME=vscode ARG USER_UID=501 diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index a70a520370065..454c54b0ef2ad 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -64,11 +64,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 = "ec936648947bf12748652ad957f4d23c786bdb95", - sha256 = "58393ec59cc3baf2d73411da79f0c3872cc199e075bebfd46b6eee83d41f2139", + version = "afae694ee4b0036ee645db50ee2d972ee99c0ae5", + sha256 = "1c7502d489b9b36076fd338e2032e17a0c9cc9809048683a2e32ad8345445723", strip_prefix = "envoy-build-tools-{version}", urls = ["https://github.com/envoyproxy/envoy-build-tools/archive/{version}.tar.gz"], - release_date = "2022-05-04", + release_date = "2022-05-05", use_category = ["build"], ), boringssl = dict( diff --git a/examples/wasm-cc/docker-compose-wasm.yaml b/examples/wasm-cc/docker-compose-wasm.yaml index 949c40ba7938b..dd400287f0d87 100644 --- a/examples/wasm-cc/docker-compose-wasm.yaml +++ b/examples/wasm-cc/docker-compose-wasm.yaml @@ -2,18 +2,18 @@ version: "3.8" services: wasm_compile_update: - image: envoyproxy/envoy-build-ubuntu:ac5c9b6e73711ca8686de21cba7bc75c87de0ec8 + image: envoyproxy/envoy-build-ubuntu:6fff5a6c67db843ddabde4533e24cab6122c7011 command: | - bash -c "git config --global --add safe.directory /source && bazel build //examples/wasm-cc:envoy_filter_http_wasm_updated_example.wasm && cp -a bazel-bin/examples/wasm-cc/* /build" + 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 volumes: - ../..:/source - ./lib:/build wasm_compile: - image: envoyproxy/envoy-build-ubuntu:ac5c9b6e73711ca8686de21cba7bc75c87de0ec8 + image: envoyproxy/envoy-build-ubuntu:6fff5a6c67db843ddabde4533e24cab6122c7011 command: | - bash -c "git config --global --add safe.directory /source && bazel build //examples/wasm-cc:envoy_filter_http_wasm_example.wasm && cp -a bazel-bin/examples/wasm-cc/* /build" + bash -c "bazel build //examples/wasm-cc:envoy_filter_http_wasm_example.wasm && cp -a bazel-bin/examples/wasm-cc/* /build" working_dir: /source volumes: - ../..:/source