Export the list of required and provided native libs in the apex manifest.
These lists are used by linkerconfig on device to identify the
relationship between apexes and the libs they provide/require.
See https://cs.android.com/android/platform/superproject/+/master:system/linkerconfig/modules/apex.cc;l=181-184;drc=88eefd5fded5d1b21c47ab5a2dc6cf16bf284921
Summary of this change:
* Add a new action that modifies the final apex_manifest.pb with entries
pertaining to the native libs required by, and provided by, an apex.
* Apply the apex_cc_aspect on apex.binaries, so the transitive
shared lib dependencies of binaries are collected as well.
* Updated the apex_cc_aspect to export the list of required and provided
libs, based on the direct dependency state and whether the library
exports stubs.
* If a library is a direct dep and a stub, the library is provided by the apex to the device.
* If a library is not a direct dep and a stub, the library is
required by the apex (i.e. provided by the platform or other APEXes).
The new tests closely model apex_test.go#TestDependenciesInApexManifest,
and the new diff test shows the new requireNativeLibs and
provideNativeLibs fields of the adbd apex manifest.
Test: CI (bp2build-incremental)
Test: b test //build/bazel/tests/apex/... --config=android_arm64
Test: b test //build/bazel/rules/apex/... --config=android_arm64
Bug: 235057628
Bug: 220030716
Bug: 215500321
Fixes: 222588061
Change-Id: Ib8b45c58a0197aa22371029320bc53f96b95c109
9 files changed