From bd3a16b5e75e15d91d6a8cb16ccc53d9d8e202a6 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 25 Apr 2023 11:30:51 -0700 Subject: Install sdk variants in unbundled builds and package uninstallable variants This effectively undoes both If6c3ee82d588e2742c85cef7244c090c93f38b8e and I682e4f1f477f3024f7719dfaa67006ef335e0640. SDK variants are now installed again, which will fix unbundled builds of cc_test modules. The platform variants used by com.android.virt are now packagable even though they are not installable. Fix the original problem in b/194403710 by adding a flag to platform variants of modules in apexes that are not platform available, and using that to prevent install and packaging dependencies. That allows the HideFromMake flag to go back to being used for preventing install dependencies but not packaging dependencies. Test: TestPackagingWithSkipInstallDeps Test: TestFileSystemShouldInstallCoreVariantIfTargetBuildAppsIsSet Test: TestFileSystemShouldSkipApexLibraries Bug: 194403710 Bug: 268582372 Fixes: 274443025 Change-Id: If5418df3ddbb940bd631caebdf38daa81e71f40e --- apex/apex_test.go | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'apex/apex_test.go') diff --git a/apex/apex_test.go b/apex/apex_test.go index 3ba4d8d55..d0d4d0d93 100644 --- a/apex/apex_test.go +++ b/apex/apex_test.go @@ -33,6 +33,7 @@ import ( "android/soong/cc" "android/soong/dexpreopt" prebuilt_etc "android/soong/etc" + "android/soong/filesystem" "android/soong/java" "android/soong/rust" "android/soong/sh" @@ -10375,3 +10376,54 @@ func TestStubLibrariesMultipleApexViolation(t *testing.T) { } } } + +func TestFileSystemShouldSkipApexLibraries(t *testing.T) { + context := android.GroupFixturePreparers( + android.PrepareForIntegrationTestWithAndroid, + cc.PrepareForIntegrationTestWithCc, + PrepareForTestWithApexBuildComponents, + prepareForTestWithMyapex, + filesystem.PrepareForTestWithFilesystemBuildComponents, + ) + result := context.RunTestWithBp(t, ` + android_system_image { + name: "myfilesystem", + deps: [ + "libfoo", + ], + linker_config_src: "linker.config.json", + } + + cc_library { + name: "libfoo", + shared_libs: [ + "libbar", + ], + stl: "none", + } + + cc_library { + name: "libbar", + stl: "none", + apex_available: ["myapex"], + } + + apex { + name: "myapex", + native_shared_libs: ["libbar"], + key: "myapex.key", + updatable: false, + } + + apex_key { + name: "myapex.key", + public_key: "testkey.avbpubkey", + private_key: "testkey.pem", + } + `) + + inputs := result.ModuleForTests("myfilesystem", "android_common").Output("deps.zip").Implicits + android.AssertStringListDoesNotContain(t, "filesystem should not have libbar", + inputs.Strings(), + "out/soong/.intermediates/libbar/android_arm64_armv8-a_shared/libbar.so") +} -- cgit v1.2.3-59-g8ed1b