summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--android/config.go12
-rw-r--r--android/hooks.go2
-rw-r--r--android/mutator.go2
-rw-r--r--android/package_ctx.go44
-rw-r--r--android/rule_builder.go6
-rw-r--r--android/soong_config_modules.go2
-rw-r--r--android/variable.go3
-rw-r--r--android/variable_test.go6
-rw-r--r--apex/androidmk.go14
-rw-r--r--apex/apex.go3
-rw-r--r--apex/builder.go14
-rw-r--r--bpf/bpf.go2
-rw-r--r--bpfix/bpfix/bpfix.go16
-rw-r--r--bpfix/bpfix/bpfix_test.go31
-rw-r--r--cc/builder.go4
-rw-r--r--cc/config/global.go2
-rw-r--r--java/builder.go2
-rw-r--r--java/config/config.go14
-rw-r--r--java/dex.go8
-rw-r--r--java/dexpreopt_bootjars.go5
-rw-r--r--java/dexpreopt_config.go2
-rw-r--r--java/kotlin.go4
-rw-r--r--ui/build/config.go42
-rw-r--r--ui/build/dumpvars.go2
-rw-r--r--ui/build/ninja.go2
25 files changed, 207 insertions, 37 deletions
diff --git a/android/config.go b/android/config.go
index bab3477ab..3dae6e272 100644
--- a/android/config.go
+++ b/android/config.go
@@ -816,6 +816,18 @@ func (c *config) UseRBE() bool {
return Bool(c.productVariables.UseRBE)
}
+func (c *config) UseRBEJAVAC() bool {
+ return Bool(c.productVariables.UseRBEJAVAC)
+}
+
+func (c *config) UseRBER8() bool {
+ return Bool(c.productVariables.UseRBER8)
+}
+
+func (c *config) UseRBED8() bool {
+ return Bool(c.productVariables.UseRBED8)
+}
+
func (c *config) UseRemoteBuild() bool {
return c.UseGoma() || c.UseRBE()
}
diff --git a/android/hooks.go b/android/hooks.go
index e8cd81b60..47f69d1e8 100644
--- a/android/hooks.go
+++ b/android/hooks.go
@@ -97,7 +97,7 @@ func (l *loadHookContext) CreateModule(factory ModuleFactory, props ...interface
module.base().variableProperties,
// Put an empty copy of the src properties into dst so that properties in src that are not in dst
// don't cause a "failed to find property to extend" error.
- proptools.CloneEmptyProperties(reflect.ValueOf(src).Elem()).Interface(),
+ proptools.CloneEmptyProperties(reflect.ValueOf(src)).Interface(),
}
err := proptools.AppendMatchingProperties(dst, src, nil)
if err != nil {
diff --git a/android/mutator.go b/android/mutator.go
index 3d1bb4f7d..a46d4beb1 100644
--- a/android/mutator.go
+++ b/android/mutator.go
@@ -270,7 +270,7 @@ func (t *topDownMutatorContext) CreateModule(factory ModuleFactory, props ...int
module.base().variableProperties,
// Put an empty copy of the src properties into dst so that properties in src that are not in dst
// don't cause a "failed to find property to extend" error.
- proptools.CloneEmptyProperties(reflect.ValueOf(src).Elem()).Interface(),
+ proptools.CloneEmptyProperties(reflect.ValueOf(src)).Interface(),
}
err := proptools.AppendMatchingProperties(dst, src, nil)
if err != nil {
diff --git a/android/package_ctx.go b/android/package_ctx.go
index 635066767..5a43ea9c7 100644
--- a/android/package_ctx.go
+++ b/android/package_ctx.go
@@ -232,16 +232,32 @@ func (p PackageContext) StaticRule(name string, params blueprint.RuleParams,
}, argNames...)
}
-// RemoteRuleSupports selects if a AndroidRemoteStaticRule supports goma, RBE, or both.
-type RemoteRuleSupports int
+// RBEExperimentalFlag indicates which flag should be set for the AndroidRemoteStaticRule
+// to use RBE.
+type RBEExperimentalFlag int
const (
- SUPPORTS_NONE = 0
- SUPPORTS_GOMA = 1 << iota
- SUPPORTS_RBE = 1 << iota
- SUPPORTS_BOTH = SUPPORTS_GOMA | SUPPORTS_RBE
+ // RBE_NOT_EXPERIMENTAL indicates the rule should use RBE in every build that has
+ // UseRBE set.
+ RBE_NOT_EXPERIMENTAL RBEExperimentalFlag = iota
+ // RBE_JAVAC indicates the rule should use RBE only if the RBE_JAVAC variable is
+ // set in an RBE enabled build.
+ RBE_JAVAC
+ // RBE_R8 indicates the rule should use RBE only if the RBE_R8 variable is set in
+ // an RBE enabled build.
+ RBE_R8
+ // RBE_D8 indicates the rule should use RBE only if the RBE_D8 variable is set in
+ // an RBE enabled build.
+ RBE_D8
)
+// RemoteRuleSupports configures rules with whether they have Goma and/or RBE support.
+type RemoteRuleSupports struct {
+ Goma bool
+ RBE bool
+ RBEFlag RBEExperimentalFlag
+}
+
// AndroidRemoteStaticRule wraps blueprint.StaticRule but uses goma or RBE's parallelism if goma or RBE are enabled
// and the appropriate SUPPORTS_* flag is set.
func (p PackageContext) AndroidRemoteStaticRule(name string, supports RemoteRuleSupports, params blueprint.RuleParams,
@@ -249,18 +265,30 @@ func (p PackageContext) AndroidRemoteStaticRule(name string, supports RemoteRule
return p.PackageContext.RuleFunc(name, func(config interface{}) (blueprint.RuleParams, error) {
ctx := &configErrorWrapper{p, config.(Config), nil}
- if ctx.Config().UseGoma() && supports&SUPPORTS_GOMA == 0 {
+ if ctx.Config().UseGoma() && !supports.Goma {
// When USE_GOMA=true is set and the rule is not supported by goma, restrict jobs to the
// local parallelism value
params.Pool = localPool
}
- if ctx.Config().UseRBE() && supports&SUPPORTS_RBE == 0 {
+ if ctx.Config().UseRBE() && !supports.RBE {
// When USE_RBE=true is set and the rule is not supported by RBE, restrict jobs to the
// local parallelism value
params.Pool = localPool
}
+ if ctx.Config().UseRBE() && supports.RBE {
+ if supports.RBEFlag == RBE_JAVAC && !ctx.Config().UseRBEJAVAC() {
+ params.Pool = localPool
+ }
+ if supports.RBEFlag == RBE_R8 && !ctx.Config().UseRBER8() {
+ params.Pool = localPool
+ }
+ if supports.RBEFlag == RBE_D8 && !ctx.Config().UseRBED8() {
+ params.Pool = localPool
+ }
+ }
+
return params, nil
}, argNames...)
}
diff --git a/android/rule_builder.go b/android/rule_builder.go
index 928ba532d..b4f144a0d 100644
--- a/android/rule_builder.go
+++ b/android/rule_builder.go
@@ -417,10 +417,10 @@ func (r *RuleBuilder) Build(pctx PackageContext, ctx BuilderContext, name string
}
var pool blueprint.Pool
- if ctx.Config().UseGoma() && r.remoteable&SUPPORTS_GOMA != 0 {
+ if ctx.Config().UseGoma() && r.remoteable.Goma {
// When USE_GOMA=true is set and the rule is supported by goma, allow jobs to run outside the local pool.
- } else if ctx.Config().UseRBE() && r.remoteable&SUPPORTS_RBE != 0 {
- // When USE_GOMA=true is set and the rule is supported by RBE, allow jobs to run outside the local pool.
+ } else if ctx.Config().UseRBE() && r.remoteable.RBE {
+ // When USE_RBE=true is set and the rule is supported by RBE, allow jobs to run outside the local pool.
} else if r.highmem {
pool = highmemPool
} else if ctx.Config().UseRemoteBuild() {
diff --git a/android/soong_config_modules.go b/android/soong_config_modules.go
index bdec64b8c..3e5595849 100644
--- a/android/soong_config_modules.go
+++ b/android/soong_config_modules.go
@@ -351,7 +351,7 @@ func soongConfigModuleFactory(factory blueprint.ModuleFactory,
return func() (blueprint.Module, []interface{}) {
module, props := factory()
- conditionalProps := proptools.CloneEmptyProperties(conditionalFactoryProps.Elem())
+ conditionalProps := proptools.CloneEmptyProperties(conditionalFactoryProps)
props = append(props, conditionalProps.Interface())
AddLoadHook(module, func(ctx LoadHookContext) {
diff --git a/android/variable.go b/android/variable.go
index 74734913b..cc42766f5 100644
--- a/android/variable.go
+++ b/android/variable.go
@@ -204,6 +204,9 @@ type productVariables struct {
Binder32bit *bool `json:",omitempty"`
UseGoma *bool `json:",omitempty"`
UseRBE *bool `json:",omitempty"`
+ UseRBEJAVAC *bool `json:",omitempty"`
+ UseRBER8 *bool `json:",omitempty"`
+ UseRBED8 *bool `json:",omitempty"`
Debuggable *bool `json:",omitempty"`
Eng *bool `json:",omitempty"`
Treble_linker_namespaces *bool `json:",omitempty"`
diff --git a/android/variable_test.go b/android/variable_test.go
index 751677fb0..cde2b1ac9 100644
--- a/android/variable_test.go
+++ b/android/variable_test.go
@@ -159,15 +159,15 @@ func testProductVariableModuleFactoryFactory(props interface{}) func() Module {
func TestProductVariables(t *testing.T) {
ctx := NewTestContext()
// A module type that has a srcs property but not a cflags property.
- ctx.RegisterModuleType("module1", testProductVariableModuleFactoryFactory(struct {
+ ctx.RegisterModuleType("module1", testProductVariableModuleFactoryFactory(&struct {
Srcs []string
}{}))
// A module type that has a cflags property but not a srcs property.
- ctx.RegisterModuleType("module2", testProductVariableModuleFactoryFactory(struct {
+ ctx.RegisterModuleType("module2", testProductVariableModuleFactoryFactory(&struct {
Cflags []string
}{}))
// A module type that does not have any properties that match product_variables.
- ctx.RegisterModuleType("module3", testProductVariableModuleFactoryFactory(struct {
+ ctx.RegisterModuleType("module3", testProductVariableModuleFactoryFactory(&struct {
Foo []string
}{}))
ctx.PreDepsMutators(func(ctx RegisterMutatorsContext) {
diff --git a/apex/androidmk.go b/apex/androidmk.go
index 5fa5bf062..8cb989693 100644
--- a/apex/androidmk.go
+++ b/apex/androidmk.go
@@ -112,6 +112,11 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, apexName, moduleDir string)
}
} else {
fmt.Fprintln(w, "LOCAL_MODULE_PATH :=", pathWhenActivated)
+
+ // For non-flattend APEXes, the merged notice file is attached to the APEX itself.
+ // We don't need to have notice file for the individual modules in it. Otherwise,
+ // we will have duplicated notice entries.
+ fmt.Fprintln(w, "LOCAL_NO_NOTICE_FILE := true")
}
fmt.Fprintln(w, "LOCAL_PREBUILT_MODULE_FILE :=", fi.builtFile.String())
fmt.Fprintln(w, "LOCAL_MODULE_CLASS :=", fi.class.NameInMake())
@@ -177,7 +182,7 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, apexName, moduleDir string)
fmt.Fprintln(w, "include $(BUILD_SYSTEM)/soong_cc_prebuilt.mk")
} else {
fmt.Fprintln(w, "LOCAL_MODULE_STEM :=", fi.builtFile.Base())
- if fi.builtFile == a.manifestPbOut {
+ if fi.builtFile == a.manifestPbOut && apexType == flattenedApex {
if a.primaryApexType {
// Make apex_manifest.pb module for this APEX to override all other
// modules in the APEXes being overridden by this APEX
@@ -187,7 +192,7 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, apexName, moduleDir string)
}
fmt.Fprintln(w, "LOCAL_OVERRIDES_MODULES :=", strings.Join(patterns, " "))
- if apexType == flattenedApex && len(a.compatSymlinks) > 0 {
+ if len(a.compatSymlinks) > 0 {
// For flattened apexes, compat symlinks are attached to apex_manifest.json which is guaranteed for every apex
postInstallCommands = append(postInstallCommands, a.compatSymlinks...)
}
@@ -271,6 +276,11 @@ func (a *apexBundle) androidMkForType() android.AndroidMkData {
if len(postInstallCommands) > 0 {
fmt.Fprintln(w, "LOCAL_POST_INSTALL_CMD :=", strings.Join(postInstallCommands, " && "))
}
+
+ if a.mergedNotices.Merged.Valid() {
+ fmt.Fprintln(w, "LOCAL_NOTICE_FILE :=", a.mergedNotices.Merged.Path().String())
+ }
+
fmt.Fprintln(w, "include $(BUILD_PREBUILT)")
if apexType == imageApex {
diff --git a/apex/apex.go b/apex/apex.go
index f925066d4..ae9379093 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -818,6 +818,9 @@ type apexBundle struct {
// Whether to create symlink to the system file instead of having a file
// inside the apex or not
linkToSystemLib bool
+
+ // Struct holding the merged notice file paths in different formats
+ mergedNotices android.NoticeOutputs
}
func addDependenciesForNativeModules(ctx android.BottomUpMutatorContext,
diff --git a/apex/builder.go b/apex/builder.go
index f245ca7ed..53f39a65b 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -211,7 +211,7 @@ func (a *apexBundle) buildManifest(ctx android.ModuleContext, provideNativeLibs,
})
}
-func (a *apexBundle) buildNoticeFile(ctx android.ModuleContext, apexFileName string) android.OptionalPath {
+func (a *apexBundle) buildNoticeFiles(ctx android.ModuleContext, apexFileName string) android.NoticeOutputs {
noticeFiles := []android.Path{}
for _, f := range a.filesInfo {
if f.module != nil {
@@ -227,10 +227,10 @@ func (a *apexBundle) buildNoticeFile(ctx android.ModuleContext, apexFileName str
}
if len(noticeFiles) == 0 {
- return android.OptionalPath{}
+ return android.NoticeOutputs{}
}
- return android.BuildNoticeOutput(ctx, a.installDir, apexFileName, android.FirstUniquePaths(noticeFiles)).HtmlGzOutput
+ return android.BuildNoticeOutput(ctx, a.installDir, apexFileName, android.FirstUniquePaths(noticeFiles))
}
func (a *apexBundle) buildInstalledFilesFile(ctx android.ModuleContext, builtApex android.Path, imageDir android.Path) android.OutputPath {
@@ -394,11 +394,11 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
optFlags = append(optFlags, "--target_sdk_version "+targetSdkVersion)
optFlags = append(optFlags, "--min_sdk_version "+minSdkVersion)
- noticeFile := a.buildNoticeFile(ctx, a.Name()+suffix)
- if noticeFile.Valid() {
+ a.mergedNotices = a.buildNoticeFiles(ctx, a.Name()+suffix)
+ if a.mergedNotices.HtmlGzOutput.Valid() {
// If there's a NOTICE file, embed it as an asset file in the APEX.
- implicitInputs = append(implicitInputs, noticeFile.Path())
- optFlags = append(optFlags, "--assets_dir "+filepath.Dir(noticeFile.String()))
+ implicitInputs = append(implicitInputs, a.mergedNotices.HtmlGzOutput.Path())
+ optFlags = append(optFlags, "--assets_dir "+filepath.Dir(a.mergedNotices.HtmlGzOutput.String()))
}
if ctx.ModuleDir() != "system/apex/apexd/apexd_testdata" && ctx.ModuleDir() != "system/apex/shim/build" && a.testOnlyShouldSkipHashtreeGeneration() {
diff --git a/bpf/bpf.go b/bpf/bpf.go
index 024fcbccc..1d792ef1f 100644
--- a/bpf/bpf.go
+++ b/bpf/bpf.go
@@ -33,7 +33,7 @@ func init() {
var (
pctx = android.NewPackageContext("android/soong/bpf")
- ccRule = pctx.AndroidRemoteStaticRule("ccRule", android.SUPPORTS_GOMA,
+ ccRule = pctx.AndroidRemoteStaticRule("ccRule", android.RemoteRuleSupports{Goma: true},
blueprint.RuleParams{
Depfile: "${out}.d",
Deps: blueprint.DepsGCC,
diff --git a/bpfix/bpfix/bpfix.go b/bpfix/bpfix/bpfix.go
index 4633aa64d..051627977 100644
--- a/bpfix/bpfix/bpfix.go
+++ b/bpfix/bpfix/bpfix.go
@@ -120,6 +120,10 @@ var fixSteps = []FixStep{
Name: "removeEmptyLibDependencies",
Fix: removeEmptyLibDependencies,
},
+ {
+ Name: "removeHidlInterfaceTypes",
+ Fix: removeHidlInterfaceTypes,
+ },
}
func NewFixRequest() FixRequest {
@@ -698,6 +702,18 @@ func removeEmptyLibDependencies(f *Fixer) error {
return nil
}
+// Removes hidl_interface 'types' which are no longer needed
+func removeHidlInterfaceTypes(f *Fixer) error {
+ for _, def := range f.tree.Defs {
+ mod, ok := def.(*parser.Module)
+ if !(ok && mod.Type == "hidl_interface") {
+ continue
+ }
+ removeProperty(mod, "types")
+ }
+ return nil
+}
+
// Converts the default source list property, 'srcs', to a single source property with a given name.
// "LOCAL_MODULE" reference is also resolved during the conversion process.
func convertToSingleSource(mod *parser.Module, srcPropertyName string) {
diff --git a/bpfix/bpfix/bpfix_test.go b/bpfix/bpfix/bpfix_test.go
index 032282f84..38cefdd6b 100644
--- a/bpfix/bpfix/bpfix_test.go
+++ b/bpfix/bpfix/bpfix_test.go
@@ -887,3 +887,34 @@ func TestRemoveEmptyLibDependencies(t *testing.T) {
})
}
}
+
+func TestRemoveHidlInterfaceTypes(t *testing.T) {
+ tests := []struct {
+ name string
+ in string
+ out string
+ }{
+ {
+ name: "remove types",
+ in: `
+ hidl_interface {
+ name: "foo@1.0",
+ types: ["ParcelFooBar"],
+ }
+ `,
+ out: `
+ hidl_interface {
+ name: "foo@1.0",
+
+ }
+ `,
+ },
+ }
+ for _, test := range tests {
+ t.Run(test.name, func(t *testing.T) {
+ runPass(t, test.in, test.out, func(fixer *Fixer) error {
+ return removeHidlInterfaceTypes(fixer)
+ })
+ })
+ }
+}
diff --git a/cc/builder.go b/cc/builder.go
index 5f0da5ff7..b05ca5bdd 100644
--- a/cc/builder.go
+++ b/cc/builder.go
@@ -46,7 +46,7 @@ var (
var (
pctx = android.NewPackageContext("android/soong/cc")
- cc = pctx.AndroidRemoteStaticRule("cc", android.SUPPORTS_BOTH,
+ cc = pctx.AndroidRemoteStaticRule("cc", android.RemoteRuleSupports{Goma: true, RBE: true},
blueprint.RuleParams{
Depfile: "${out}.d",
Deps: blueprint.DepsGCC,
@@ -55,7 +55,7 @@ var (
},
"ccCmd", "cFlags")
- ccNoDeps = pctx.AndroidRemoteStaticRule("ccNoDeps", android.SUPPORTS_GOMA,
+ ccNoDeps = pctx.AndroidRemoteStaticRule("ccNoDeps", android.RemoteRuleSupports{Goma: true},
blueprint.RuleParams{
Command: "$relPwd ${config.CcWrapper}$ccCmd -c $cFlags -o $out $in",
CommandDeps: []string{"$ccCmd"},
diff --git a/cc/config/global.go b/cc/config/global.go
index 87314dc1a..44de4d571 100644
--- a/cc/config/global.go
+++ b/cc/config/global.go
@@ -166,6 +166,8 @@ func init() {
flags = append(flags, "-ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang")
} else if ctx.Config().IsEnvTrue("AUTO_PATTERN_INITIALIZE") {
flags = append(flags, "-ftrivial-auto-var-init=pattern")
+ } else if ctx.Config().IsEnvTrue("AUTO_UNINITIALIZE") {
+ flags = append(flags, "-ftrivial-auto-var-init=uninitialized")
}
return strings.Join(flags, " ")
diff --git a/java/builder.go b/java/builder.go
index 26a49ea53..f9b53674d 100644
--- a/java/builder.go
+++ b/java/builder.go
@@ -38,7 +38,7 @@ var (
// this, all java rules write into separate directories and then are combined into a .jar file
// (if the rule produces .class files) or a .srcjar file (if the rule produces .java files).
// .srcjar files are unzipped into a temporary directory when compiled with javac.
- javac = pctx.AndroidRemoteStaticRule("javac", android.SUPPORTS_GOMA,
+ javac = pctx.AndroidRemoteStaticRule("javac", android.RemoteRuleSupports{Goma: true, RBE: true, RBEFlag: android.RBE_JAVAC},
blueprint.RuleParams{
Command: `rm -rf "$outDir" "$annoDir" "$srcJarDir" && mkdir -p "$outDir" "$annoDir" "$srcJarDir" && ` +
`${config.ZipSyncCmd} -d $srcJarDir -l $srcJarDir/list -f "*.java" $srcJars && ` +
diff --git a/java/config/config.go b/java/config/config.go
index 6da7279c3..7f446e5db 100644
--- a/java/config/config.go
+++ b/java/config/config.go
@@ -148,6 +148,20 @@ func init() {
return ""
})
+ pctx.VariableFunc("R8Wrapper", func(ctx android.PackageVarContext) string {
+ if override := ctx.Config().Getenv("R8_WRAPPER"); override != "" {
+ return override + " "
+ }
+ return ""
+ })
+
+ pctx.VariableFunc("D8Wrapper", func(ctx android.PackageVarContext) string {
+ if override := ctx.Config().Getenv("D8_WRAPPER"); override != "" {
+ return override + " "
+ }
+ return ""
+ })
+
pctx.HostJavaToolVariable("JacocoCLIJar", "jacoco-cli.jar")
pctx.HostBinToolVariable("ManifestCheckCmd", "manifest_check")
diff --git a/java/dex.go b/java/dex.go
index ed4dfcf82..6afdb6dc4 100644
--- a/java/dex.go
+++ b/java/dex.go
@@ -22,10 +22,10 @@ import (
"android/soong/android"
)
-var d8 = pctx.AndroidStaticRule("d8",
+var d8 = pctx.AndroidRemoteStaticRule("d8", android.RemoteRuleSupports{RBE: true, RBEFlag: android.RBE_D8},
blueprint.RuleParams{
Command: `rm -rf "$outDir" && mkdir -p "$outDir" && ` +
- `${config.D8Cmd} ${config.DexFlags} --output $outDir $d8Flags $in && ` +
+ `${config.D8Wrapper}${config.D8Cmd} ${config.DexFlags} --output $outDir $d8Flags $in && ` +
`${config.SoongZipCmd} $zipFlags -o $outDir/classes.dex.jar -C $outDir -f "$outDir/classes*.dex" && ` +
`${config.MergeZipsCmd} -D -stripFile "**/*.class" $out $outDir/classes.dex.jar $in`,
CommandDeps: []string{
@@ -36,11 +36,11 @@ var d8 = pctx.AndroidStaticRule("d8",
},
"outDir", "d8Flags", "zipFlags")
-var r8 = pctx.AndroidStaticRule("r8",
+var r8 = pctx.AndroidRemoteStaticRule("r8", android.RemoteRuleSupports{RBE: true, RBEFlag: android.RBE_R8},
blueprint.RuleParams{
Command: `rm -rf "$outDir" && mkdir -p "$outDir" && ` +
`rm -f "$outDict" && ` +
- `${config.R8Cmd} ${config.DexFlags} -injars $in --output $outDir ` +
+ `${config.R8Wrapper}${config.R8Cmd} ${config.DexFlags} -injars $in --output $outDir ` +
`--force-proguard-compatibility ` +
`--no-data-resources ` +
`-printmapping $outDict ` +
diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go
index c6aa7fe0d..87f6d5e33 100644
--- a/java/dexpreopt_bootjars.go
+++ b/java/dexpreopt_bootjars.go
@@ -88,6 +88,9 @@ type bootImageConfig struct {
images map[android.ArchType]android.OutputPath // first image file
imagesDeps map[android.ArchType]android.OutputPaths // all files
+ // Only for extensions, paths to the primary boot images (grouped by target).
+ primaryImages map[android.ArchType]android.OutputPath
+
// File path to a zip archive with all image files (or nil, if not needed).
zip android.WritablePath
}
@@ -355,7 +358,7 @@ func buildBootImageRuleForArch(ctx android.SingletonContext, image *bootImage,
}
if image.extension {
- artImage := artBootImageConfig(ctx).images[arch]
+ artImage := image.primaryImages[arch]
cmd.
Flag("--runtime-arg").FlagWithInputList("-Xbootclasspath:", image.dexPathsDeps.Paths(), ":").
Flag("--runtime-arg").FlagWithList("-Xbootclasspath-locations:", image.dexLocationsDeps, ":").
diff --git a/java/dexpreopt_config.go b/java/dexpreopt_config.go
index 31bec93eb..637a32f0a 100644
--- a/java/dexpreopt_config.go
+++ b/java/dexpreopt_config.go
@@ -246,10 +246,12 @@ func genBootImageConfigs(ctx android.PathContext) map[string]*bootImageConfig {
// specific to the framework config
frameworkCfg.dexPathsDeps = append(artCfg.dexPathsDeps, frameworkCfg.dexPathsDeps...)
+ frameworkCfg.primaryImages = artCfg.images
frameworkCfg.imageLocations = append(artCfg.imageLocations, frameworkCfg.imageLocations...)
// specific to the jitzygote-framework config
frameworkJZCfg.dexPathsDeps = append(artJZCfg.dexPathsDeps, frameworkJZCfg.dexPathsDeps...)
+ frameworkJZCfg.primaryImages = artJZCfg.images
frameworkJZCfg.imageLocations = append(artJZCfg.imageLocations, frameworkJZCfg.imageLocations...)
return configs
diff --git a/java/kotlin.go b/java/kotlin.go
index 5319a4ff9..cb7da20f8 100644
--- a/java/kotlin.go
+++ b/java/kotlin.go
@@ -26,7 +26,7 @@ import (
"github.com/google/blueprint"
)
-var kotlinc = pctx.AndroidRemoteStaticRule("kotlinc", android.SUPPORTS_GOMA,
+var kotlinc = pctx.AndroidRemoteStaticRule("kotlinc", android.RemoteRuleSupports{Goma: true},
blueprint.RuleParams{
Command: `rm -rf "$classesDir" "$srcJarDir" "$kotlinBuildFile" "$emptyDir" && ` +
`mkdir -p "$classesDir" "$srcJarDir" "$emptyDir" && ` +
@@ -88,7 +88,7 @@ func kotlinCompile(ctx android.ModuleContext, outputFile android.WritablePath,
})
}
-var kapt = pctx.AndroidRemoteStaticRule("kapt", android.SUPPORTS_GOMA,
+var kapt = pctx.AndroidRemoteStaticRule("kapt", android.RemoteRuleSupports{Goma: true},
blueprint.RuleParams{
Command: `rm -rf "$srcJarDir" "$kotlinBuildFile" "$kaptDir" && mkdir -p "$srcJarDir" "$kaptDir" && ` +
`${config.ZipSyncCmd} -d $srcJarDir -l $srcJarDir/list -f "*.java" $srcJars && ` +
diff --git a/ui/build/config.go b/ui/build/config.go
index 9b19ede3a..5b9d10aa9 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -787,6 +787,48 @@ func (c *configImpl) UseRBE() bool {
return false
}
+func (c *configImpl) UseRBEJAVAC() bool {
+ if !c.UseRBE() {
+ return false
+ }
+
+ if v, ok := c.environ.Get("RBE_JAVAC"); ok {
+ v = strings.TrimSpace(v)
+ if v != "" && v != "false" {
+ return true
+ }
+ }
+ return false
+}
+
+func (c *configImpl) UseRBER8() bool {
+ if !c.UseRBE() {
+ return false
+ }
+
+ if v, ok := c.environ.Get("RBE_R8"); ok {
+ v = strings.TrimSpace(v)
+ if v != "" && v != "false" {
+ return true
+ }
+ }
+ return false
+}
+
+func (c *configImpl) UseRBED8() bool {
+ if !c.UseRBE() {
+ return false
+ }
+
+ if v, ok := c.environ.Get("RBE_D8"); ok {
+ v = strings.TrimSpace(v)
+ if v != "" && v != "false" {
+ return true
+ }
+ }
+ return false
+}
+
func (c *configImpl) StartRBE() bool {
if !c.UseRBE() {
return false
diff --git a/ui/build/dumpvars.go b/ui/build/dumpvars.go
index c3da38bcd..ce8f968d7 100644
--- a/ui/build/dumpvars.go
+++ b/ui/build/dumpvars.go
@@ -191,6 +191,8 @@ func runMakeProductConfig(ctx Context, config Config) {
"CC_WRAPPER",
"CXX_WRAPPER",
"JAVAC_WRAPPER",
+ "R8_WRAPPER",
+ "D8_WRAPPER",
// ccache settings
"CCACHE_COMPILERCHECK",
diff --git a/ui/build/ninja.go b/ui/build/ninja.go
index 0b56b6711..22ec1f171 100644
--- a/ui/build/ninja.go
+++ b/ui/build/ninja.go
@@ -133,6 +133,8 @@ func runNinja(ctx Context, config Config) {
"FLAG_invocation_id",
"FLAG_log_dir",
"FLAG_platform",
+ "FLAG_remote_accept_cache",
+ "FLAG_remote_update_cache",
"FLAG_server_address",
// ccache settings