aconfig: harden dependency collection
To prevent errors, when we collect dependencies for a module, walk the blueprint modules, and ignore blueprint and disabled modules. This avoids errors in validateAndroidModule when a android.Module (such as a genrule) depends on a blueprint.Module, and strict checking is enabled. Bug: 308625757 Test: manual Change-Id: I11f0a0b504aa18d6d786cc91319b9d1d9497c04f
This commit is contained in:
@@ -49,7 +49,13 @@ func CollectDependencyAconfigFiles(ctx ModuleContext, mergedAconfigFiles *map[st
|
||||
if *mergedAconfigFiles == nil {
|
||||
*mergedAconfigFiles = make(map[string]Paths)
|
||||
}
|
||||
ctx.VisitDirectDeps(func(module Module) {
|
||||
ctx.VisitDirectDepsBlueprint(func(module blueprint.Module) {
|
||||
// Walk our direct dependencies, ignoring blueprint Modules and disabled Android Modules.
|
||||
aModule, _ := module.(Module)
|
||||
if aModule == nil || !aModule.Enabled() {
|
||||
return
|
||||
}
|
||||
|
||||
if dep, _ := OtherModuleProvider(ctx, module, AconfigDeclarationsProviderKey); dep.IntermediateCacheOutputPath != nil {
|
||||
(*mergedAconfigFiles)[dep.Container] = append((*mergedAconfigFiles)[dep.Container], dep.IntermediateCacheOutputPath)
|
||||
return
|
||||
|
Reference in New Issue
Block a user