Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/codeql-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/...

Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/codeql-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions bazel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

```

Expand All @@ -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
Expand Down Expand Up @@ -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"
```

Expand Down
1 change: 1 addition & 0 deletions bazel/foreign_cc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
5 changes: 2 additions & 3 deletions examples/wasm-cc/docker-compose-wasm.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"
Expand Down
9 changes: 4 additions & 5 deletions source/common/common/interval_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ template <typename T, typename Interval> 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
Expand Down
11 changes: 5 additions & 6 deletions source/common/local_reply/local_reply.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
16 changes: 8 additions & 8 deletions test/common/network/apple_dns_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<DnsResponse> &&) -> void {
// This callback should never be executed.
FAIL();
}));
EXPECT_EQ(nullptr,
resolver_->resolve("foo.com", Network::DnsLookupFamily::Auto,
[](DnsResolver::ResolutionStatus, std::list<DnsResponse>&&) -> void {
// This callback should never be executed.
FAIL();
}));
}

TEST_F(AppleDnsImplFakeApiTest, QuerySynchronousCompletion) {
Expand Down Expand Up @@ -428,7 +428,7 @@ TEST_F(AppleDnsImplFakeApiTest, IncorrectInterfaceIndexReturned) {

resolver_->resolve(
hostname, Network::DnsLookupFamily::Auto,
[](DnsResolver::ResolutionStatus, std::list<DnsResponse> &&) -> void { FAIL(); });
[](DnsResolver::ResolutionStatus, std::list<DnsResponse>&&) -> void { FAIL(); });
}

TEST_F(AppleDnsImplFakeApiTest, QueryCompletedWithError) {
Expand Down Expand Up @@ -785,7 +785,7 @@ TEST_F(AppleDnsImplFakeApiTest, ResultWithNullAddress) {

auto query = resolver_->resolve(
hostname, Network::DnsLookupFamily::Auto,
[](DnsResolver::ResolutionStatus, std::list<DnsResponse> &&) -> void { FAIL(); });
[](DnsResolver::ResolutionStatus, std::list<DnsResponse>&&) -> void { FAIL(); });
ASSERT_NE(nullptr, query);

EXPECT_DEATH(reply_callback(nullptr, kDNSServiceFlagsAdd, 0, kDNSServiceErr_NoError,
Expand Down
4 changes: 2 additions & 2 deletions test/run_envoy_bazel_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/')

Expand Down
6 changes: 3 additions & 3 deletions test/test_common/environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
{
Expand Down
2 changes: 1 addition & 1 deletion tools/api_boost/api_boost.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions tools/clang_tools/api_booster/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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() {}
Expand Down
4 changes: 2 additions & 2 deletions tools/clang_tools/support/BUILD.prebuilt
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we going backward from 18.04 to 16.04 here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either ubuntu 16.04 and 20.04 has prebuild 11.0.0 https://releases.llvm.org/download.html
Prebuild 11.0.0-ubuntu16.04 is running fine on my ubuntu 20.04 except lldb-11.
I guess we don't need lldb-11 during the build.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's because they don't have build for 18.04 and 16.04 would just work fine in 18.04.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough; prefer going forward than back all things equal but not if there are complications.

# https://github.com/llvm/llvm-project.git source. It needs Clang 10.0 to work.
#
# The BUILD file has sufficient dependency relationships
Expand Down
6 changes: 3 additions & 3 deletions tools/code_format/check_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down