[infra] Enable RBE on Android.

The sysroot needs to be passed as a relative path inside the exec root
since RBE will fail to compile with an absolute path.

Bug: b/296994239
Change-Id: Idc0e155368daaf904ac4650bd8668b8955d09e28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338002
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
This commit is contained in:
Jonas Termansen 2023-11-24 14:02:27 +00:00 committed by Commit Queue
parent 1ff56282ce
commit 750050ec40
2 changed files with 15 additions and 1 deletions

View file

@ -49,7 +49,7 @@ if ((current_toolchain == host_toolchain ||
sysroot = target_sysroot
} else if (is_android) {
import("//build/config/android/config.gni")
sysroot = rebase_path("$android_toolchain_root/sysroot")
sysroot = rebase_path("$android_toolchain_root/sysroot", root_build_dir)
} else if (is_mac) {
import("//build/config/mac/mac_sdk.gni")
sysroot = mac_sdk_path

View file

@ -25,6 +25,20 @@ template("android_toolchain") {
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 "