From 4e2977ee81771968a31484a3b7d45e5bb5b8bf1c Mon Sep 17 00:00:00 2001 From: Kousik Kumar Date: Thu, 10 Sep 2020 09:50:35 +0000 Subject: [PATCH] Merge "Check UseRBE is set before replacing any template with the RE version." am: 3e0b9c031c Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1419252 Test: 1. Applied https://googleplex-android-review.git.corp.google.com/c/platform/build/soong/+/15723183, confirmed that the build fails on rvc-dev (by running `USE_RBE=false m `) 2. Subsequently applied this patch and tested to confirm that the failure is fixed (by running `USE_RBE=false m out/soong/.intermediates/vendor/qcom/sm7250/proprietary/commonsys/qcrilOemHook/qcrilmsgtunnel/android_common/combined/qcrilmsgtunnel.jar` and `USE_RBE=true m out/soong/.intermediates/vendor/qcom/sm7250/proprietary/commonsys/qcrilOemHook/qcrilmsgtunnel/android_common/combined/qcrilmsgtunnel.jar`). Bug: b/198045383 Merged-In: I6df58b4e700f0d231367af2710672d731d20a736 Change-Id: I52b7a3810fdf3314ae107f4b8330e9d6f62c6302 (cherry picked from commit f15ed4fe6116a60a9518a8c8ca193da1b4439d62) --- cc/builder.go | 6 +++--- java/builder.go | 2 +- java/dex.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cc/builder.go b/cc/builder.go index 98c58dd84..b5c356078 100644 --- a/cc/builder.go +++ b/cc/builder.go @@ -517,7 +517,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{ @@ -702,7 +702,7 @@ func TransformObjToDynamicBinary(ctx android.ModuleContext, } rule := ld - if ctx.Config().IsEnvTrue("RBE_CXX_LINKS") { + if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_CXX_LINKS") { rule = ldRE } @@ -848,7 +848,7 @@ func TransformObjsToObj(ctx android.ModuleContext, objFiles android.Paths, "ldCmd": ldCmd, "ldFlags": flags.ldFlags, } - 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(), ",") } diff --git a/java/builder.go b/java/builder.go index 0e7574e63..131f21aba 100644 --- a/java/builder.go +++ b/java/builder.go @@ -297,7 +297,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 45fa068d2..2a3cf4900 100644 --- a/java/dex.go +++ b/java/dex.go @@ -204,7 +204,7 @@ func (j *Module) compileDex(ctx android.ModuleContext, flags javaBuilderFlags, "outDict": j.proguardDictionary.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(), ",") } @@ -220,7 +220,7 @@ func (j *Module) compileDex(ctx android.ModuleContext, flags javaBuilderFlags, } else { d8Flags, d8Deps := j.d8Flags(ctx, 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{