Rework how MB and GN handle concurrent links.
The Mac and iOS GN bots don't currently limit the number of concurrent
links. The official continuous win bots aren't on MB because they can't
limit the number of concurrent links through MB.
This CL adds a 'concurrent_links' arg to GN, which calls the
get_concurrent_links script to get the appropriate default value
(making this consistent across platforms), and also adds a hack
to MB to translate a gyp_link_concurrent "GYP_DEFINE" to the
GYP_LINK_CONCURRENCY env var.
The CL also adds a test for this MB hack and the similar, already existing
LLVM_FORCE_HEAD_REVISION hack.
[email protected], [email protected]
BUG=602480, 611491, 616390
Review-Url: https://codereview.chromium.org/2031233002
Cr-Commit-Position: refs/heads/master@{#398200}
diff --git a/tools/mb/mb.py b/tools/mb/mb.py
index 17a4d4f0..20cb11cf 100755
--- a/tools/mb/mb.py
+++ b/tools/mb/mb.py
@@ -1127,9 +1127,19 @@
# to get rid of the arg and add the old var in, instead.
# See crbug.com/582737 for more on this. This can hopefully all
# go away with GYP.
- if 'llvm_force_head_revision=1' in gyp_defines:
+ m = re.search('llvm_force_head_revision=1\s*', gyp_defines)
+ if m:
env['LLVM_FORCE_HEAD_REVISION'] = '1'
- gyp_defines = gyp_defines.replace('llvm_force_head_revision=1', '')
+ gyp_defines = gyp_defines.replace(m.group(0), '')
+
+ # This is another terrible hack to work around the fact that
+ # GYP sets the link concurrency to use via the GYP_LINK_CONCURRENCY
+ # environment variable, and not via a proper GYP_DEFINE. See
+ # crbug.com/611491 for more on this.
+ m = re.search('gyp_link_concurrency=(\d+)(\s*)', gyp_defines)
+ if m:
+ env['GYP_LINK_CONCURRENCY'] = m.group(1)
+ gyp_defines = gyp_defines.replace(m.group(0), '')
env['GYP_GENERATORS'] = 'ninja'
if 'GYP_CHROMIUM_NO_ACTION' in env:
@@ -1323,6 +1333,8 @@
print_env('GYP_CROSSCOMPILE')
print_env('GYP_DEFINES')
+ print_env('GYP_LINK_CONCURRENCY')
+ print_env('LLVM_FORCE_HEAD_REVISION')
if cmd[0] == self.executable:
cmd = ['python'] + cmd[1:]