summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jooyung Han <jooyung@google.com> 2021-07-23 02:49:46 +0900
committer Jooyung Han <jooyung@google.com> 2021-07-27 19:26:10 +0900
commit8707cd74bf083fe4a31e5f5aa5e74bd2a47e9e58 (patch)
treee3302205e1f1988c997c6fd4e672f44dedb3813d
parent2695e20d571a1e99c716433b568b34b3243c2465 (diff)
TransitivePackagingSpecs should follow "installable" deps
Gathering packaging items from "SkipInstall" deps doesn't make sense. Bug: 194403710 Test: soong test Test: m microdroid # microdroid shouldn't have libandroidicu Change-Id: If6c3ee82d588e2742c85cef7244c090c93f38b8e
-rw-r--r--android/module.go2
-rw-r--r--android/packaging_test.go35
2 files changed, 35 insertions, 2 deletions
diff --git a/android/module.go b/android/module.go
index 84e78d1d5..5e2e06aa0 100644
--- a/android/module.go
+++ b/android/module.go
@@ -1529,7 +1529,7 @@ func (m *ModuleBase) computeInstallDeps(ctx ModuleContext) ([]*installPathsDepSe
var installDeps []*installPathsDepSet
var packagingSpecs []*packagingSpecsDepSet
ctx.VisitDirectDeps(func(dep Module) {
- if IsInstallDepNeeded(ctx.OtherModuleDependencyTag(dep)) && !dep.IsHideFromMake() {
+ if IsInstallDepNeeded(ctx.OtherModuleDependencyTag(dep)) && !dep.IsHideFromMake() && !dep.IsSkipInstall() {
installDeps = append(installDeps, dep.base().installFilesDepSet)
packagingSpecs = append(packagingSpecs, dep.base().packagingSpecsDepSet)
}
diff --git a/android/packaging_test.go b/android/packaging_test.go
index f91dc5dc6..ff7446cb6 100644
--- a/android/packaging_test.go
+++ b/android/packaging_test.go
@@ -18,13 +18,15 @@ import (
"testing"
"github.com/google/blueprint"
+ "github.com/google/blueprint/proptools"
)
// Module to be packaged
type componentTestModule struct {
ModuleBase
props struct {
- Deps []string
+ Deps []string
+ Skip_install *bool
}
}
@@ -49,6 +51,9 @@ func (m *componentTestModule) GenerateAndroidBuildActions(ctx ModuleContext) {
builtFile := PathForModuleOut(ctx, m.Name())
dir := ctx.Target().Arch.ArchType.Multilib
installDir := PathForModuleInstall(ctx, dir)
+ if proptools.Bool(m.props.Skip_install) {
+ m.SkipInstall()
+ }
ctx.InstallFile(installDir, m.Name(), builtFile)
}
@@ -365,3 +370,31 @@ func TestPackagingBaseSingleTarget(t *testing.T) {
}
`, []string{"lib64/foo"})
}
+
+func TestPackagingWithSkipInstallDeps(t *testing.T) {
+ // package -[dep]-> foo -[dep]-> bar -[dep]-> baz
+ // OK SKIPPED
+ multiTarget := false
+ runPackagingTest(t, multiTarget,
+ `
+ component {
+ name: "foo",
+ deps: ["bar"],
+ }
+
+ component {
+ name: "bar",
+ deps: ["baz"],
+ skip_install: true,
+ }
+
+ component {
+ name: "baz",
+ }
+
+ package_module {
+ name: "package",
+ deps: ["foo"],
+ }
+ `, []string{"lib64/foo"})
+}