summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Anas Sulaiman <mrahs@google.com> 2023-11-29 16:36:21 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2023-11-29 16:36:21 +0000
commit80117e6c4fc10412f9a313eb6391546e2da3ee1a (patch)
treed2ceae94703e04d76f4341508b5ef8504792a56c
parent0fd71d0232752c1827a317cec8c67b686d8e1947 (diff)
parent9d7a36d17f35ebf45679a6434a2143fd3d1a24ba (diff)
Merge "allow specifying remote caching opt for rewrapper" into main
-rw-r--r--java/droidstubs.go19
-rw-r--r--remoteexec/remoteexec.go6
2 files changed, 16 insertions, 9 deletions
diff --git a/java/droidstubs.go b/java/droidstubs.go
index 180ba92cf..6b8d21f8c 100644
--- a/java/droidstubs.go
+++ b/java/droidstubs.go
@@ -19,7 +19,6 @@ import (
"path/filepath"
"regexp"
"sort"
- "strconv"
"strings"
"github.com/google/blueprint/proptools"
@@ -500,18 +499,20 @@ func metalavaCmd(ctx android.ModuleContext, rule *android.RuleBuilder, javaVersi
if metalavaUseRbe(ctx) {
rule.Remoteable(android.RemoteRuleSupports{RBE: true})
execStrategy := ctx.Config().GetenvWithDefault("RBE_METALAVA_EXEC_STRATEGY", remoteexec.LocalExecStrategy)
- compare, _ := strconv.ParseBool(ctx.Config().GetenvWithDefault("RBE_METALAVA_COMPARE", "false"))
+ compare := ctx.Config().IsEnvTrue("RBE_METALAVA_COMPARE")
+ remoteUpdateCache := !ctx.Config().IsEnvFalse("RBE_METALAVA_REMOTE_UPDATE_CACHE")
labels := map[string]string{"type": "tool", "name": "metalava"}
// TODO: metalava pool rejects these jobs
pool := ctx.Config().GetenvWithDefault("RBE_METALAVA_POOL", "java16")
rule.Rewrapper(&remoteexec.REParams{
- Labels: labels,
- ExecStrategy: execStrategy,
- ToolchainInputs: []string{config.JavaCmd(ctx).String()},
- Platform: map[string]string{remoteexec.PoolKey: pool},
- Compare: compare,
- NumLocalRuns: 1,
- NumRemoteRuns: 1,
+ Labels: labels,
+ ExecStrategy: execStrategy,
+ ToolchainInputs: []string{config.JavaCmd(ctx).String()},
+ Platform: map[string]string{remoteexec.PoolKey: pool},
+ Compare: compare,
+ NumLocalRuns: 1,
+ NumRemoteRuns: 1,
+ NoRemoteUpdateCache: !remoteUpdateCache,
})
}
diff --git a/remoteexec/remoteexec.go b/remoteexec/remoteexec.go
index 1e181fb17..8294c3fa3 100644
--- a/remoteexec/remoteexec.go
+++ b/remoteexec/remoteexec.go
@@ -91,6 +91,8 @@ type REParams struct {
NumLocalRuns int
// Number of times the action should be rerun remotely.
NumRemoteRuns int
+ // Boolean indicating whether to update remote cache entry. Rewrapper defaults to true, so the name is negated here.
+ NoRemoteUpdateCache bool
}
func init() {
@@ -146,6 +148,10 @@ func (r *REParams) wrapperArgs() string {
args += fmt.Sprintf(" --compare=true --num_local_reruns=%d --num_remote_reruns=%d", r.NumLocalRuns, r.NumRemoteRuns)
}
+ if r.NoRemoteUpdateCache {
+ args += " --remote_update_cache=false"
+ }
+
if len(r.Inputs) > 0 {
args += " --inputs=" + strings.Join(r.Inputs, ",")
}