apexDepsMutator is a top-down mutator
apex { name: ["myapex"], native_shared_libs: ["libX", "libY"] } cc_library { name: "libX", shared_libs: ["libY"] } cc_library { name: "libY", shared_libs: ["libZ"], stubs: {...} } apexDepsMutator was a bottom up mutator and it uses WalkDeps to traverse the dependency tree rooted at myapex in a depth-first order. While traversing the tree, if calls BuildForApex for a module that will be part of the APEX. libY is visited twice. Once via libX and once via myapex. If the visit from libX was before the visit from myapex (since this is a depth-first traversing), BuildForApex is not called for libY and its dependency libZ, because libY provides a stub. And then when libY is again visited via myapex, BuildForApex is correctly called for the module, but not for its dependencies libZ because the paths from libY to libZ was already visited. As a result, the apex variant of libY has a dependency to the non-apex variant of libZ. Fixing the problem by changing the mutator a top-down one. Bug: 148645937 Test: m Change-Id: Ib2cb28852087c63a568b3fd036504e9261cf0782
Loading
Please register or sign in to comment