(Reland) Detect RBE builds and accelerate them.
Chromecast builds use a buildflag called `use_rbe` instead of
`use_remoteexec` or `use_goma`.
Previous attempt at crrev.com/c/4144469 tried recycling the
use_remoteexec variable for the use_rbe case, but that caused
problems with Cast CI because it would hit the error case
where the reclient binary isn't found.
This new attempt introduces a new dedicated use_rbe variable
that skips that check intended only for use_remoteexec.
Bug: b/266099996
Test: run `autoninja` in the chromecast internal repo
Change-Id: Ieaf3af709589fe1b8611904afc2fd80284b333b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4179133
Auto-Submit: Simeon Anfinrud <sanfin@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
diff --git a/autoninja.py b/autoninja.py
index 661f144..6418fcc 100755
--- a/autoninja.py
+++ b/autoninja.py
@@ -66,6 +66,7 @@
use_goma = False
use_remoteexec = False
+ use_rbe = False
# Currently get reclient binary and config dirs relative to output_dir. If
# they exist and using remoteexec, then automatically call bootstrap to start
@@ -82,7 +83,7 @@
if os.path.exists(os.path.join(output_dir, 'args.gn')):
with open(os.path.join(output_dir, 'args.gn')) as file_handle:
for line in file_handle:
- # Either use_goma or use_remoteexec will activate build acceleration.
+ # use_goma, use_remoteexec, or use_rbe will activate build acceleration.
#
# This test can match multi-argument lines. Examples of this are:
# is_debug=false use_goma=true is_official_build=false
@@ -98,6 +99,10 @@
line_without_comment):
use_remoteexec = True
continue
+ if re.search(r'(^|\s)(use_rbe)\s*=\s*true($|\s)', line_without_comment):
+ use_rbe = True
+ continue
+
else:
for relative_path in [
'', # GN keeps them in the root of output_dir
@@ -184,7 +189,7 @@
num_cores = multiprocessing.cpu_count()
if not j_specified and not t_specified:
- if use_goma or use_remoteexec:
+ if use_goma or use_remoteexec or use_rbe:
args.append('-j')
default_core_multiplier = 80
if platform.machine() in ('x86_64', 'AMD64'):