diff --git a/cc/builder.go b/cc/builder.go index 5deb1299e..7b66b102f 100644 --- a/cc/builder.go +++ b/cc/builder.go @@ -584,7 +584,7 @@ func TransformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles and sAbiDumpFiles = append(sAbiDumpFiles, sAbiDumpFile) dumpRule := sAbiDump - if ctx.Config().IsEnvTrue("RBE_ABI_DUMPER") { + if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_ABI_DUMPER") { dumpRule = sAbiDumpRE } ctx.Build(pctx, android.BuildParams{ @@ -700,7 +700,7 @@ func TransformObjToDynamicBinary(ctx android.ModuleContext, "ldFlags": flags.globalLdFlags + " " + flags.localLdFlags, "crtEnd": crtEnd.String(), } - if ctx.Config().IsEnvTrue("RBE_CXX_LINKS") { + if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_CXX_LINKS") { rule = ldRE args["implicitOutputs"] = strings.Join(implicitOutputs.Strings(), ",") args["implicitInputs"] = strings.Join(deps.Strings(), ",") @@ -858,7 +858,7 @@ func TransformObjsToObj(ctx android.ModuleContext, objFiles android.Paths, "ldCmd": ldCmd, "ldFlags": flags.globalLdFlags + " " + flags.localLdFlags, } - if ctx.Config().IsEnvTrue("RBE_CXX_LINKS") { + if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_CXX_LINKS") { rule = partialLdRE args["inCommaList"] = strings.Join(objFiles.Strings(), ",") args["implicitInputs"] = strings.Join(deps.Strings(), ",") diff --git a/java/builder.go b/java/builder.go index 7318fcbad..53f08101b 100644 --- a/java/builder.go +++ b/java/builder.go @@ -452,7 +452,7 @@ func transformJavaToClasses(ctx android.ModuleContext, outputFile android.Writab annoDir = filepath.Join(shardDir, annoDir) } rule := javac - if ctx.Config().IsEnvTrue("RBE_JAVAC") { + if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_JAVAC") { rule = javacRE } ctx.Build(pctx, android.BuildParams{ diff --git a/java/dex.go b/java/dex.go index dba283696..a0a313d69 100644 --- a/java/dex.go +++ b/java/dex.go @@ -288,7 +288,7 @@ func (d *dexer) compileDex(ctx android.ModuleContext, flags javaBuilderFlags, mi "outUsageZip": proguardUsageZip.String(), "outDir": outDir.String(), } - if ctx.Config().IsEnvTrue("RBE_R8") { + if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_R8") { rule = r8RE args["implicits"] = strings.Join(r8Deps.Strings(), ",") } @@ -304,7 +304,7 @@ func (d *dexer) compileDex(ctx android.ModuleContext, flags javaBuilderFlags, mi } else { d8Flags, d8Deps := d8Flags(flags) rule := d8 - if ctx.Config().IsEnvTrue("RBE_D8") { + if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_D8") { rule = d8RE } ctx.Build(pctx, android.BuildParams{