Convert sabi to TransitionMutator
The sabi mutator walks static dependencies of native libraries with ABI
stability guarantees (LLNDK, APEX, or cross-partition) and sets a flag
that causes the modules to generate additional rules to extract the ABI
from each source/object pair, combine them, and add a rule that diffs
them against the checked in version. In order to remove top down
mutators that mutate dependencies, convert it to a transition mutator.
This may cause the same static library code to be compiled identically
twice with and without the configuration, but there are relatively
few static libraries that are dependencies of stable ABI libraries.
If the cost of compiling these static libraries becomes too high this
can be replaced with something like Bazel aspects, where the stable
ABI library visits its static dependencies and adds extra rules to
generate the sabi dumps.
Bug: 367784740
Test: TestSabi
Flag: EXEMPT refactor
Change-Id: Ie6bd44680afdca15b09ba0b64ed0df9964a936a6
diff --git a/cc/sabi_test.go b/cc/sabi_test.go
index 849fc36..6b8cc17 100644
--- a/cc/sabi_test.go
+++ b/cc/sabi_test.go
@@ -48,13 +48,13 @@
PrepareForTestWithCcDefaultModules,
).RunTestWithBp(t, bp)
- libsabiStatic := result.ModuleForTests("libsabi", "android_arm64_armv8-a_static")
+ libsabiStatic := result.ModuleForTests("libsabi", "android_arm64_armv8-a_static_sabi")
sabiObjSDump := libsabiStatic.Output("obj/sabi.sdump")
- libDirect := result.ModuleForTests("libdirect", "android_arm64_armv8-a_static")
+ libDirect := result.ModuleForTests("libdirect", "android_arm64_armv8-a_static_sabi")
directObjSDump := libDirect.Output("obj/direct.sdump")
- libTransitive := result.ModuleForTests("libtransitive", "android_arm64_armv8-a_static")
+ libTransitive := result.ModuleForTests("libtransitive", "android_arm64_armv8-a_static_sabi")
transitiveObjSDump := libTransitive.Output("obj/transitive.sdump")
libsabiShared := result.ModuleForTests("libsabi", "android_arm64_armv8-a_shared")