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-02-29 06:34:49 +0000
commit2d8884a37757edc6b984e1e073ab5a9e4a85f778 (patch)
tree94b0be3d9a8ff44c0728195c9f85d381e7ecd0f5 /apex
parent688f824e1a804c08a976f5502383ce1ec646177b (diff)
Fix non-determinism in prebuilt selection
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: 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) Bug: TODO Change-Id: I7191200c330c5bcb9d5532006d3c573a60db61cc
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 85d1d712a..65f0a235b 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)
})
}