Fix mac/allowmissingdeps builds

This WalkDeps loop was expecting the dependencies to be fully filled
out, which isn't necessarily true on AllowMissingDependencies builds,
especially on Mac when the modules may exist, but not be enabled.

This was triggered when make_erofs was added to an apex, but wasn't
enabled on Mac.

It shouldn't be a problem to skip the disabled dependencies, since we'll
have already marked the current module as missing dependencies, which
means it won't actually get built.

Test: `m nothing` on a mac
Change-Id: Icd6d597117be4cde5bff041be3fd47361c54cad9
This commit is contained in:
Dan Willemsen
2021-10-16 18:36:13 -07:00
parent b07ae342e4
commit 47e1a75851

View File

@@ -1683,6 +1683,9 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
if _, ok := depTag.(android.ExcludeFromApexContentsTag); ok { if _, ok := depTag.(android.ExcludeFromApexContentsTag); ok {
return false return false
} }
if mod, ok := child.(android.Module); ok && !mod.Enabled() {
return false
}
depName := ctx.OtherModuleName(child) depName := ctx.OtherModuleName(child)
if _, isDirectDep := parent.(*apexBundle); isDirectDep { if _, isDirectDep := parent.(*apexBundle); isDirectDep {
switch depTag { switch depTag {