Merge "Remove the arch-based filtering hack in packaging.go" am: f10995b7b6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1509692
Change-Id: Ic73ff639f06086f70e6949fa65d3fcddb8709fbf
diff --git a/android/packaging.go b/android/packaging.go
index ea59888..3e42060 100644
--- a/android/packaging.go
+++ b/android/packaging.go
@@ -153,15 +153,9 @@
// See PackageModule.CopyDepsToZip
func (p *PackagingBase) CopyDepsToZip(ctx ModuleContext, zipOut OutputPath) (entries []string) {
- var supportedArches []string
- for _, t := range p.getSupportedTargets(ctx) {
- supportedArches = append(supportedArches, t.Arch.ArchType.String())
- }
m := make(map[string]PackagingSpec)
ctx.WalkDeps(func(child Module, parent Module) bool {
- // Don't track modules with unsupported arch
- // TODO(jiyong): remove this when aosp/1501613 lands.
- if !InList(child.Target().Arch.ArchType.String(), supportedArches) {
+ if !IsInstallDepNeeded(ctx.OtherModuleDependencyTag(child)) {
return false
}
for _, ps := range child.PackagingSpecs() {
diff --git a/android/packaging_test.go b/android/packaging_test.go
index 2acd15c..7269bfb 100644
--- a/android/packaging_test.go
+++ b/android/packaging_test.go
@@ -29,6 +29,12 @@
}
}
+// dep tag used in this test. All dependencies are considered as installable.
+type installDepTag struct {
+ blueprint.BaseDependencyTag
+ InstallAlwaysNeededDependencyTag
+}
+
func componentTestModuleFactory() Module {
m := &componentTestModule{}
m.AddProperties(&m.props)
@@ -37,7 +43,7 @@
}
func (m *componentTestModule) DepsMutator(ctx BottomUpMutatorContext) {
- ctx.AddDependency(ctx.Module(), nil, m.props.Deps...)
+ ctx.AddDependency(ctx.Module(), installDepTag{}, m.props.Deps...)
}
func (m *componentTestModule) GenerateAndroidBuildActions(ctx ModuleContext) {
@@ -63,7 +69,7 @@
}
func (m *packageTestModule) DepsMutator(ctx BottomUpMutatorContext) {
- m.AddDeps(ctx, struct{ blueprint.BaseDependencyTag }{})
+ m.AddDeps(ctx, installDepTag{})
}
func (m *packageTestModule) GenerateAndroidBuildActions(ctx ModuleContext) {
diff --git a/cc/cc.go b/cc/cc.go
index 6deb1b4..1a7ccf2 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -584,7 +584,7 @@
genHeaderExportDepTag = dependencyTag{name: "gen header export"}
objDepTag = dependencyTag{name: "obj"}
linkerFlagsDepTag = dependencyTag{name: "linker flags file"}
- dynamicLinkerDepTag = dependencyTag{name: "dynamic linker"}
+ dynamicLinkerDepTag = installDependencyTag{name: "dynamic linker"}
reuseObjTag = dependencyTag{name: "reuse objects"}
staticVariantTag = dependencyTag{name: "static variant"}
vndkExtDepTag = dependencyTag{name: "vndk extends"}