Merge aconfig files per-module
Passing the list of all transitive aconfig files to Make causes extra
Kati analysis runs when dependencies are changed in Android.bp files.
Since Make is going to merge them anyways, merge them per-module and
pass a single aconfig file to Make for each module.
Fixes: 313698230
Test: m out/target/product/vsoc_x86_64/system/etc/aconfig_flags.pb
Change-Id: Ifde4826bc93bc06e40338f72b4cb39eed26ca08d
diff --git a/cc/androidmk.go b/cc/androidmk.go
index 224ea96..8cae634 100644
--- a/cc/androidmk.go
+++ b/cc/androidmk.go
@@ -134,7 +134,7 @@
"$(SOONG_SDK_VARIANT_MODULES) $(patsubst %.sdk,%,$(LOCAL_MODULE))")
}
// TODO(b/311155208): The container here should be system.
- entries.SetOptionalPaths("LOCAL_ACONFIG_FILES", c.getTransitiveAconfigFiles(""))
+ entries.SetPaths("LOCAL_ACONFIG_FILES", c.mergedAconfigFiles[""])
},
},
ExtraFooters: []android.AndroidMkExtraFootersFunc{
diff --git a/cc/cc.go b/cc/cc.go
index 5d4ceb8..f800dc0 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -928,7 +928,7 @@
hideApexVariantFromMake bool
// Aconfig files for all transitive deps. Also exposed via TransitiveDeclarationsInfo
- transitiveAconfigFiles map[string]*android.DepSet[android.Path]
+ mergedAconfigFiles map[string]android.Paths
}
func (c *Module) AddJSONData(d *map[string]interface{}) {
@@ -2324,7 +2324,7 @@
}
ctx.SetProvider(blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: deps.GeneratedSources.Strings()})
- aconfig.CollectTransitiveAconfigFiles(ctx, &c.transitiveAconfigFiles)
+ aconfig.CollectDependencyAconfigFiles(ctx, &c.mergedAconfigFiles)
c.maybeInstall(ctx, apexInfo)
}
@@ -2345,10 +2345,6 @@
}
}
-func (c *Module) getTransitiveAconfigFiles(container string) []android.Path {
- return c.transitiveAconfigFiles[container].ToList()
-}
-
// maybeInstall is called at the end of both GenerateAndroidBuildActions and
// ProcessBazelQueryResponse to run the install hooks for installable modules,
// like binaries and tests.