ignore apex_available for host variants

The main purpose of apex_available is to prevent a module from being
installed to the system partition (or being statically linked to
something that is installed to the system partition). It's not the goal
to prevent host tools from using the modules.

However, since both host and device variants are not mutated for
platform when the module is not available to platform, the host tools
that depends on those modules couldn't be built. To solve the problem,
the platform variation is NOT skipped for the host variants.

Bug: 128708192
Test: m

Change-Id: I1d662cd6d165581f344138d872329a15bfc43d17
This commit is contained in:
Jiyong Park
2019-12-02 21:01:58 +09:00
parent 1833ceff09
commit 505221f6e0

View File

@@ -179,7 +179,7 @@ func (m *ApexModuleBase) CreateApexVariations(mctx BottomUpMutatorContext) []Mod
m.checkApexAvailableProperty(mctx)
sort.Strings(m.apexVariations)
variations := []string{}
availableForPlatform := mctx.Module().(ApexModule).AvailableFor(availableToPlatform)
availableForPlatform := mctx.Module().(ApexModule).AvailableFor(availableToPlatform) || mctx.Host()
if availableForPlatform {
variations = append(variations, "") // Original variation for platform
}