diff options
author | 2025-01-13 00:39:47 -0800 | |
---|---|---|
committer | 2025-01-13 00:39:47 -0800 | |
commit | 0d02c06f24e6958b30062387b0e57d364a67f3a1 (patch) | |
tree | 2ae87aeeb8e8a7086dcdeff1fa613edc94882029 | |
parent | a8c8e20d0da3c6231906c225099f38d983ade041 (diff) |
Revert "Collect dependencies of updatable apexes only for AOSP APEX"
Revert submission 3444766-non-aosp-allowed-deps
Reason for revert: <Droidmonitor created revert due to b/389580262.Will be verified through ABTD for standard investigation.>
Reverted changes: /q/submissionid:3444766-non-aosp-allowed-deps
Change-Id: I13e0e5cc12c63601995b010db34ebc71efab27f0
-rw-r--r-- | apex/apex_singleton.go | 5 | ||||
-rw-r--r-- | apex/apex_test.go | 85 |
2 files changed, 11 insertions, 79 deletions
diff --git a/apex/apex_singleton.go b/apex/apex_singleton.go index 263e0a52c..7b3acb509 100644 --- a/apex/apex_singleton.go +++ b/apex/apex_singleton.go @@ -18,7 +18,6 @@ package apex import ( "encoding/json" - "strings" "github.com/google/blueprint" @@ -95,9 +94,7 @@ func (s *apexDepsInfoSingleton) GenerateBuildActions(ctx android.SingletonContex apexInfo, _ := android.OtherModuleProvider(ctx, module, android.ApexInfoProvider) if path := binaryInfo.FlatListPath(); path != nil { if binaryInfo.Updatable() || apexInfo.Updatable { - if strings.HasPrefix(module.String(), "com.android.") { - updatableFlatLists = append(updatableFlatLists, path) - } + updatableFlatLists = append(updatableFlatLists, path) } } } diff --git a/apex/apex_test.go b/apex/apex_test.go index 465789c12..0472488c7 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -2129,11 +2129,11 @@ func TestApexMinSdkVersion_InVendorApex(t *testing.T) { android.AssertStringDoesContain(t, "cflags", cflags, "-target aarch64-linux-android29") } -func TestTrackAllowedDepsForAndroidApex(t *testing.T) { +func TestTrackAllowedDeps(t *testing.T) { t.Parallel() ctx := testApex(t, ` apex { - name: "com.android.myapex", + name: "myapex", key: "myapex.key", updatable: true, native_shared_libs: [ @@ -2161,7 +2161,7 @@ func TestTrackAllowedDepsForAndroidApex(t *testing.T) { srcs: ["mylib.cpp"], shared_libs: ["libbar"], min_sdk_version: "29", - apex_available: ["com.android.myapex"], + apex_available: ["myapex"], } cc_library { @@ -2173,24 +2173,20 @@ func TestTrackAllowedDepsForAndroidApex(t *testing.T) { name: "yourlib", srcs: ["mylib.cpp"], min_sdk_version: "29", - apex_available: ["com.android.myapex", "myapex2", "//apex_available:platform"], + apex_available: ["myapex", "myapex2", "//apex_available:platform"], } `, withFiles(android.MockFS{ "packages/modules/common/build/allowed_deps.txt": nil, - }), - android.FixtureMergeMockFs(android.MockFS{ - "system/sepolicy/apex/com.android.myapex-file_contexts": nil, - })) + })) depsinfo := ctx.SingletonForTests("apex_depsinfo_singleton") inputs := depsinfo.Rule("generateApexDepsInfoFilesRule").BuildParams.Inputs.Strings() - - android.AssertStringListContains(t, "updatable com.android.myapex should generate depsinfo file", inputs, - "out/soong/.intermediates/com.android.myapex/android_common_com.android.myapex/depsinfo/flatlist.txt") + android.AssertStringListContains(t, "updatable myapex should generate depsinfo file", inputs, + "out/soong/.intermediates/myapex/android_common_myapex/depsinfo/flatlist.txt") android.AssertStringListDoesNotContain(t, "non-updatable myapex2 should not generate depsinfo file", inputs, "out/soong/.intermediates/myapex2/android_common_myapex2/depsinfo/flatlist.txt") - myapex := ctx.ModuleForTests("com.android.myapex", "android_common_com.android.myapex") + myapex := ctx.ModuleForTests("myapex", "android_common_myapex") flatlist := strings.Split(android.ContentFromFileRuleForTests(t, ctx, myapex.Output("depsinfo/flatlist.txt")), "\n") android.AssertStringListContains(t, "deps with stubs should be tracked in depsinfo as external dep", @@ -2201,69 +2197,11 @@ func TestTrackAllowedDepsForAndroidApex(t *testing.T) { flatlist, "yourlib(minSdkVersion:29)") } -func TestNotTrackAllowedDepsForNonAndroidApex(t *testing.T) { - t.Parallel() - ctx := testApex(t, ` - apex { - name: "myapex", - key: "myapex.key", - updatable: true, - native_shared_libs: [ - "mylib", - "yourlib", - ], - min_sdk_version: "29", - } - - apex { - name: "myapex2", - key: "myapex.key", - updatable: false, - native_shared_libs: ["yourlib"], - } - - apex_key { - name: "myapex.key", - public_key: "testkey.avbpubkey", - private_key: "testkey.pem", - } - - cc_library { - name: "mylib", - srcs: ["mylib.cpp"], - shared_libs: ["libbar"], - min_sdk_version: "29", - apex_available: ["myapex"], - } - - cc_library { - name: "libbar", - stubs: { versions: ["29", "30"] }, - } - - cc_library { - name: "yourlib", - srcs: ["mylib.cpp"], - min_sdk_version: "29", - apex_available: ["myapex", "myapex2", "//apex_available:platform"], - } - `, withFiles(android.MockFS{ - "packages/modules/common/build/allowed_deps.txt": nil, - })) - - depsinfo := ctx.SingletonForTests("apex_depsinfo_singleton") - inputs := depsinfo.Rule("generateApexDepsInfoFilesRule").BuildParams.Inputs.Strings() - android.AssertStringListDoesNotContain(t, "updatable myapex should generate depsinfo file", inputs, - "out/soong/.intermediates/myapex/android_common_myapex/depsinfo/flatlist.txt") - android.AssertStringListDoesNotContain(t, "non-updatable myapex2 should not generate depsinfo file", inputs, - "out/soong/.intermediates/myapex2/android_common_myapex2/depsinfo/flatlist.txt") -} - func TestTrackAllowedDeps_SkipWithoutAllowedDepsTxt(t *testing.T) { t.Parallel() ctx := testApex(t, ` apex { - name: "com.android.myapex", + name: "myapex", key: "myapex.key", updatable: true, min_sdk_version: "29", @@ -2274,10 +2212,7 @@ func TestTrackAllowedDeps_SkipWithoutAllowedDepsTxt(t *testing.T) { public_key: "testkey.avbpubkey", private_key: "testkey.pem", } - `, - android.FixtureMergeMockFs(android.MockFS{ - "system/sepolicy/apex/com.android.myapex-file_contexts": nil, - })) + `) depsinfo := ctx.SingletonForTests("apex_depsinfo_singleton") if nil != depsinfo.MaybeRule("generateApexDepsInfoFilesRule").Output { t.Error("apex_depsinfo_singleton shouldn't run when allowed_deps.txt doesn't exist") |