Merge "Fix bp2build's stub/impl selection logic for platform variants" into main am: ea9a510c5c
am: afab110223
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2744713 Change-Id: I7b6626280cf36210ab0ee6083c1729d4d2b0fa28 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -2867,7 +2867,6 @@ cc_library {
|
|||||||
ExpectedBazelTargets: makeCcLibraryTargets("foolib", AttrNameToString{
|
ExpectedBazelTargets: makeCcLibraryTargets("foolib", AttrNameToString{
|
||||||
"implementation_dynamic_deps": `select({
|
"implementation_dynamic_deps": `select({
|
||||||
"//build/bazel/rules/apex:foo": ["@api_surfaces//module-libapi/current:barlib"],
|
"//build/bazel/rules/apex:foo": ["@api_surfaces//module-libapi/current:barlib"],
|
||||||
"//build/bazel/rules/apex:system": ["@api_surfaces//module-libapi/current:barlib"],
|
|
||||||
"//conditions:default": [":barlib"],
|
"//conditions:default": [":barlib"],
|
||||||
})`,
|
})`,
|
||||||
"local_includes": `["."]`,
|
"local_includes": `["."]`,
|
||||||
@@ -2925,10 +2924,6 @@ cc_library {
|
|||||||
"@api_surfaces//module-libapi/current:barlib",
|
"@api_surfaces//module-libapi/current:barlib",
|
||||||
"@api_surfaces//module-libapi/current:quxlib",
|
"@api_surfaces//module-libapi/current:quxlib",
|
||||||
],
|
],
|
||||||
"//build/bazel/rules/apex:system": [
|
|
||||||
"@api_surfaces//module-libapi/current:barlib",
|
|
||||||
"@api_surfaces//module-libapi/current:quxlib",
|
|
||||||
],
|
|
||||||
"//conditions:default": [
|
"//conditions:default": [
|
||||||
":barlib",
|
":barlib",
|
||||||
":quxlib",
|
":quxlib",
|
||||||
|
@@ -661,7 +661,7 @@ cc_library_shared {
|
|||||||
":libapexfoo_stable",
|
":libapexfoo_stable",
|
||||||
],
|
],
|
||||||
"//build/bazel/rules/apex:system": [
|
"//build/bazel/rules/apex:system": [
|
||||||
"@api_surfaces//module-libapi/current:libplatform_stable",
|
":libplatform_stable",
|
||||||
"@api_surfaces//module-libapi/current:libapexfoo_stable",
|
"@api_surfaces//module-libapi/current:libapexfoo_stable",
|
||||||
],
|
],
|
||||||
"//conditions:default": [
|
"//conditions:default": [
|
||||||
|
@@ -1624,6 +1624,11 @@ func setStubsForDynamicDeps(ctx android.BazelConversionPathContext, axis bazel.C
|
|||||||
if linkable, ok := ctx.Module().(LinkableInterface); ok && linkable.Bootstrap() {
|
if linkable, ok := ctx.Module().(LinkableInterface); ok && linkable.Bootstrap() {
|
||||||
sameApiDomain = true
|
sameApiDomain = true
|
||||||
}
|
}
|
||||||
|
// If dependency has `apex_available: ["//apex_available:platform]`, then the platform variant of rdep should link against its impl.
|
||||||
|
// https://cs.android.com/android/_/android/platform/build/soong/+/main:cc/cc.go;l=3617;bpv=1;bpt=0;drc=c6a93d853b37ec90786e745b8d282145e6d3b589
|
||||||
|
if depApexAvailable := dep.(*Module).ApexAvailable(); len(depApexAvailable) == 1 && depApexAvailable[0] == android.AvailableToPlatform {
|
||||||
|
sameApiDomain = true
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
sameApiDomain = android.InList(apiDomain, dep.(*Module).ApexAvailable())
|
sameApiDomain = android.InList(apiDomain, dep.(*Module).ApexAvailable())
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user