Skip to content

Commit 1d53d28

Browse files
rmacnak-googleCommit Queue
authored andcommitted
[infra] Setup for x64 reclient on Linux ARM64.
Change-Id: I2ff065c8b962d768f93ea3304544ceb527f9c266 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429466 Commit-Queue: Ryan Macnak <[email protected]> Reviewed-by: Alexander Aprelev <[email protected]>
1 parent 1e92be4 commit 1d53d28

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

DEPS

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,19 @@ deps = {
482482
'dep_type': 'cipd',
483483
},
484484

485+
# linux-arm64 package is not available, use the linux-x64 package and
486+
# rely on transparent emulation.
487+
Var("dart_root") + '/buildtools/reclient-linux': {
488+
'packages': [
489+
{
490+
'package': 'infra/rbe/client/linux-amd64',
491+
'version': Var('reclient_version'),
492+
}
493+
],
494+
'condition': 'host_os == "linux"',
495+
'dep_type': 'cipd',
496+
},
497+
485498
Var("dart_root") + "/third_party/webdriver/chrome": {
486499
"packages": [
487500
{

build/toolchain/linux/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if (use_rbe) {
2222
rewrapper_args + [ "--labels=type=compile,compiler=clang,lang=cpp" ]
2323

2424
# TODO: Unfortunately I see no way to get build_arch reliably.
25-
if (rbe_os != host_os) {
25+
if (rbe_os != host_os || rbe_cpu != host_cpu) {
2626
compiler_args += [
2727
"--inputs=build/rbe,buildtools/$rbe_os-$rbe_cpu/clang/bin/llvm",
2828
"--remote_wrapper=../../build/rbe/llvm.sh",

build/toolchain/rbe.gni

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ declare_args() {
2929
if (host_os == "win") {
3030
rbe_dir =
3131
rebase_path(_dart_root + "/buildtools/reclient-win", root_build_dir)
32+
} else if (host_os == "linux") {
33+
rbe_dir =
34+
rebase_path(_dart_root + "/buildtools/reclient-linux", root_build_dir)
3235
} else {
3336
rbe_dir = rebase_path(_dart_root + "/buildtools/reclient", root_build_dir)
3437
}

tools/build.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def BuildOptions():
4444
other_group.add_argument("-j",
4545
type=int,
4646
help='Ninja -j option for RBE builds.',
47-
default=200 if sys.platform == 'win32' else 1000)
47+
default=200 if sys.platform == 'win32' else 500)
4848
other_group.add_argument("-l",
4949
type=int,
5050
help='Ninja -l option for RBE builds.',
@@ -134,10 +134,12 @@ def UseRBE(out_dir):
134134
def StartRBE(out_dir, env):
135135
global rbe_started, bootstrap_path
136136
if not rbe_started:
137-
if utils.IsWindows():
138-
rbe_dir = 'buildtools/reclient-win'
137+
if HOST_OS == 'win32':
138+
rbe_dir = 'buildtools/reclient-win'
139+
elif HOST_OS == 'linux':
140+
rbe_dir = 'buildtools/reclient-linux'
139141
else:
140-
rbe_dir = 'buildtools/reclient'
142+
rbe_dir = 'buildtools/reclient'
141143
with open(os.path.join(out_dir, 'args.gn'), 'r') as fp:
142144
for line in fp:
143145
if 'rbe_dir' in line:
@@ -300,6 +302,11 @@ def Main():
300302
env.pop('LIBRARY_PATH', None)
301303
env.pop('SDKROOT', None)
302304

305+
# Help QEMU binfmt work for executables that include dynamic links, such as
306+
# reclient's scandeps_server.
307+
if sys.platform == 'linux':
308+
env['QEMU_LD_PREFIX'] = "/usr/x86_64-linux-gnu/"
309+
303310
# Always run GN before building.
304311
gn_py.RunGnOnConfiguredConfigurations(options, env)
305312

0 commit comments

Comments
 (0)