aboutsummaryrefslogtreecommitdiff
path: root/apex
diff options
context:
space:
mode:
authorSpandan Das <spandandas@google.com>2024-02-27 04:49:52 +0000
committerSpandan Das <spandandas@google.com>2024-03-04 07:59:34 +0000
commitf2c105758659078460effa2564854db8e9c372ca (patch)
treea31a69c3310eebb956bd9deeb3d9a45437a2093a /apex
parent1c96fab7d06699d2c14a8ee1e67a01674b4007cf (diff)
Fix non-determinism in prebuilt selection
This relands aosp/2978137 with acknowledgement of soong namespaces. If multiple versions of the prebuilt module sdk share the same soong config namespace, then PrebuiltPostDepsMutator rewrites rdeps to one of those prebuilts in a non-deterministic way. This CL uses apex_contributions to make this deterministic. Multiple prebuilts will not be allowed to have their prefer evaluate to true. If this happens, one of the prebuilts must be explicitly declared in apex_contributions. This CL also fixes the special-casing of the top-level java_sdk_library_import in ReplaceDirectDependencies. For framework-foo.v2, it will use BaseModuleName framework-foo instead of SdkLibraryName framework-foo.v2 to determine if the source module has been selected. Test: ran the previously failing cmd of b/327552112 Test: Added a unit test Test: aninja -t query out/soong/.intermediates/packages/modules/Permission/SafetyCenter/Config/safety-center-config/android_common/javac/safety-center-config.jar | grep module_sdk is empty (should not cause a regression for 323454855) Change-Id: Id484a41192085c50b7e34ad415c6e195edb0d006
Diffstat (limited to 'apex')
-rw-r--r--apex/apex_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go
index 97b9c84f0..54d2d08ff 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -6199,7 +6199,7 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
`)
})
- t.Run("Co-existing unflagged apexes should create a duplicate deapexer error in hiddenapi processing", func(t *testing.T) {
+ t.Run("Co-existing unflagged apexes should create a duplicate module error", func(t *testing.T) {
bp := `
// Source
apex {
@@ -6273,7 +6273,7 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) {
}
`
- testDexpreoptWithApexes(t, bp, "Multiple installable prebuilt APEXes provide ambiguous deapexers: prebuilt_myapex.v1 and prebuilt_myapex.v2", preparer, fragment)
+ testDexpreoptWithApexes(t, bp, "Multiple prebuilt modules prebuilt_myapex.v1 and prebuilt_myapex.v2 have been marked as preferred for this source module", preparer, fragment)
})
}