Merge "Temporarily bypass apex availability check for /product apexes with a specific prefix" into main am: 3a9a37cc78
am: 880aa466bf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3276271 Change-Id: I75a5c547cf1ce10dc099228539063da329797a69 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -2745,6 +2745,12 @@ func (a *apexBundle) checkApexAvailability(ctx android.ModuleContext) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Temporarily bypass /product APEXes with a specific prefix.
|
||||||
|
// TODO: b/352818241 - Remove this after APEX availability is enforced for /product APEXes.
|
||||||
|
if a.ProductSpecific() && strings.HasPrefix(a.ApexVariationName(), "com.sdv.") {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Coverage build adds additional dependencies for the coverage-only runtime libraries.
|
// Coverage build adds additional dependencies for the coverage-only runtime libraries.
|
||||||
// Requiring them and their transitive depencies with apex_available is not right
|
// Requiring them and their transitive depencies with apex_available is not right
|
||||||
// because they just add noise.
|
// because they just add noise.
|
||||||
|
@@ -6013,6 +6013,87 @@ func TestApexAvailable_DirectDep(t *testing.T) {
|
|||||||
system_shared_libs: [],
|
system_shared_libs: [],
|
||||||
apex_available: ["otherapex"],
|
apex_available: ["otherapex"],
|
||||||
}`)
|
}`)
|
||||||
|
|
||||||
|
// 'apex_available' check is bypassed for /product apex with a specific prefix.
|
||||||
|
// TODO: b/352818241 - Remove below two cases after APEX availability is enforced for /product APEXes.
|
||||||
|
testApex(t, `
|
||||||
|
apex {
|
||||||
|
name: "com.sdv.myapex",
|
||||||
|
key: "myapex.key",
|
||||||
|
native_shared_libs: ["libfoo"],
|
||||||
|
updatable: false,
|
||||||
|
product_specific: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
apex_key {
|
||||||
|
name: "myapex.key",
|
||||||
|
public_key: "testkey.avbpubkey",
|
||||||
|
private_key: "testkey.pem",
|
||||||
|
}
|
||||||
|
|
||||||
|
apex {
|
||||||
|
name: "com.any.otherapex",
|
||||||
|
key: "otherapex.key",
|
||||||
|
native_shared_libs: ["libfoo"],
|
||||||
|
updatable: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
apex_key {
|
||||||
|
name: "otherapex.key",
|
||||||
|
public_key: "testkey.avbpubkey",
|
||||||
|
private_key: "testkey.pem",
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library {
|
||||||
|
name: "libfoo",
|
||||||
|
stl: "none",
|
||||||
|
system_shared_libs: [],
|
||||||
|
apex_available: ["com.any.otherapex"],
|
||||||
|
product_specific: true,
|
||||||
|
}`,
|
||||||
|
android.FixtureMergeMockFs(android.MockFS{
|
||||||
|
"system/sepolicy/apex/com.sdv.myapex-file_contexts": nil,
|
||||||
|
"system/sepolicy/apex/com.any.otherapex-file_contexts": nil,
|
||||||
|
}))
|
||||||
|
|
||||||
|
// 'apex_available' check is not bypassed for non-product apex with a specific prefix.
|
||||||
|
testApexError(t, "requires \"libfoo\" that doesn't list the APEX under 'apex_available'.", `
|
||||||
|
apex {
|
||||||
|
name: "com.sdv.myapex",
|
||||||
|
key: "myapex.key",
|
||||||
|
native_shared_libs: ["libfoo"],
|
||||||
|
updatable: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
apex_key {
|
||||||
|
name: "myapex.key",
|
||||||
|
public_key: "testkey.avbpubkey",
|
||||||
|
private_key: "testkey.pem",
|
||||||
|
}
|
||||||
|
|
||||||
|
apex {
|
||||||
|
name: "com.any.otherapex",
|
||||||
|
key: "otherapex.key",
|
||||||
|
native_shared_libs: ["libfoo"],
|
||||||
|
updatable: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
apex_key {
|
||||||
|
name: "otherapex.key",
|
||||||
|
public_key: "testkey.avbpubkey",
|
||||||
|
private_key: "testkey.pem",
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library {
|
||||||
|
name: "libfoo",
|
||||||
|
stl: "none",
|
||||||
|
system_shared_libs: [],
|
||||||
|
apex_available: ["com.any.otherapex"],
|
||||||
|
}`,
|
||||||
|
android.FixtureMergeMockFs(android.MockFS{
|
||||||
|
"system/sepolicy/apex/com.sdv.myapex-file_contexts": nil,
|
||||||
|
"system/sepolicy/apex/com.any.otherapex-file_contexts": nil,
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestApexAvailable_IndirectDep(t *testing.T) {
|
func TestApexAvailable_IndirectDep(t *testing.T) {
|
||||||
@@ -6058,6 +6139,91 @@ func TestApexAvailable_IndirectDep(t *testing.T) {
|
|||||||
stl: "none",
|
stl: "none",
|
||||||
system_shared_libs: [],
|
system_shared_libs: [],
|
||||||
}`)
|
}`)
|
||||||
|
|
||||||
|
// 'apex_available' check is bypassed for /product apex with a specific prefix.
|
||||||
|
// TODO: b/352818241 - Remove below two cases after APEX availability is enforced for /product APEXes.
|
||||||
|
testApex(t, `
|
||||||
|
apex {
|
||||||
|
name: "com.sdv.myapex",
|
||||||
|
key: "myapex.key",
|
||||||
|
native_shared_libs: ["libfoo"],
|
||||||
|
updatable: false,
|
||||||
|
product_specific: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
apex_key {
|
||||||
|
name: "myapex.key",
|
||||||
|
public_key: "testkey.avbpubkey",
|
||||||
|
private_key: "testkey.pem",
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library {
|
||||||
|
name: "libfoo",
|
||||||
|
stl: "none",
|
||||||
|
shared_libs: ["libbar"],
|
||||||
|
system_shared_libs: [],
|
||||||
|
apex_available: ["com.sdv.myapex"],
|
||||||
|
product_specific: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library {
|
||||||
|
name: "libbar",
|
||||||
|
stl: "none",
|
||||||
|
shared_libs: ["libbaz"],
|
||||||
|
system_shared_libs: [],
|
||||||
|
apex_available: ["com.sdv.myapex"],
|
||||||
|
product_specific: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library {
|
||||||
|
name: "libbaz",
|
||||||
|
stl: "none",
|
||||||
|
system_shared_libs: [],
|
||||||
|
product_specific: true,
|
||||||
|
}`,
|
||||||
|
android.FixtureMergeMockFs(android.MockFS{
|
||||||
|
"system/sepolicy/apex/com.sdv.myapex-file_contexts": nil,
|
||||||
|
}))
|
||||||
|
|
||||||
|
// 'apex_available' check is not bypassed for non-product apex with a specific prefix.
|
||||||
|
testApexError(t, `requires "libbaz" that doesn't list the APEX under 'apex_available'.`, `
|
||||||
|
apex {
|
||||||
|
name: "com.sdv.myapex",
|
||||||
|
key: "myapex.key",
|
||||||
|
native_shared_libs: ["libfoo"],
|
||||||
|
updatable: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
apex_key {
|
||||||
|
name: "myapex.key",
|
||||||
|
public_key: "testkey.avbpubkey",
|
||||||
|
private_key: "testkey.pem",
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library {
|
||||||
|
name: "libfoo",
|
||||||
|
stl: "none",
|
||||||
|
shared_libs: ["libbar"],
|
||||||
|
system_shared_libs: [],
|
||||||
|
apex_available: ["com.sdv.myapex"],
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library {
|
||||||
|
name: "libbar",
|
||||||
|
stl: "none",
|
||||||
|
shared_libs: ["libbaz"],
|
||||||
|
system_shared_libs: [],
|
||||||
|
apex_available: ["com.sdv.myapex"],
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library {
|
||||||
|
name: "libbaz",
|
||||||
|
stl: "none",
|
||||||
|
system_shared_libs: [],
|
||||||
|
}`,
|
||||||
|
android.FixtureMergeMockFs(android.MockFS{
|
||||||
|
"system/sepolicy/apex/com.sdv.myapex-file_contexts": nil,
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestApexAvailable_IndirectStaticDep(t *testing.T) {
|
func TestApexAvailable_IndirectStaticDep(t *testing.T) {
|
||||||
|
Reference in New Issue
Block a user