Do not follow prebuiltDependencyTags in APEX payload walks.
If prebuilts are active they will have the other direct dependencies from the source modules. Bug: 151303681 Test: m nothing Test: `m` with prebuilts/runtime in the manifest (along with other fixes) Change-Id: I1ffc7e7b528ed9db5ce6ca2ee96c9d23c6548c49
This commit is contained in:
10
apex/apex.go
10
apex/apex.go
@@ -1750,9 +1750,15 @@ func (a *apexBundle) WalkPayloadDeps(ctx android.ModuleContext, do android.Paylo
|
||||
return false
|
||||
}
|
||||
|
||||
dt := ctx.OtherModuleDependencyTag(child)
|
||||
|
||||
if _, ok := dt.(android.ExcludeFromApexContentsTag); ok {
|
||||
return false
|
||||
}
|
||||
|
||||
// Check for the direct dependencies that contribute to the payload
|
||||
if dt, ok := ctx.OtherModuleDependencyTag(child).(dependencyTag); ok {
|
||||
if dt.payload {
|
||||
if adt, ok := dt.(dependencyTag); ok {
|
||||
if adt.payload {
|
||||
return do(ctx, parent, am, false /* externalDep */)
|
||||
}
|
||||
// As soon as the dependency graph crosses the APEX boundary, don't go further.
|
||||
|
@@ -5790,6 +5790,41 @@ func TestAllowedFiles(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNonPreferredPrebuiltDependency(t *testing.T) {
|
||||
_, _ = testApex(t, `
|
||||
apex {
|
||||
name: "myapex",
|
||||
key: "myapex.key",
|
||||
native_shared_libs: ["mylib"],
|
||||
}
|
||||
|
||||
apex_key {
|
||||
name: "myapex.key",
|
||||
public_key: "testkey.avbpubkey",
|
||||
private_key: "testkey.pem",
|
||||
}
|
||||
|
||||
cc_library {
|
||||
name: "mylib",
|
||||
srcs: ["mylib.cpp"],
|
||||
stubs: {
|
||||
versions: ["10000"],
|
||||
},
|
||||
apex_available: ["myapex"],
|
||||
}
|
||||
|
||||
cc_prebuilt_library_shared {
|
||||
name: "mylib",
|
||||
prefer: false,
|
||||
srcs: ["prebuilt.so"],
|
||||
stubs: {
|
||||
versions: ["10000"],
|
||||
},
|
||||
apex_available: ["myapex"],
|
||||
}
|
||||
`)
|
||||
}
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
run := func() int {
|
||||
setUp()
|
||||
|
Reference in New Issue
Block a user