diff --git a/.bazelrc b/.bazelrc index 209f1180ff024..319cf0897ccd6 100644 --- a/.bazelrc +++ b/.bazelrc @@ -174,7 +174,7 @@ 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/10.0.0/lib/linux +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 @@ -246,7 +246,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:c8fa4235714003ba0896287ee2f91cae06e0e407 +build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:edbec0b7a298045bc4f3adbb2c04a3a2d257ccf5 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 bd72c0ebde6be..8c89986fd289e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM gcr.io/envoy-ci/envoy-build:c8fa4235714003ba0896287ee2f91cae06e0e407 +FROM gcr.io/envoy-ci/envoy-build:edbec0b7a298045bc4f3adbb2c04a3a2d257ccf5 ARG USERNAME=vscode ARG USER_UID=501 diff --git a/.github/workflows/codeql-daily.yml b/.github/workflows/codeql-daily.yml index d947fa50a5a65..52a6a30ea1ea6 100644 --- a/.github/workflows/codeql-daily.yml +++ b/.github/workflows/codeql-daily.yml @@ -35,15 +35,15 @@ jobs: shell: bash run: | sudo apt-get update && sudo apt-get install libtool cmake automake autoconf make ninja-build curl unzip virtualenv openjdk-11-jdk build-essential libc++1 - mkdir -p bin/clang10 - cd bin/clang10 - wget https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz - tar -xf clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz --strip-components 1 - export PATH=bin/clang10/bin:$PATH + mkdir -p bin/clang11 + cd bin/clang11 + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.1/clang+llvm-11.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz + tar -xf clang+llvm-11.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz --strip-components 1 + export PATH=bin/clang11/bin:$PATH - name: Build run: | - bazel/setup_clang.sh bin/clang10 + bazel/setup_clang.sh bin/clang11 bazelisk shutdown bazelisk build -c fastbuild --spawn_strategy=local --discard_analysis_cache --nouse_action_cache --config clang --config libc++ //source/common/http/... diff --git a/.github/workflows/codeql-push.yml b/.github/workflows/codeql-push.yml index fbe091a90ec00..e204ce770c7e8 100644 --- a/.github/workflows/codeql-push.yml +++ b/.github/workflows/codeql-push.yml @@ -43,15 +43,16 @@ jobs: shell: bash run: | sudo apt-get update && sudo apt-get install libtool cmake automake autoconf make ninja-build curl unzip virtualenv openjdk-11-jdk build-essential libc++1 - mkdir -p bin/clang10 - cd bin/clang10 - wget https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz - tar -xf clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz --strip-components 1 - export PATH=bin/clang10/bin:$PATH + mkdir -p bin/clang11 + cd bin/clang11 + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.1/clang+llvm-11.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz + tar -xf clang+llvm-11.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz --strip-components 1 + export PATH=bin/clang11/bin:$PATH + - name: Build run: | - bazel/setup_clang.sh bin/clang10 + bazel/setup_clang.sh bin/clang11 bazelisk shutdown bazelisk build -c fastbuild --spawn_strategy=local --discard_analysis_cache --nouse_action_cache --config clang --config libc++ $BUILD_TARGETS echo -e "Built targets...\n$BUILD_TARGETS" diff --git a/bazel/README.md b/bazel/README.md index a534783e72af4..c67457c818a76 100644 --- a/bazel/README.md +++ b/bazel/README.md @@ -563,7 +563,7 @@ bazel test -c dbg --config=docker-tsan //test/... Alternatively, you can build a local copy of TSAN-instrumented libc++. Follow the [quick start](#quick-start-bazel-build-for-developers) instruction to setup Clang+LLVM environment. Download LLVM sources from the [LLVM official site](https://github.com/llvm/llvm-project) ``` -curl -sSfL "https://github.com/llvm/llvm-project/archive/llvmorg-10.0.0.tar.gz" | tar zx +curl -sSfL "https://github.com/llvm/llvm-project/archive/llvmorg-11.0.1.tar.gz" | tar zx ``` @@ -574,7 +574,7 @@ mkdir tsan pushd tsan cmake -GNinja -DLLVM_ENABLE_PROJECTS="libcxxabi;libcxx" -DLLVM_USE_LINKER=lld -DLLVM_USE_SANITIZER=Thread -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_INSTALL_PREFIX="/opt/libcxx_tsan" "../llvm-project-llvmorg-10.0.0/llvm" + -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_INSTALL_PREFIX="/opt/libcxx_tsan" "../llvm-project-llvmorg-11.0.1/llvm" ninja install-cxx install-cxxabi rm -rf /opt/libcxx_tsan/include @@ -862,7 +862,7 @@ also have 'buildifier' installed from the bazel distribution. Edit the paths shown here to reflect the installation locations on your system: ```shell -export CLANG_FORMAT="$HOME/ext/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format" +export CLANG_FORMAT="$HOME/ext/clang+llvm-11.0.1-x86_64-linux-gnu-ubuntu-20.04/bin/clang-format" export BUILDIFIER_BIN="/usr/bin/buildifier" ``` diff --git a/bazel/foreign_cc/BUILD b/bazel/foreign_cc/BUILD index aa73e3bbbcac7..30afd9c79a907 100644 --- a/bazel/foreign_cc/BUILD +++ b/bazel/foreign_cc/BUILD @@ -79,6 +79,7 @@ configure_make( envoy_cmake_external( name = "ares", cache_entries = { + "CARES_BUILD_TOOLS": "no", "CARES_SHARED": "no", "CARES_STATIC": "on", "CMAKE_CXX_COMPILER_FORCED": "on", diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index 826050aae8662..939cb290f1921 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 = "f2a7f9ba09660beacfebcd37fc977480ec9a8f50", - sha256 = "ca9975f6d5370843167b9646028ca7a0b546f8821f217c9d9d2e033a94a35f31", + version = "d36336060aa1ade024654dec009adc4a19e3efd6", + sha256 = "7b379e69eafb883cebb52a5ed11b1a12710dd77a33de79c0bc207f6458a5f712", strip_prefix = "envoy-build-tools-{version}", urls = ["https://github.com/envoyproxy/envoy-build-tools/archive/{version}.tar.gz"], - release_date = "2021-01-04", + release_date = "2021-01-28", use_category = ["build"], ), boringssl = dict( @@ -839,12 +839,12 @@ REPOSITORY_LOCATIONS_SPEC = dict( project_name = "compiler-rt", project_desc = "LLVM compiler runtime library", project_url = "https://compiler-rt.llvm.org", - version = "10.0.0", - sha256 = "6a7da64d3a0a7320577b68b9ca4933bdcab676e898b759850e827333c3282c75", + version = "11.0.1", + sha256 = "087be3f1116e861cd969c9b0b0903c27028b52eaf45157276f50a9c2500687fc", # 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 = "2020-03-23", + release_date = "2020-12-18", use_category = ["test_only"], ), upb = dict( diff --git a/examples/wasm-cc/docker-compose-wasm.yaml b/examples/wasm-cc/docker-compose-wasm.yaml index 5e30327cb98ed..12f63ed14e581 100644 --- a/examples/wasm-cc/docker-compose-wasm.yaml +++ b/examples/wasm-cc/docker-compose-wasm.yaml @@ -1,9 +1,8 @@ version: "3.7" services: - wasm_compile_update: - image: envoyproxy/envoy-build-ubuntu:c8fa4235714003ba0896287ee2f91cae06e0e407 + image: envoyproxy/envoy-build-ubuntu:edbec0b7a298045bc4f3adbb2c04a3a2d257ccf5 command: | bash -c "bazel build //examples/wasm-cc:envoy_filter_http_wasm_updated_example.wasm \ && cp -a bazel-bin/examples/wasm-cc/* /build" @@ -13,7 +12,7 @@ services: - ./lib:/build wasm_compile: - image: envoyproxy/envoy-build-ubuntu:c8fa4235714003ba0896287ee2f91cae06e0e407 + image: envoyproxy/envoy-build-ubuntu:edbec0b7a298045bc4f3adbb2c04a3a2d257ccf5 command: | bash -c "bazel build //examples/wasm-cc:envoy_filter_http_wasm_example.wasm \ && cp -a bazel-bin/examples/wasm-cc/* /build" diff --git a/source/common/common/interval_value.h b/source/common/common/interval_value.h index 3a058eaae4b54..e001a8a13a324 100644 --- a/source/common/common/interval_value.h +++ b/source/common/common/interval_value.h @@ -25,11 +25,10 @@ template class ClosedIntervalValue { // Returns a value that is as far from max as the original value is from min. // This guarantees that max().invert() == min() and min().invert() == max(). ClosedIntervalValue invert() const { - return ClosedIntervalValue(value_ == Interval::max_value - ? Interval::min_value - : value_ == Interval::min_value - ? Interval::max_value - : Interval::max_value - (value_ - Interval::min_value)); + return ClosedIntervalValue(value_ == Interval::max_value ? Interval::min_value + : value_ == Interval::min_value + ? Interval::max_value + : Interval::max_value - (value_ - Interval::min_value)); } // Comparisons are performed using the same operators on the underlying value diff --git a/source/common/local_reply/local_reply.cc b/source/common/local_reply/local_reply.cc index 42f8d32b0d383..753003f223b33 100644 --- a/source/common/local_reply/local_reply.cc +++ b/source/common/local_reply/local_reply.cc @@ -25,12 +25,11 @@ class BodyFormatter { BodyFormatter(const envoy::config::core::v3::SubstitutionFormatString& config, Api::Api& api) : formatter_(Formatter::SubstitutionFormatStringUtils::fromProtoConfig(config, api)), content_type_( - !config.content_type().empty() - ? config.content_type() - : config.format_case() == - envoy::config::core::v3::SubstitutionFormatString::FormatCase::kJsonFormat - ? Http::Headers::get().ContentTypeValues.Json - : Http::Headers::get().ContentTypeValues.Text) {} + !config.content_type().empty() ? config.content_type() + : config.format_case() == + envoy::config::core::v3::SubstitutionFormatString::FormatCase::kJsonFormat + ? Http::Headers::get().ContentTypeValues.Json + : Http::Headers::get().ContentTypeValues.Text) {} void format(const Http::RequestHeaderMap& request_headers, const Http::ResponseHeaderMap& response_headers, diff --git a/test/common/network/apple_dns_impl_test.cc b/test/common/network/apple_dns_impl_test.cc index 9d9fbb534d127..7cc40baf6f193 100644 --- a/test/common/network/apple_dns_impl_test.cc +++ b/test/common/network/apple_dns_impl_test.cc @@ -350,12 +350,12 @@ TEST_F(AppleDnsImplFakeApiTest, SynchronousErrorInGetAddrInfo) { // The Query's sd ref will be deallocated. EXPECT_CALL(dns_service_, dnsServiceRefDeallocate(_)); - EXPECT_EQ(nullptr, resolver_->resolve( - "foo.com", Network::DnsLookupFamily::Auto, - [](DnsResolver::ResolutionStatus, std::list &&) -> void { - // This callback should never be executed. - FAIL(); - })); + EXPECT_EQ(nullptr, + resolver_->resolve("foo.com", Network::DnsLookupFamily::Auto, + [](DnsResolver::ResolutionStatus, std::list&&) -> void { + // This callback should never be executed. + FAIL(); + })); } TEST_F(AppleDnsImplFakeApiTest, QuerySynchronousCompletion) { @@ -428,7 +428,7 @@ TEST_F(AppleDnsImplFakeApiTest, IncorrectInterfaceIndexReturned) { resolver_->resolve( hostname, Network::DnsLookupFamily::Auto, - [](DnsResolver::ResolutionStatus, std::list &&) -> void { FAIL(); }); + [](DnsResolver::ResolutionStatus, std::list&&) -> void { FAIL(); }); } TEST_F(AppleDnsImplFakeApiTest, QueryCompletedWithError) { @@ -785,7 +785,7 @@ TEST_F(AppleDnsImplFakeApiTest, ResultWithNullAddress) { auto query = resolver_->resolve( hostname, Network::DnsLookupFamily::Auto, - [](DnsResolver::ResolutionStatus, std::list &&) -> void { FAIL(); }); + [](DnsResolver::ResolutionStatus, std::list&&) -> void { FAIL(); }); ASSERT_NE(nullptr, query); EXPECT_DEATH(reply_callback(nullptr, kDNSServiceFlagsAdd, 0, kDNSServiceErr_NoError, diff --git a/test/run_envoy_bazel_coverage.sh b/test/run_envoy_bazel_coverage.sh index 6221cbd0d1b06..f2f44ea651fa8 100755 --- a/test/run_envoy_bazel_coverage.sh +++ b/test/run_envoy_bazel_coverage.sh @@ -2,8 +2,8 @@ set -e -LLVM_VERSION="10.0.0" -CLANG_VERSION=$(clang --version | grep version | sed -e 's/\ *clang version \(.*\)\ /\1/') +LLVM_VERSION="11.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/') diff --git a/test/test_common/environment.cc b/test/test_common/environment.cc index 029cdb9193e6a..cfeb632b9d8bc 100644 --- a/test/test_common/environment.cc +++ b/test/test_common/environment.cc @@ -383,9 +383,9 @@ std::string TestEnvironment::temporaryFileSubstitute(const std::string& path, out_json_string = substitute(out_json_string, version); auto name = Filesystem::fileSystemForTest().splitPathFromFilename(path).file_; - const std::string extension = absl::EndsWith(name, ".yaml") - ? ".yaml" - : absl::EndsWith(name, ".pb_text") ? ".pb_text" : ".json"; + const std::string extension = absl::EndsWith(name, ".yaml") ? ".yaml" + : absl::EndsWith(name, ".pb_text") ? ".pb_text" + : ".json"; const std::string out_json_path = TestEnvironment::temporaryPath(name) + ".with.ports" + extension; { diff --git a/tools/api_boost/api_boost.py b/tools/api_boost/api_boost.py index 5cd9846bcf218..7d15fdf19156b 100755 --- a/tools/api_boost/api_boost.py +++ b/tools/api_boost/api_boost.py @@ -143,7 +143,7 @@ def ApiBoostTree(target_paths, # a cleaner approach. llvm_include_path = os.path.join( sp.check_output([os.getenv('LLVM_CONFIG'), '--libdir']).decode().rstrip(), - 'clang/9.0.0/include') + 'clang/11.0.1/include') # Determine the files in the target dirs eligible for API boosting, based on # known files in the compilation database. diff --git a/tools/clang_tools/api_booster/main.cc b/tools/clang_tools/api_booster/main.cc index 976ddc969fcd8..1972a58d560c6 100644 --- a/tools/clang_tools/api_booster/main.cc +++ b/tools/clang_tools/api_booster/main.cc @@ -419,7 +419,7 @@ class ApiBooster : public clang::ast_matchers::MatchFinder::MatchCallback, } void insertReplacement(const clang::tooling::Replacement& replacement) { - llvm::Error error = replacements_[replacement.getFilePath()].add(replacement); + llvm::Error error = replacements_[std::string(replacement.getFilePath())].add(replacement); if (error) { std::cerr << " Replacement insertion error: " << llvm::toString(std::move(error)) << std::endl; @@ -447,15 +447,15 @@ class ApiBooster : public clang::ast_matchers::MatchFinder::MatchCallback, std::string getSourceText(clang::SourceLocation begin_loc, int size, const clang::SourceManager& source_manager) { - return clang::Lexer::getSourceText( + return std::string(clang::Lexer::getSourceText( {clang::SourceRange(begin_loc, begin_loc.getLocWithOffset(size)), false}, source_manager, - lexer_lopt_, 0); + lexer_lopt_, 0)); } std::string getSourceText(clang::SourceRange source_range, const clang::SourceManager& source_manager) { - return clang::Lexer::getSourceText(clang::CharSourceRange::getTokenRange(source_range), - source_manager, lexer_lopt_, 0); + return std::string(clang::Lexer::getSourceText( + clang::CharSourceRange::getTokenRange(source_range), source_manager, lexer_lopt_, 0)); } void addNamedspaceQualifiedTypeReplacement() {} diff --git a/tools/clang_tools/support/BUILD.prebuilt b/tools/clang_tools/support/BUILD.prebuilt index e77dcb0fe2685..5a86563741982 100644 --- a/tools/clang_tools/support/BUILD.prebuilt +++ b/tools/clang_tools/support/BUILD.prebuilt @@ -1,7 +1,7 @@ -# Clang 10.0 library pre-built Bazel. +# Clang 11.0 library pre-built Bazel. # # This file was mostly manually assembled (with some hacky Python scripts) from -# clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz and corresponding +# clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz and corresponding # https://github.com/llvm/llvm-project.git source. It needs Clang 10.0 to work. # # The BUILD file has sufficient dependency relationships diff --git a/tools/code_format/check_format.py b/tools/code_format/check_format.py index a33a840ca7c1b..e95c9933cf02e 100755 --- a/tools/code_format/check_format.py +++ b/tools/code_format/check_format.py @@ -335,9 +335,9 @@ def checkTools(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-10.0.0\n" - " export CLANG_FORMAT=/opt/bin/clang-format-10\n" - " export CLANG_FORMAT=/usr/local/opt/llvm@10/bin/clang-format".format( + " export CLANG_FORMAT=clang-format-11.0.1\n" + " export CLANG_FORMAT=/opt/bin/clang-format-11\n" + " export CLANG_FORMAT=/usr/local/opt/llvm@11/bin/clang-format".format( CLANG_FORMAT_PATH)) def checkBazelTool(name, path, var):