Merge "Revert "Use a partition packaging spec filter for android_filesystem"" into main am: 2147eb09bf am: 2a5d700e75
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3313639
Change-Id: Idd1b1bb8a6d037c2fc37ba142d4b4eb5a77ad80a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index 9756b82..4bdd0a4 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -264,7 +264,7 @@
func (f *filesystem) filterInstallablePackagingSpec(ps android.PackagingSpec) bool {
// Filesystem module respects the installation semantic. A PackagingSpec from a module with
// IsSkipInstall() is skipped.
- return !ps.SkipInstall() && (ps.Partition() == f.PartitionType())
+ return !ps.SkipInstall()
}
var pctx = android.NewPackageContext("android/soong/filesystem")
diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go
index 1e50836..057dcaa 100644
--- a/filesystem/filesystem_test.go
+++ b/filesystem/filesystem_test.go
@@ -584,28 +584,3 @@
android.AssertStringDoesContain(t, "erofs fs type compress hint", buildImageConfig, "erofs_default_compress_hints=compress_hints.txt")
android.AssertStringDoesContain(t, "erofs fs type sparse", buildImageConfig, "erofs_sparse_flag=-s")
}
-
-// If a system_ext/ module depends on system/ module, the dependency should *not*
-// be installed in system_ext/
-func TestDoNotPackageCrossPartitionDependencies(t *testing.T) {
- result := fixture.RunTestWithBp(t, `
- android_filesystem {
- name: "myfilesystem",
- deps: ["binfoo"],
- partition_type: "system_ext",
- }
-
- cc_binary {
- name: "binfoo",
- shared_libs: ["libfoo"],
- system_ext_specific: true,
- }
- cc_library_shared {
- name: "libfoo", // installed in system/
- }
- `)
-
- partition := result.ModuleForTests("myfilesystem", "android_common")
- fileList := android.ContentFromFileRuleForTests(t, result.TestContext, partition.Output("fileList"))
- android.AssertDeepEquals(t, "filesystem with dependencies on different partition", "bin/binfoo\n", fileList)
-}
diff --git a/filesystem/system_image.go b/filesystem/system_image.go
index 7dbf986..57239ae 100644
--- a/filesystem/system_image.go
+++ b/filesystem/system_image.go
@@ -103,6 +103,6 @@
// partition. Note that "apex" module installs its contents to "apex"(fake partition) as well
// for symbol lookup by imitating "activated" paths.
func (s *systemImage) filterPackagingSpec(ps android.PackagingSpec) bool {
- return !ps.SkipInstall() &&
+ return s.filesystem.filterInstallablePackagingSpec(ps) &&
(ps.Partition() == "system" || ps.Partition() == "root")
}