Skip to content

Commit 70a4231

Browse files
authored
Adds RBE local and remote wrappers for Linux and Android (#854)
For flutter/flutter#147750. This change also disables remote linking in anticipation of changing to differently sized workers in the worker pool. Validated in flutter/engine#52675.
1 parent b55755a commit 70a4231

File tree

2 files changed

+28
-8
lines changed

2 files changed

+28
-8
lines changed

build/toolchain/android/BUILD.gn

+18-4
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,26 @@ template("android_toolchain") {
4444
compiler_prefix = "$goma_dir/gomacc "
4545
link_prefix = "$goma_dir/gomacc "
4646
} else if (use_rbe) {
47-
compiler_args =
48-
rewrapper_command + [ "--labels=type=compile,compiler=clang,lang=cpp " ]
49-
link_args = rewrapper_command + [ "--labels=type=link,tool=clang " ]
47+
remote_wrapper = ""
48+
if (host_os == "linux") {
49+
remote_wrapper =
50+
rebase_path("//flutter/build/rbe/remote_wrapper_linux.sh", root_build_dir)
51+
} else if (host_os == "mac") {
52+
remote_wrapper =
53+
rebase_path("//flutter/build/rbe/remote_wrapper.sh", root_build_dir)
54+
} else {
55+
assert(false, "Unknown host")
56+
}
57+
local_wrapper =
58+
rebase_path("//flutter/build/rbe/local_wrapper.sh", root_build_dir)
59+
compiler_args = rewrapper_command + [
60+
"--remote_wrapper=$remote_wrapper",
61+
"--local_wrapper=$local_wrapper",
62+
"--labels=type=compile,compiler=clang,lang=cpp ",
63+
]
5064
assembler_prefix = ""
5165
compiler_prefix = string_join(" ", compiler_args)
52-
link_prefix = string_join(" ", link_args)
66+
link_prefix = ""
5367
} else if (use_ccache) {
5468
assembler_prefix = "ccache "
5569
compiler_prefix = "ccache "

build/toolchain/linux/BUILD.gn

+10-4
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,17 @@ if (use_goma) {
1919
compiler_prefix = "$goma_dir/gomacc "
2020
link_prefix = "$goma_dir/gomacc "
2121
} else if (use_rbe) {
22-
compiler_args =
23-
rewrapper_command + [ "--labels=type=compile,compiler=clang,lang=cpp " ]
24-
link_args = rewrapper_command + [ "--labels=type=link,tool=clang " ]
22+
remote_wrapper =
23+
rebase_path("//flutter/build/rbe/remote_wrapper_linux.sh", root_build_dir)
24+
local_wrapper =
25+
rebase_path("//flutter/build/rbe/local_wrapper.sh", root_build_dir)
26+
compiler_args = rewrapper_command + [
27+
"--remote_wrapper=$remote_wrapper",
28+
"--local_wrapper=$local_wrapper",
29+
"--labels=type=compile,compiler=clang,lang=cpp ",
30+
]
2531
compiler_prefix = string_join(" ", compiler_args)
26-
link_prefix = string_join(" ", link_args)
32+
link_prefix = ""
2733
} else if (use_ccache) {
2834
compiler_prefix = "ccache "
2935
link_prefix = "ccache "

0 commit comments

Comments
 (0)