Revert "[infra] Begin RBE Linux x64 support."
This reverts commit 9a11fe517c.
Reason for revert: broke the build for some users.
Original change's description:
> [infra] Begin RBE Linux x64 support.
>
> Bug: b/296994239
> Change-Id: I0ddf9a1beb2996ac67b59779b8b8113432434786
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331282
> Reviewed-by: William Hesse <whesse@google.com>
> Commit-Queue: Jonas Termansen <sortie@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>
Bug: b/296994239
Change-Id: Id70259b9357790581f11f105516ff0c6c63ab1ac
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331780
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
committed by
Commit Queue
parent
166ab61c4e
commit
d37620ed03
@@ -82,8 +82,6 @@ vars = {
|
||||
"clang_version": "git_revision:6d667d4b261e81f325756fdfd5bb43b3b3d2451d",
|
||||
"gn_version": "git_revision:991530ce394efb58fcd848195469022fa17ae126",
|
||||
|
||||
"reclient_version": "git_revision:81e819b39d4743462857cc55430d898b9fcca1af",
|
||||
|
||||
# Update from https://chrome-infra-packages.appspot.com/p/fuchsia/sdk/gn
|
||||
"fuchsia_sdk_version": "version:12.20230407.0.1",
|
||||
"download_fuchsia_deps": False,
|
||||
@@ -567,17 +565,6 @@ Var("dart_root") + "/third_party/pkg/tar":
|
||||
"dep_type": "cipd",
|
||||
},
|
||||
|
||||
Var("dart_root") + '/buildtools/reclient': {
|
||||
'packages': [
|
||||
{
|
||||
'package': 'infra/rbe/client/${{platform}}',
|
||||
'version': Var('reclient_version'),
|
||||
}
|
||||
],
|
||||
'condition': 'host_os == "linux" and host_cpu == "x64"',
|
||||
'dep_type': 'cipd',
|
||||
},
|
||||
|
||||
Var("dart_root") + "/third_party/webdriver/chrome": {
|
||||
"packages": [
|
||||
{
|
||||
|
||||
@@ -9,17 +9,11 @@ import("//build/toolchain/goma.gni")
|
||||
|
||||
if (use_goma) {
|
||||
assert(!use_ccache, "Goma and ccache can't be used together.")
|
||||
assembler_prefix = "$goma_dir/gomacc "
|
||||
compiler_prefix = "$goma_dir/gomacc "
|
||||
link_prefix = "$goma_dir/gomacc "
|
||||
} else if (use_ccache) {
|
||||
assembler_prefix = "ccache "
|
||||
compiler_prefix = "ccache "
|
||||
link_prefix = "ccache "
|
||||
} else {
|
||||
assembler_prefix = ""
|
||||
compiler_prefix = ""
|
||||
link_prefix = ""
|
||||
}
|
||||
|
||||
toolchain("fuchsia") {
|
||||
@@ -30,11 +24,10 @@ toolchain("fuchsia") {
|
||||
# We can't do string interpolation ($ in strings) on things with dots in
|
||||
# them. To allow us to use $cc below, for example, we create copies of
|
||||
# these values in our scope.
|
||||
cc = "${compiler_prefix}${toolchain_bin}/clang"
|
||||
cxx = "${compiler_prefix}${toolchain_bin}/clang++"
|
||||
asm = "${assembler_prefix}${toolchain_bin}/clang"
|
||||
cc = "${toolchain_bin}/clang"
|
||||
cxx = "${toolchain_bin}/clang++"
|
||||
ar = "${toolchain_bin}/llvm-ar"
|
||||
ld = "${link_prefix}${toolchain_bin}/clang++"
|
||||
ld = "${toolchain_bin}/clang++"
|
||||
readelf = "${toolchain_bin}/llvm-readelf"
|
||||
nm = "${toolchain_bin}/llvm-nm"
|
||||
strip = "${toolchain_bin}/llvm-strip"
|
||||
@@ -58,7 +51,7 @@ toolchain("fuchsia") {
|
||||
|
||||
tool("cc") {
|
||||
depfile = "{{output}}.d"
|
||||
command = "$cc -MD -MF $depfile $target_triple_flags $sysroot_flags $lto_flags {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
|
||||
command = "$compiler_prefix $cc -MD -MF $depfile $target_triple_flags $sysroot_flags $lto_flags {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
|
||||
depsformat = "gcc"
|
||||
description = "CC {{output}}"
|
||||
outputs =
|
||||
@@ -67,7 +60,7 @@ toolchain("fuchsia") {
|
||||
|
||||
tool("cxx") {
|
||||
depfile = "{{output}}.d"
|
||||
command = "$cxx -MD -MF $depfile $target_triple_flags $sysroot_flags $lto_flags {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}"
|
||||
command = "$compiler_prefix $cxx -MD -MF $depfile $target_triple_flags $sysroot_flags $lto_flags {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}"
|
||||
depsformat = "gcc"
|
||||
description = "CXX {{output}}"
|
||||
outputs =
|
||||
@@ -76,7 +69,7 @@ toolchain("fuchsia") {
|
||||
|
||||
tool("asm") {
|
||||
depfile = "{{output}}.d"
|
||||
command = "$asm -MD -MF $depfile $target_triple_flags $sysroot_flags $lto_flags {{defines}} {{include_dirs}} {{asmflags}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
|
||||
command = "$compiler_prefix $cc -MD -MF $depfile $target_triple_flags $sysroot_flags $lto_flags {{defines}} {{include_dirs}} {{asmflags}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
|
||||
depsformat = "gcc"
|
||||
description = "ASM {{output}}"
|
||||
outputs =
|
||||
@@ -108,7 +101,7 @@ toolchain("fuchsia") {
|
||||
# existing .TOC file, overwrite it, otherwise, don't change it.
|
||||
tocfile = sofile + ".TOC"
|
||||
temporary_tocname = sofile + ".tmp"
|
||||
link_command = "$ld $target_triple_flags $sysroot_flags $lto_flags -shared {{ldflags}} -o $unstripped_sofile -Wl,--build-id -Wl,-soname=$soname @$rspfile"
|
||||
link_command = "$compiler_prefix $ld $target_triple_flags $sysroot_flags $lto_flags -shared {{ldflags}} -o $unstripped_sofile -Wl,--build-id -Wl,-soname=$soname @$rspfile"
|
||||
toc_command = "{ $readelf -d $unstripped_sofile | grep SONAME ; $nm -gD -f posix $unstripped_sofile | cut -f1-2 -d' '; } > $temporary_tocname"
|
||||
replace_command = "if ! cmp -s $temporary_tocname $tocfile; then mv $temporary_tocname $tocfile; fi"
|
||||
strip_command = "$strip -o $sofile $unstripped_sofile"
|
||||
@@ -152,7 +145,7 @@ toolchain("fuchsia") {
|
||||
# to point ./dart instead of ./exe.stripped/dart makes the build
|
||||
# fail because ./dart does not end up in the manifest file.
|
||||
unstripped_outfile = "{{root_out_dir}}/exe.stripped/$exename"
|
||||
command = "$ld $target_triple_flags $sysroot_flags $lto_flags {{ldflags}} -o $unstripped_outfile -Wl,--build-id -Wl,--start-group @$rspfile {{solibs}} -Wl,--end-group {{libs}} && ${strip} -o $outfile $unstripped_outfile && $symbolizer_script --nm $nm --output $symfile --binary $unstripped_outfile"
|
||||
command = "$compiler_prefix $ld $target_triple_flags $sysroot_flags $lto_flags {{ldflags}} -o $unstripped_outfile -Wl,--build-id -Wl,--start-group @$rspfile {{solibs}} -Wl,--end-group {{libs}} && ${strip} -o $outfile $unstripped_outfile && $symbolizer_script --nm $nm --output $symfile --binary $unstripped_outfile"
|
||||
description = "LINK $outfile"
|
||||
rspfile_content = "{{inputs}}"
|
||||
outputs = [
|
||||
|
||||
@@ -45,7 +45,6 @@ concurrent_links = exec_script("get_concurrent_links.py", [], "value")
|
||||
# when specified.
|
||||
template("gcc_toolchain") {
|
||||
toolchain(target_name) {
|
||||
assert(defined(invoker.asm), "gcc_toolchain() must specify a \"asm\" value")
|
||||
assert(defined(invoker.cc), "gcc_toolchain() must specify a \"cc\" value")
|
||||
assert(defined(invoker.cxx), "gcc_toolchain() must specify a \"cxx\" value")
|
||||
assert(defined(invoker.ar), "gcc_toolchain() must specify a \"ar\" value")
|
||||
@@ -61,7 +60,6 @@ template("gcc_toolchain") {
|
||||
# We can't do string interpolation ($ in strings) on things with dots in
|
||||
# them. To allow us to use $cc below, for example, we create copies of
|
||||
# these values in our scope.
|
||||
asm = invoker.asm
|
||||
cc = invoker.cc
|
||||
cxx = invoker.cxx
|
||||
ar = invoker.ar
|
||||
@@ -119,7 +117,7 @@ template("gcc_toolchain") {
|
||||
tool("asm") {
|
||||
# For GCC we can just use the C compiler to compile assembly.
|
||||
depfile = "{{output}}.d"
|
||||
command = "$asm -MMD -MF $depfile {{defines}} {{include_dirs}} {{asmflags}} -c {{source}} -o {{output}}"
|
||||
command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{asmflags}} -c {{source}} -o {{output}}"
|
||||
depsformat = "gcc"
|
||||
description = "ASM {{output}}"
|
||||
outputs =
|
||||
|
||||
@@ -6,7 +6,6 @@ import("//build/config/sysroot.gni")
|
||||
import("//build/toolchain/ccache.gni")
|
||||
import("//build/toolchain/gcc_toolchain.gni")
|
||||
import("//build/toolchain/goma.gni")
|
||||
import("//build/toolchain/rbe.gni")
|
||||
|
||||
declare_args() {
|
||||
ia32_toolchain_prefix = ""
|
||||
@@ -19,31 +18,11 @@ declare_args() {
|
||||
|
||||
if (use_goma) {
|
||||
assert(!use_ccache, "Goma and ccache can't be used together.")
|
||||
assembler_prefix = "$goma_dir/gomacc "
|
||||
compiler_prefix = "$goma_dir/gomacc "
|
||||
link_prefix = "$goma_dir/gomacc "
|
||||
} else if (use_rbe) {
|
||||
assert(!use_goma)
|
||||
rewrapper_args = [
|
||||
"$rbe_dir/rewrapper",
|
||||
"--exec_root=$rbe_exec_root",
|
||||
"--platform=$rbe_platform",
|
||||
]
|
||||
assembler_args = []
|
||||
compiler_args =
|
||||
rewrapper_args + [ "--labels=type=compile,compiler=clang,lang=cpp " ]
|
||||
link_args = [] # rewrapper_args + [ "--labels=type=link,tool=clang " ]
|
||||
assembler_prefix = string_join(" ", assembler_args)
|
||||
compiler_prefix = string_join(" ", compiler_args)
|
||||
link_prefix = string_join(" ", link_args)
|
||||
} else if (use_ccache) {
|
||||
assembler_prefix = "ccache "
|
||||
compiler_prefix = "ccache "
|
||||
link_prefix = "ccache "
|
||||
} else {
|
||||
assembler_prefix = ""
|
||||
compiler_prefix = ""
|
||||
link_prefix = ""
|
||||
}
|
||||
|
||||
# Google's clang does not work for alpine, use alpine's system clang
|
||||
@@ -65,10 +44,9 @@ gcc_toolchain("arm") {
|
||||
|
||||
cc = "${compiler_prefix}${prefix}gcc"
|
||||
cxx = "${compiler_prefix}${prefix}g++"
|
||||
asm = "${assembler_prefix}${prefix}gcc"
|
||||
|
||||
ar = "${prefix}ar"
|
||||
ld = "${link_prefix}${prefix}g++"
|
||||
ld = cxx
|
||||
readelf = "${prefix}readelf"
|
||||
nm = "${prefix}nm"
|
||||
strip = "${prefix}strip"
|
||||
@@ -82,12 +60,11 @@ gcc_toolchain("clang_arm") {
|
||||
prefix = rebased_clang_dir
|
||||
cc = "${compiler_prefix}${prefix}/clang"
|
||||
cxx = "${compiler_prefix}${prefix}/clang++"
|
||||
asm = "${assembler_prefix}${prefix}/clang"
|
||||
|
||||
readelf = "${prefix}/llvm-readelf"
|
||||
nm = "${prefix}/llvm-nm"
|
||||
ar = "${prefix}/llvm-ar"
|
||||
ld = "${link_prefix}${prefix}/clang++"
|
||||
ld = cxx
|
||||
llvm_objcopy = "${prefix}/llvm-objcopy"
|
||||
|
||||
toolchain_cpu = "arm"
|
||||
@@ -103,10 +80,9 @@ gcc_toolchain("arm64") {
|
||||
|
||||
cc = "${compiler_prefix}${prefix}gcc"
|
||||
cxx = "${compiler_prefix}${prefix}g++"
|
||||
asm = "${assembler_prefix}${prefix}gcc"
|
||||
|
||||
ar = "${prefix}ar"
|
||||
ld = "${link_prefix}${prefix}g++"
|
||||
ld = cxx
|
||||
readelf = "${prefix}readelf"
|
||||
nm = "${prefix}nm"
|
||||
strip = "${prefix}strip"
|
||||
@@ -120,12 +96,11 @@ gcc_toolchain("clang_arm64") {
|
||||
prefix = rebased_clang_dir
|
||||
cc = "${compiler_prefix}${prefix}/clang"
|
||||
cxx = "${compiler_prefix}${prefix}/clang++"
|
||||
asm = "${assembler_prefix}${prefix}/clang"
|
||||
|
||||
readelf = "${prefix}/llvm-readelf"
|
||||
nm = "${prefix}/llvm-nm"
|
||||
ar = "${prefix}/llvm-ar"
|
||||
ld = "${link_prefix}${prefix}/clang++"
|
||||
ld = cxx
|
||||
llvm_objcopy = "${prefix}/llvm-objcopy"
|
||||
|
||||
toolchain_cpu = "arm64"
|
||||
@@ -137,12 +112,11 @@ gcc_toolchain("clang_x86") {
|
||||
prefix = rebased_clang_dir
|
||||
cc = "${compiler_prefix}${prefix}/clang"
|
||||
cxx = "${compiler_prefix}${prefix}/clang++"
|
||||
asm = "${assembler_prefix}${prefix}/clang"
|
||||
|
||||
readelf = "${prefix}/llvm-readelf"
|
||||
nm = "${prefix}/llvm-nm"
|
||||
ar = "${prefix}/llvm-ar"
|
||||
ld = "${link_prefix}${prefix}/clang++"
|
||||
ld = cxx
|
||||
llvm_objcopy = "${prefix}/llvm-objcopy"
|
||||
|
||||
toolchain_cpu = "x86"
|
||||
@@ -157,12 +131,11 @@ gcc_toolchain("x86") {
|
||||
}
|
||||
cc = "${compiler_prefix}${prefix}gcc"
|
||||
cxx = "${compiler_prefix}${prefix}g++"
|
||||
asm = "${assembler_prefix}${prefix}gcc"
|
||||
|
||||
readelf = "${prefix}readelf"
|
||||
nm = "${prefix}nm"
|
||||
ar = "${prefix}ar"
|
||||
ld = "${link_prefix}${prefix}g++"
|
||||
ld = cxx
|
||||
strip = "${prefix}strip"
|
||||
|
||||
toolchain_cpu = "x86"
|
||||
@@ -174,12 +147,11 @@ gcc_toolchain("clang_x64") {
|
||||
prefix = rebased_clang_dir
|
||||
cc = "${compiler_prefix}${prefix}/clang"
|
||||
cxx = "${compiler_prefix}${prefix}/clang++"
|
||||
asm = "${assembler_prefix}${prefix}/clang"
|
||||
|
||||
readelf = "${prefix}/llvm-readelf"
|
||||
nm = "${prefix}/llvm-nm"
|
||||
ar = "${prefix}/llvm-ar"
|
||||
ld = "${link_prefix}${prefix}/clang++"
|
||||
ld = cxx
|
||||
llvm_objcopy = "${prefix}/llvm-objcopy"
|
||||
|
||||
toolchain_cpu = "x64"
|
||||
@@ -194,12 +166,11 @@ gcc_toolchain("x64") {
|
||||
}
|
||||
cc = "${compiler_prefix}${prefix}gcc"
|
||||
cxx = "${compiler_prefix}${prefix}g++"
|
||||
asm = "${assembler_prefix}${prefix}gcc"
|
||||
|
||||
readelf = "${prefix}readelf"
|
||||
nm = "${prefix}nm"
|
||||
ar = "${prefix}ar"
|
||||
ld = "${link_prefix}${prefix}g++"
|
||||
ld = cxx
|
||||
strip = "${prefix}strip"
|
||||
|
||||
toolchain_cpu = "x64"
|
||||
@@ -215,10 +186,9 @@ gcc_toolchain("riscv32") {
|
||||
|
||||
cc = "${compiler_prefix}${prefix}gcc"
|
||||
cxx = "${compiler_prefix}${prefix}g++"
|
||||
asm = "${assembler_prefix}${prefix}gcc"
|
||||
|
||||
ar = "${prefix}ar"
|
||||
ld = "${link_prefix}${prefix}g++"
|
||||
ld = cxx
|
||||
readelf = "${prefix}readelf"
|
||||
nm = "${prefix}nm"
|
||||
strip = "${prefix}strip"
|
||||
@@ -232,12 +202,11 @@ gcc_toolchain("clang_riscv32") {
|
||||
prefix = rebased_clang_dir
|
||||
cc = "${compiler_prefix}${prefix}/clang"
|
||||
cxx = "${compiler_prefix}${prefix}/clang++"
|
||||
asm = "${assembler_prefix}${prefix}/clang"
|
||||
|
||||
readelf = "${prefix}/llvm-readelf"
|
||||
nm = "${prefix}/llvm-nm"
|
||||
ar = "${prefix}/llvm-ar"
|
||||
ld = "${link_prefix}${prefix}/clang++"
|
||||
ld = cxx
|
||||
llvm_objcopy = "${prefix}/llvm-objcopy"
|
||||
|
||||
toolchain_cpu = "riscv32"
|
||||
@@ -253,10 +222,9 @@ gcc_toolchain("riscv64") {
|
||||
|
||||
cc = "${compiler_prefix}${prefix}gcc"
|
||||
cxx = "${compiler_prefix}${prefix}g++"
|
||||
asm = "${assembler_prefix}${prefix}gcc"
|
||||
|
||||
ar = "${prefix}ar"
|
||||
ld = "${link_prefix}${prefix}g++"
|
||||
ld = cxx
|
||||
readelf = "${prefix}readelf"
|
||||
nm = "${prefix}nm"
|
||||
strip = "${prefix}strip"
|
||||
@@ -270,12 +238,11 @@ gcc_toolchain("clang_riscv64") {
|
||||
prefix = rebased_clang_dir
|
||||
cc = "${compiler_prefix}${prefix}/clang"
|
||||
cxx = "${compiler_prefix}${prefix}/clang++"
|
||||
asm = "${assembler_prefix}${prefix}/clang"
|
||||
|
||||
readelf = "${prefix}/llvm-readelf"
|
||||
nm = "${prefix}/llvm-nm"
|
||||
ar = "${prefix}/llvm-ar"
|
||||
ld = "${link_prefix}${prefix}/clang++"
|
||||
ld = cxx
|
||||
llvm_objcopy = "${prefix}/llvm-objcopy"
|
||||
|
||||
toolchain_cpu = "riscv64"
|
||||
|
||||
@@ -15,13 +15,9 @@ import("//build/config/sysroot.gni")
|
||||
import("//build/toolchain/goma.gni")
|
||||
|
||||
if (use_goma) {
|
||||
assembler_prefix = "$goma_dir/gomacc "
|
||||
compiler_prefix = "$goma_dir/gomacc "
|
||||
link_prefix = "$goma_dir/gomacc "
|
||||
goma_prefix = "$goma_dir/gomacc "
|
||||
} else {
|
||||
assembler_prefix = ""
|
||||
compiler_prefix = ""
|
||||
link_prefix = ""
|
||||
goma_prefix = ""
|
||||
}
|
||||
|
||||
# Goma doesn't support the host-arm64 toolchain, so continue using Rosetta.
|
||||
@@ -37,7 +33,6 @@ if (host_cpu == "arm64" && !use_goma) {
|
||||
# build args in this definition.
|
||||
template("mac_toolchain") {
|
||||
toolchain(target_name) {
|
||||
assert(defined(invoker.asm), "mac_toolchain() must specify a \"asm\" value")
|
||||
assert(defined(invoker.cc), "mac_toolchain() must specify a \"cc\" value")
|
||||
assert(defined(invoker.cxx), "mac_toolchain() must specify a \"cxx\" value")
|
||||
assert(defined(invoker.ar), "mac_toolchain() must specify an \"ar\" value")
|
||||
@@ -50,7 +45,6 @@ template("mac_toolchain") {
|
||||
# We can't do string interpolation ($ in strings) on things with dots in
|
||||
# them. To allow us to use $cc below, for example, we create copies of
|
||||
# these values in our scope.
|
||||
asm = invoker.asm
|
||||
cc = invoker.cc
|
||||
cxx = invoker.cxx
|
||||
ar = invoker.ar
|
||||
@@ -93,7 +87,7 @@ template("mac_toolchain") {
|
||||
tool("asm") {
|
||||
# For GCC we can just use the C compiler to compile assembly.
|
||||
depfile = "{{output}}.d"
|
||||
command = "$asm -MMD -MF $depfile {{defines}} {{include_dirs}} $sysroot_flags $toolchain_flags {{asmflags}} -c {{source}} -o {{output}}"
|
||||
command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} $sysroot_flags $toolchain_flags {{asmflags}} -c {{source}} -o {{output}}"
|
||||
depsformat = "gcc"
|
||||
description = "ASM {{output}}"
|
||||
outputs =
|
||||
@@ -242,11 +236,10 @@ mac_toolchain("clang_x64") {
|
||||
toolchain_cpu = "x64"
|
||||
toolchain_os = "mac"
|
||||
prefix = rebased_clang_dir
|
||||
cc = "${compiler_prefix}${prefix}/clang"
|
||||
cxx = "${compiler_prefix}${prefix}/clang++"
|
||||
asm = "${assembler_prefix}${prefix}/clang"
|
||||
cc = "${goma_prefix}$prefix/clang"
|
||||
cxx = "${goma_prefix}$prefix/clang++"
|
||||
ar = "${prefix}/llvm-ar"
|
||||
ld = "${link_prefix}${prefix}/clang++"
|
||||
ld = cxx
|
||||
strip = "${prefix}/llvm-strip"
|
||||
nm = "${prefix}/llvm-nm"
|
||||
is_clang = true
|
||||
@@ -260,11 +253,10 @@ mac_toolchain("clang_arm64") {
|
||||
toolchain_cpu = "arm64"
|
||||
toolchain_os = "mac"
|
||||
prefix = rebased_clang_dir
|
||||
cc = "${compiler_prefix}${prefix}/clang"
|
||||
cxx = "${compiler_prefix}${prefix}/clang++"
|
||||
asm = "${assembler_prefix}${prefix}/clang"
|
||||
cc = "${goma_prefix}$prefix/clang"
|
||||
cxx = "${goma_prefix}$prefix/clang++"
|
||||
ar = "${prefix}/llvm-ar"
|
||||
ld = "${link_prefix}${prefix}/clang++"
|
||||
ld = cxx
|
||||
strip = "${prefix}/llvm-strip"
|
||||
nm = "${prefix}/llvm-nm"
|
||||
is_clang = true
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
# Defines the configuration of RBE.
|
||||
|
||||
declare_args() {
|
||||
# Set to true to enable distributed compilation using RBE.
|
||||
use_rbe = false
|
||||
|
||||
rbe_exec_root = rebase_path("//")
|
||||
|
||||
rbe_platform = "container-image=docker://gcr.io/cloud-marketplace/google/debian11@sha256:69e2789c9f3d28c6a0f13b25062c240ee7772be1f5e6d41bb4680b63eae6b304"
|
||||
|
||||
rbe_dir = rebase_path("//buildtools/reclient")
|
||||
}
|
||||
@@ -25,9 +25,9 @@ tool_wrapper_path = rebase_path("tool_wrapper.py", root_build_dir)
|
||||
ninja_path = rebase_path("//buildtools/ninja/ninja")
|
||||
|
||||
if (use_goma) {
|
||||
compiler_prefix = "$goma_dir/gomacc.exe "
|
||||
goma_prefix = "$goma_dir/gomacc.exe "
|
||||
} else {
|
||||
compiler_prefix = ""
|
||||
goma_prefix = ""
|
||||
}
|
||||
|
||||
if (current_toolchain == default_toolchain) {
|
||||
@@ -258,7 +258,7 @@ template("win_toolchains") {
|
||||
|
||||
msvc_toolchain(target_name) {
|
||||
environment = "environment." + toolchain_arch
|
||||
cl = "${compiler_prefix}\"${win_toolchain_data.vc_bin_dir}/cl.exe\""
|
||||
cl = "${goma_prefix}\"${win_toolchain_data.vc_bin_dir}/cl.exe\""
|
||||
toolchain_args = {
|
||||
if (defined(invoker.toolchain_args)) {
|
||||
forward_variables_from(invoker.toolchain_args, "*")
|
||||
@@ -270,7 +270,7 @@ template("win_toolchains") {
|
||||
msvc_toolchain("clang_" + target_name) {
|
||||
environment = "environment." + toolchain_arch
|
||||
prefix = rebase_path("$clang_base_path/bin", root_build_dir)
|
||||
cl = "${compiler_prefix}$prefix/clang-cl.exe"
|
||||
cl = "${goma_prefix}$prefix/clang-cl.exe"
|
||||
toolchain_args = {
|
||||
if (defined(invoker.toolchain_args)) {
|
||||
forward_variables_from(invoker.toolchain_args, "*")
|
||||
|
||||
+67
-101
@@ -43,20 +43,15 @@ def BuildOptions():
|
||||
|
||||
other_group.add_argument("-j",
|
||||
type=int,
|
||||
help='Ninja -j option for Goma/RBE builds.',
|
||||
help='Ninja -j option for Goma builds.',
|
||||
default=1000)
|
||||
other_group.add_argument("-l",
|
||||
type=int,
|
||||
help='Ninja -l option for Goma/RBE builds.',
|
||||
help='Ninja -l option for Goma builds.',
|
||||
default=64)
|
||||
other_group.add_argument("--no-start-goma",
|
||||
help="Don't try to start goma",
|
||||
default=False,
|
||||
dest='no_start_rbe',
|
||||
action='store_true')
|
||||
other_group.add_argument("--no-start-rbe",
|
||||
help="Don't try to start rbe",
|
||||
default=False,
|
||||
action='store_true')
|
||||
other_group.add_argument(
|
||||
"--check-clean",
|
||||
@@ -129,83 +124,63 @@ def UseGoma(out_dir):
|
||||
return 'use_goma = true' in open(args_gn, 'r').read()
|
||||
|
||||
|
||||
def UseRBE(out_dir):
|
||||
args_gn = os.path.join(out_dir, 'args.gn')
|
||||
return 'use_rbe = true' in open(args_gn, 'r').read()
|
||||
|
||||
|
||||
# Try to start RBE, but don't bail out if we can't. Instead print an error
|
||||
# Try to start goma, but don't bail out if we can't. Instead print an error
|
||||
# message, and let the build fail with its own error messages as well.
|
||||
rbe_started = None
|
||||
bootstrap_path = None
|
||||
goma_started = False
|
||||
|
||||
|
||||
def StartRBE(out_dir, use_goma):
|
||||
global rbe_started, bootstrap_path
|
||||
rbe = 'goma' if use_goma else 'rbe'
|
||||
if rbe_started:
|
||||
if rbe_started != rbe:
|
||||
print(f'Cannot mix RBE and Goma')
|
||||
return False
|
||||
def EnsureGomaStarted(out_dir):
|
||||
global goma_started
|
||||
if goma_started:
|
||||
return True
|
||||
args_gn_path = os.path.join(out_dir, 'args.gn')
|
||||
rbe_dir = None if use_goma else 'buildtools/reclient'
|
||||
goma_dir = None
|
||||
with open(args_gn_path, 'r') as fp:
|
||||
for line in fp:
|
||||
if ('goma_dir' if use_goma else 'rbe_dir') in line:
|
||||
if 'goma_dir' in line:
|
||||
words = line.split()
|
||||
rbe_dir = words[2][1:-1] # rbe_dir = "/path/to/rbe"
|
||||
if not rbe_dir:
|
||||
print(f'Could not find {rbe} for {out_dir}')
|
||||
goma_dir = words[2][1:-1] # goma_dir = "/path/to/goma"
|
||||
if not goma_dir:
|
||||
print('Could not find goma for ' + out_dir)
|
||||
return False
|
||||
if not os.path.exists(rbe_dir) or not os.path.isdir(rbe_dir):
|
||||
print(f'Could not find {rbe} at {rbe_dir}')
|
||||
if not os.path.exists(goma_dir) or not os.path.isdir(goma_dir):
|
||||
print('Could not find goma at ' + goma_dir)
|
||||
return False
|
||||
bootstrap = 'goma_ctl.py' if use_goma else 'bootstrap'
|
||||
bootstrap_path = os.path.join(rbe_dir, bootstrap)
|
||||
bootstrap_command = [bootstrap_path]
|
||||
if use_goma:
|
||||
bootstrap_command = ['python3', goma_ctl, 'ensure_start']
|
||||
process = subprocess.Popen(bootstrap_command)
|
||||
goma_ctl = os.path.join(goma_dir, 'goma_ctl.py')
|
||||
goma_ctl_command = [
|
||||
'python3',
|
||||
goma_ctl,
|
||||
'ensure_start',
|
||||
]
|
||||
process = subprocess.Popen(goma_ctl_command)
|
||||
process.wait()
|
||||
if process.returncode != 0:
|
||||
print(f"Starting {rbe} failed. Try running it manually: " + "\n\t" +
|
||||
' '.join(goma_ctl_command))
|
||||
print(
|
||||
"Tried to run goma_ctl.py, but it failed. Try running it manually: "
|
||||
+ "\n\t" + ' '.join(goma_ctl_command))
|
||||
return False
|
||||
rbe_started = rbe
|
||||
goma_started = True
|
||||
return True
|
||||
|
||||
|
||||
def StopRBE():
|
||||
global rbe_started, bootstrap_path
|
||||
if rbe_started != 'rbe':
|
||||
return
|
||||
bootstrap_command = [bootstrap_path, '--shutdown']
|
||||
process = subprocess.Popen(bootstrap_command)
|
||||
process.wait()
|
||||
|
||||
|
||||
# Returns a tuple (build_config, command to run, whether rbe is used)
|
||||
# Returns a tuple (build_config, command to run, whether goma is used)
|
||||
def BuildOneConfig(options, targets, target_os, mode, arch, sanitizer):
|
||||
build_config = utils.GetBuildConf(mode, arch, target_os, sanitizer)
|
||||
out_dir = utils.GetBuildRoot(HOST_OS, mode, arch, target_os, sanitizer)
|
||||
using_rbe = False
|
||||
using_goma = False
|
||||
command = ['buildtools/ninja/ninja', '-C', out_dir]
|
||||
if options.verbose:
|
||||
command += ['-v']
|
||||
use_rbe = UseRBE(out_dir)
|
||||
use_goma = UseGoma(out_dir)
|
||||
if use_rbe or use_goma:
|
||||
if options.no_start_rbe or StartRBE(out_dir, use_goma):
|
||||
using_rbe = True
|
||||
if UseGoma(out_dir):
|
||||
if options.no_start_goma or EnsureGomaStarted(out_dir):
|
||||
using_goma = True
|
||||
command += [('-j%s' % str(options.j))]
|
||||
command += [('-l%s' % str(options.l))]
|
||||
else:
|
||||
# If we couldn't ensure that RBE is started, let the build start,
|
||||
# but slowly so we can see any helpful error messages that pop out.
|
||||
# If we couldn't ensure that goma is started, let the build start, but
|
||||
# slowly so we can see any helpful error messages that pop out.
|
||||
command += ['-j1']
|
||||
command += targets
|
||||
return (build_config, command, using_rbe)
|
||||
return (build_config, command, using_goma)
|
||||
|
||||
|
||||
def RunOneBuildCommand(build_config, args, env):
|
||||
@@ -258,43 +233,6 @@ def SanitizerEnvironmentVariables():
|
||||
return env
|
||||
|
||||
|
||||
def Build(configs, env, options):
|
||||
# Build regular configs.
|
||||
rbe_builds = []
|
||||
for (build_config, args, rbe) in configs:
|
||||
if args is None:
|
||||
return 1
|
||||
if rbe:
|
||||
rbe_builds.append([env, args])
|
||||
elif RunOneBuildCommand(build_config, args, env=env) != 0:
|
||||
return 1
|
||||
|
||||
# Run RBE builds in parallel.
|
||||
active_rbe_builds = []
|
||||
for (env, args) in rbe_builds:
|
||||
print(' '.join(args))
|
||||
process = subprocess.Popen(args, env=env)
|
||||
active_rbe_builds.append([args, process])
|
||||
while active_rbe_builds:
|
||||
time.sleep(0.1)
|
||||
for rbe_build in active_rbe_builds:
|
||||
(args, process) = rbe_build
|
||||
if process.poll() is not None:
|
||||
print(' '.join(args) + " done.")
|
||||
active_rbe_builds.remove(rbe_build)
|
||||
if process.returncode != 0:
|
||||
for (_, to_kill) in active_rbe_builds:
|
||||
to_kill.terminate()
|
||||
return 1
|
||||
|
||||
if options.check_clean:
|
||||
for (build_config, args, rbe) in configs:
|
||||
if CheckCleanBuild(build_config, args, env=env) != 0:
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
def Main():
|
||||
starttime = time.time()
|
||||
# Parse the options.
|
||||
@@ -339,14 +277,42 @@ def Main():
|
||||
BuildOneConfig(options, targets, target_os, mode, arch,
|
||||
sanitizer))
|
||||
|
||||
exit_code = Build(configs, env, options)
|
||||
# Build regular configs.
|
||||
goma_builds = []
|
||||
for (build_config, args, goma) in configs:
|
||||
if args is None:
|
||||
return 1
|
||||
if goma:
|
||||
goma_builds.append([env, args])
|
||||
elif RunOneBuildCommand(build_config, args, env=env) != 0:
|
||||
return 1
|
||||
|
||||
StopRBE()
|
||||
# Run goma builds in parallel.
|
||||
active_goma_builds = []
|
||||
for (env, args) in goma_builds:
|
||||
print(' '.join(args))
|
||||
process = subprocess.Popen(args, env=env)
|
||||
active_goma_builds.append([args, process])
|
||||
while active_goma_builds:
|
||||
time.sleep(0.1)
|
||||
for goma_build in active_goma_builds:
|
||||
(args, process) = goma_build
|
||||
if process.poll() is not None:
|
||||
print(' '.join(args) + " done.")
|
||||
active_goma_builds.remove(goma_build)
|
||||
if process.returncode != 0:
|
||||
for (_, to_kill) in active_goma_builds:
|
||||
to_kill.terminate()
|
||||
return 1
|
||||
|
||||
if exit_code == 0:
|
||||
endtime = time.time()
|
||||
print("The build took %.3f seconds" % (endtime - starttime))
|
||||
return exit_code
|
||||
if options.check_clean:
|
||||
for (build_config, args, goma) in configs:
|
||||
if CheckCleanBuild(build_config, args, env=env) != 0:
|
||||
return 1
|
||||
|
||||
endtime = time.time()
|
||||
print("The build took %.3f seconds" % (endtime - starttime))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
+1
-11
@@ -320,9 +320,6 @@ def ToGnArgs(args, mode, arch, target_os, sanitizer, verify_sdk_hash):
|
||||
if gn_args['target_os'] == 'mac' and gn_args['use_goma']:
|
||||
gn_args['mac_use_goma_rbe'] = True
|
||||
|
||||
gn_args['use_rbe'] = args.rbe
|
||||
|
||||
|
||||
# Code coverage requires -O0 to be set.
|
||||
if enable_code_coverage:
|
||||
gn_args['dart_debug_optimization_level'] = 0
|
||||
@@ -434,14 +431,7 @@ def AddCommonGnOptionArgs(parser):
|
||||
help='Disable goma',
|
||||
dest='goma',
|
||||
action='store_false')
|
||||
parser.set_defaults(goma=os.environ.get('RBE_cfg') == None)
|
||||
|
||||
parser.add_argument('--rbe', help='Use rbe', action='store_true')
|
||||
parser.add_argument('--no-rbe',
|
||||
help='Disable rbe',
|
||||
dest='rbe',
|
||||
action='store_false')
|
||||
parser.set_defaults(rbe=os.environ.get('RBE_cfg') != None)
|
||||
parser.set_defaults(goma=True)
|
||||
|
||||
parser.add_argument('--verify-sdk-hash',
|
||||
help='Enable SDK hash checks (default)',
|
||||
|
||||
Reference in New Issue
Block a user