Allow remote execution of link actions.

This CL adds a remoteexec package that allows adding a configurable RBE
prefix to the template.

Test: built aosp crosshatch userdebug with and without RBE_CXX_LINKS.
Change-Id: Ica920c3d7f79f2996210b9cbd448126451c1707c
This commit is contained in:
Ramy Medhat
2020-04-13 13:21:23 -04:00
parent f472871e00
commit 9a90fe5e23
6 changed files with 305 additions and 11 deletions

View File

@@ -18,6 +18,7 @@ import (
"strings"
"android/soong/android"
"android/soong/remoteexec"
)
var (
@@ -255,6 +256,9 @@ func init() {
}
return ""
})
pctx.VariableFunc("RECXXLinksPool", envOverrideFunc("RBE_CXX_LINKS_POOL", remoteexec.DefaultPool))
pctx.VariableFunc("RECXXLinksExecStrategy", envOverrideFunc("RBE_CXX_LINKS_EXEC_STRATEGY", remoteexec.LocalExecStrategy))
}
var HostPrebuiltTag = pctx.VariableConfigMethod("HostPrebuiltTag", android.Config.PrebuiltOS)
@@ -268,3 +272,12 @@ func bionicHeaders(kernelArch string) string {
"-isystem bionic/libc/kernel/android/uapi",
}, " ")
}
func envOverrideFunc(envVar, defaultVal string) func(ctx android.PackageVarContext) string {
return func(ctx android.PackageVarContext) string {
if override := ctx.Config().Getenv(envVar); override != "" {
return override
}
return defaultVal
}
}