allow specifying remote caching opt for rewrapper
This is needed to enable local execution via reproxy for metalava actions for developer builds without causing permissions errors and without disabling it for other actions. Bug: b/308154125 Tested: ran a local build and verified all metalava actions were executed locally without attempting to write to the remote cache. Change-Id: Ia6f616e1ff5d0c71597ebf688765925ac81d19c3
This commit is contained in:
@@ -19,7 +19,6 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/google/blueprint/proptools"
|
"github.com/google/blueprint/proptools"
|
||||||
@@ -500,7 +499,8 @@ func metalavaCmd(ctx android.ModuleContext, rule *android.RuleBuilder, javaVersi
|
|||||||
if metalavaUseRbe(ctx) {
|
if metalavaUseRbe(ctx) {
|
||||||
rule.Remoteable(android.RemoteRuleSupports{RBE: true})
|
rule.Remoteable(android.RemoteRuleSupports{RBE: true})
|
||||||
execStrategy := ctx.Config().GetenvWithDefault("RBE_METALAVA_EXEC_STRATEGY", remoteexec.LocalExecStrategy)
|
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"}
|
labels := map[string]string{"type": "tool", "name": "metalava"}
|
||||||
// TODO: metalava pool rejects these jobs
|
// TODO: metalava pool rejects these jobs
|
||||||
pool := ctx.Config().GetenvWithDefault("RBE_METALAVA_POOL", "java16")
|
pool := ctx.Config().GetenvWithDefault("RBE_METALAVA_POOL", "java16")
|
||||||
@@ -512,6 +512,7 @@ func metalavaCmd(ctx android.ModuleContext, rule *android.RuleBuilder, javaVersi
|
|||||||
Compare: compare,
|
Compare: compare,
|
||||||
NumLocalRuns: 1,
|
NumLocalRuns: 1,
|
||||||
NumRemoteRuns: 1,
|
NumRemoteRuns: 1,
|
||||||
|
NoRemoteUpdateCache: !remoteUpdateCache,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -91,6 +91,8 @@ type REParams struct {
|
|||||||
NumLocalRuns int
|
NumLocalRuns int
|
||||||
// Number of times the action should be rerun remotely.
|
// Number of times the action should be rerun remotely.
|
||||||
NumRemoteRuns int
|
NumRemoteRuns int
|
||||||
|
// Boolean indicating whether to update remote cache entry. Rewrapper defaults to true, so the name is negated here.
|
||||||
|
NoRemoteUpdateCache bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
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)
|
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 {
|
if len(r.Inputs) > 0 {
|
||||||
args += " --inputs=" + strings.Join(r.Inputs, ",")
|
args += " --inputs=" + strings.Join(r.Inputs, ",")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user