-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: enable clang based RBE in Azure pipelines (#7536)
Description: Minimum configuration to enable RBE and run release pipeline in Azure pipelines. Risk Level: Low Testing: Docs Changes: N/A Release Notes: N/A Signed-off-by: Lizan Zhou <[email protected]>
- Loading branch information
Showing
33 changed files
with
3,315 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
licenses(["notice"]) # Apache 2 | ||
|
||
platform( | ||
name = "rbe_ubuntu_clang_platform", | ||
parents = ["@rbe_ubuntu_clang//config:platform"], | ||
remote_execution_properties = """ | ||
{PARENT_REMOTE_EXECUTION_PROPERTIES} | ||
properties: { | ||
name: "dockerAddCapabilities" | ||
value: "SYS_PTRACE,NET_RAW,NET_ADMIN" | ||
} | ||
properties: { | ||
name: "dockerNetwork" | ||
value: "standard" | ||
} | ||
""", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Bazel Toolchains | ||
|
||
This directory contains toolchains config generated for Bazel [RBE](https://docs.bazel.build/versions/master/remote-execution.html) and | ||
[Docker sandbox](https://docs.bazel.build/versions/master/remote-execution-sandbox.html). | ||
|
||
To regenerate toolchain configs, update the docker image information in `rbe_toolchains_config.bzl` and run following command in an | ||
environment with the latest Bazel and Docker installed: | ||
|
||
``` | ||
bazel/toolchains/regenerate.sh | ||
``` | ||
|
||
This will generate configs in `bazel/toolchains/configs`, check in those files so they can be used in CI. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# RBE autoconfig generator will generate a .bazelrc but we don't need it. | ||
.latest.bazelrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
# Copyright 2016 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This becomes the BUILD file for @local_config_cc// under non-FreeBSD unixes. | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
load(":cc_toolchain_config.bzl", "cc_toolchain_config") | ||
load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config") | ||
|
||
licenses(["notice"]) # Apache 2.0 | ||
|
||
cc_library( | ||
name = "malloc", | ||
) | ||
|
||
filegroup( | ||
name = "empty", | ||
srcs = [], | ||
) | ||
|
||
filegroup( | ||
name = "cc_wrapper", | ||
srcs = ["cc_wrapper.sh"], | ||
) | ||
|
||
filegroup( | ||
name = "compiler_deps", | ||
srcs = glob(["extra_tools/**"], allow_empty = True) + [":empty"], | ||
) | ||
|
||
# This is the entry point for --crosstool_top. Toolchains are found | ||
# by lopping off the name of --crosstool_top and searching for | ||
# the "${CPU}" entry in the toolchains attribute. | ||
cc_toolchain_suite( | ||
name = "toolchain", | ||
toolchains = { | ||
"k8|clang": ":cc-compiler-k8", | ||
"k8": ":cc-compiler-k8", | ||
"armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a", | ||
"armeabi-v7a": ":cc-compiler-armeabi-v7a", | ||
}, | ||
) | ||
|
||
cc_toolchain( | ||
name = "cc-compiler-k8", | ||
toolchain_identifier = "local", | ||
toolchain_config = ":local", | ||
all_files = ":compiler_deps", | ||
ar_files = ":compiler_deps", | ||
as_files = ":compiler_deps", | ||
compiler_files = ":compiler_deps", | ||
dwp_files = ":empty", | ||
linker_files = ":compiler_deps", | ||
objcopy_files = ":empty", | ||
strip_files = ":empty", | ||
supports_param_files = 1, | ||
) | ||
|
||
cc_toolchain_config( | ||
name = "local", | ||
cpu = "k8", | ||
compiler = "clang", | ||
toolchain_identifier = "local", | ||
host_system_name = "local", | ||
target_system_name = "local", | ||
target_libc = "local", | ||
abi_version = "local", | ||
abi_libc_version = "local", | ||
cxx_builtin_include_directories = ["/usr/local/include", | ||
"/usr/lib/llvm-8/lib/clang/8.0.1/include", | ||
"/usr/include/x86_64-linux-gnu", | ||
"/usr/include", | ||
"/usr/include/c++/7.4.0", | ||
"/usr/include/x86_64-linux-gnu/c++/7.4.0", | ||
"/usr/include/c++/7.4.0/backward", | ||
"/usr/include/clang/8.0.1/include"], | ||
tool_paths = {"ar": "/usr/bin/ar", | ||
"ld": "/usr/bin/ld", | ||
"cpp": "/usr/bin/cpp", | ||
"gcc": "/usr/lib/llvm-8/bin/clang", | ||
"dwp": "/usr/bin/dwp", | ||
"gcov": "/usr/lib/llvm-8/bin/llvm-profdata", | ||
"nm": "/usr/bin/nm", | ||
"objcopy": "/usr/bin/objcopy", | ||
"objdump": "/usr/bin/objdump", | ||
"strip": "/usr/bin/strip"}, | ||
compile_flags = ["-U_FORTIFY_SOURCE", | ||
"-fstack-protector", | ||
"-Wall", | ||
"-Wthread-safety", | ||
"-Wself-assign", | ||
"-fcolor-diagnostics", | ||
"-fno-omit-frame-pointer"], | ||
opt_compile_flags = ["-g0", | ||
"-O2", | ||
"-D_FORTIFY_SOURCE=1", | ||
"-DNDEBUG", | ||
"-ffunction-sections", | ||
"-fdata-sections"], | ||
dbg_compile_flags = ["-g"], | ||
cxx_flags = ["-std=c++0x"], | ||
link_flags = ["-fuse-ld=gold", | ||
"-Wl,-no-as-needed", | ||
"-Wl,-z,relro,-z,now", | ||
"-B/usr/lib/llvm-8/bin", | ||
"-lm", | ||
"-static-libgcc"], | ||
link_libs = ["-l:libstdc++.a"], | ||
opt_link_flags = ["-Wl,--gc-sections"], | ||
unfiltered_compile_flags = ["-no-canonical-prefixes", | ||
"-Wno-builtin-macro-redefined", | ||
"-D__DATE__=\"redacted\"", | ||
"-D__TIMESTAMP__=\"redacted\"", | ||
"-D__TIME__=\"redacted\""], | ||
coverage_compile_flags = ["-fprofile-instr-generate", "-fcoverage-mapping"], | ||
coverage_link_flags = ["-fprofile-instr-generate"], | ||
supports_start_end_lib = True, | ||
) | ||
|
||
# Android tooling requires a default toolchain for the armeabi-v7a cpu. | ||
cc_toolchain( | ||
name = "cc-compiler-armeabi-v7a", | ||
toolchain_identifier = "stub_armeabi-v7a", | ||
toolchain_config = ":stub_armeabi-v7a", | ||
all_files = ":empty", | ||
ar_files = ":empty", | ||
as_files = ":empty", | ||
compiler_files = ":empty", | ||
dwp_files = ":empty", | ||
linker_files = ":empty", | ||
objcopy_files = ":empty", | ||
strip_files = ":empty", | ||
supports_param_files = 1, | ||
) | ||
|
||
armeabi_cc_toolchain_config(name = "stub_armeabi-v7a") |
Oops, something went wrong.