Merge "Remove versioned LLNDK stubs" am: ebdf61ece2 am: db246b5784

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1698870

Change-Id: Ieed2cc19c37d477d5f90c2e42a901e90e7d748c9
This commit is contained in:
Treehugger Robot 2021-06-01 22:27:07 +00:00 committed by Automerger Merge Worker
commit 7577a2d094
3 changed files with 8 additions and 21 deletions

View file

@ -726,7 +726,6 @@ var (
runtimeDepTag = installDependencyTag{name: "runtime lib"}
testPerSrcDepTag = dependencyTag{name: "test_per_src"}
stubImplDepTag = dependencyTag{name: "stub_impl"}
llndkStubDepTag = dependencyTag{name: "llndk stub"}
)
func IsSharedDepTag(depTag blueprint.DependencyTag) bool {
@ -3236,8 +3235,8 @@ func (c *Module) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Modu
return false
}
}
if depTag == stubImplDepTag || depTag == llndkStubDepTag {
// We don't track beyond LLNDK or from an implementation library to its stubs.
if depTag == stubImplDepTag {
// We don't track from an implementation library to its stubs.
return false
}
if depTag == staticVariantTag {

View file

@ -2799,12 +2799,8 @@ func TestLlndkLibrary(t *testing.T) {
}
}
expected := []string{
"android_vendor.29_arm64_armv8-a_shared_1",
"android_vendor.29_arm64_armv8-a_shared_2",
"android_vendor.29_arm64_armv8-a_shared_current",
"android_vendor.29_arm64_armv8-a_shared",
"android_vendor.29_arm_armv7-a-neon_shared_1",
"android_vendor.29_arm_armv7-a-neon_shared_2",
"android_vendor.29_arm_armv7-a-neon_shared_current",
"android_vendor.29_arm_armv7-a-neon_shared",
}
@ -2813,9 +2809,6 @@ func TestLlndkLibrary(t *testing.T) {
params := result.ModuleForTests("libllndk", "android_vendor.29_arm_armv7-a-neon_shared").Description("generate stub")
android.AssertSame(t, "use VNDK version for default stubs", "current", params.Args["apiLevel"])
params = result.ModuleForTests("libllndk", "android_vendor.29_arm_armv7-a-neon_shared_1").Description("generate stub")
android.AssertSame(t, "override apiLevel for versioned stubs", "1", params.Args["apiLevel"])
checkExportedIncludeDirs := func(module, variant string, expectedDirs ...string) {
t.Helper()
m := result.ModuleForTests(module, variant).Module()

View file

@ -1813,6 +1813,11 @@ func (library *libraryDecorator) stubsVersions(ctx android.BaseMutatorContext) [
return nil
}
if library.hasLLNDKStubs() && ctx.Module().(*Module).UseVndk() {
// LLNDK libraries only need a single stubs variant.
return []string{android.FutureApiLevel.String()}
}
// Future API level is implicitly added if there isn't
vers := library.Properties.Stubs.Versions
if inList(android.FutureApiLevel.String(), vers) {
@ -2154,8 +2159,7 @@ func moduleLibraryInterface(module blueprint.Module) libraryInterface {
return nil
}
// versionSelector normalizes the versions in the Stubs.Versions property into MutatedProperties.AllStubsVersions,
// and propagates the value from implementation libraries to llndk libraries with the same name.
// versionSelector normalizes the versions in the Stubs.Versions property into MutatedProperties.AllStubsVersions.
func versionSelectorMutator(mctx android.BottomUpMutatorContext) {
if library := moduleLibraryInterface(mctx.Module()); library != nil && CanBeVersionVariant(mctx.Module().(*Module)) {
if library.buildShared() {
@ -2169,15 +2173,6 @@ func versionSelectorMutator(mctx android.BottomUpMutatorContext) {
// depend on the implementation library and haven't been mutated yet.
library.setAllStubsVersions(versions)
}
if mctx.Module().(*Module).UseVndk() && library.hasLLNDKStubs() {
// Propagate the version to the llndk stubs module.
mctx.VisitDirectDepsWithTag(llndkStubDepTag, func(stubs android.Module) {
if stubsLib := moduleLibraryInterface(stubs); stubsLib != nil {
stubsLib.setAllStubsVersions(library.allStubsVersions())
}
})
}
}
}
}