Skip to content

Commit

Permalink
use clang 12
Browse files Browse the repository at this point in the history
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
  • Loading branch information
lizan committed Sep 22, 2021
1 parent b868e15 commit 8ad8a2d
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 30 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
2 changes: 0 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//: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")
Expand All @@ -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()
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", "-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",
),
],
6 changes: 5 additions & 1 deletion bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
6 changes: 3 additions & 3 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
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

0 comments on commit 8ad8a2d

Please sign in to comment.