Skip to content

Commit

Permalink
use clang 12 (envoyproxy#18220)
Browse files Browse the repository at this point in the history
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
  • Loading branch information
lizan authored Sep 28, 2021
1 parent c3bc975 commit d60f86c
Show file tree
Hide file tree
Showing 13 changed files with 176 additions and 93 deletions.
42 changes: 21 additions & 21 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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++
Expand All @@ -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
Expand Down Expand Up @@ -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
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:55d9e4719d2bd0accce8f829b44dab70cd42112a
FROM gcr.io/envoy-ci/envoy-build:8ca107a75ee98b255aa59db2ab40fd0800a3ce99

ARG USERNAME=vscode
ARG USER_UID=501
Expand Down
3 changes: 2 additions & 1 deletion api/envoy/config/filter/http/jwt_authn/v2alpha/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, JwtRequirement> requires = 3;
map<string, JwtRequirement>
requires = 3;
}

// This is the Envoy HTTP filter config for JWT authentication.
Expand Down
3 changes: 2 additions & 1 deletion api/envoy/extensions/filters/http/jwt_authn/v3/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, JwtRequirement> requires = 3;
map<string, JwtRequirement>
requires = 3;
}

// This is the Envoy HTTP filter config for JWT authentication.
Expand Down
5 changes: 3 additions & 2 deletions bazel/dependency_imports.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
load("@rules_foreign_cc//foreign_cc:repositories.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")
Expand All @@ -9,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"
Expand All @@ -18,7 +18,6 @@ def envoy_dependency_imports(go_version = GO_VERSION):
rules_foreign_cc_dependencies(register_default_tools = False, register_built_tools = False)
go_rules_dependencies()
go_register_toolchains(go_version)
rbe_toolchains_config()
gazelle_dependencies()
apple_rules_dependencies()
rust_repositories()
Expand All @@ -29,6 +28,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",
Expand Down
39 changes: 39 additions & 0 deletions bazel/external/envoy_build_tools.patch
Original file line number Diff line number Diff line change
@@ -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", "-g"],
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", "-g"],
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", "-g"],
expand_if_available = "per_object_debug_info_file",
),
],
13 changes: 13 additions & 0 deletions bazel/external/rules_cc.patch
Original file line number Diff line number Diff line change
@@ -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", "-g"],
expand_if_available = "per_object_debug_info_file",
),
],
12 changes: 10 additions & 2 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,16 @@ 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("rules_cc")
external_http_archive(
name = "envoy_build_tools",
patch_args = ["-p1"],
patches = ["@envoy//bazel/external:envoy_build_tools.patch"],
)
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.
Expand Down
18 changes: 9 additions & 9 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 = "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(
Expand Down Expand Up @@ -669,11 +669,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(
Expand Down Expand Up @@ -922,12 +922,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(
Expand Down
4 changes: 2 additions & 2 deletions examples/wasm-cc/docker-compose-wasm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions test/common/http/header_map_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading

0 comments on commit d60f86c

Please sign in to comment.