From e9fe2949b887deba2b46b2a8c043f228a95e99e3 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 10 Nov 2020 18:12:15 -0800 Subject: Annotate dependency tags for dependencies of installed files Relands Ic22603a5c0718b5a21686672a7471f952b4d1017 with a minor change to track libc++ dependencies for python hosts and after a fix to an internal genrule that depended on transitively installed java libraries (ag/13068670). Soong currently assumes that installed files should depend on installed files of all transitive dependencies, which results in extra installed file dependencies through genrules, static libs, etc. Annotate dependency tags for dependencies for which the installed files are necessary such as shared libraries and JNI libraries. This avoids extra installed files, and is also a first step towards genrules using their own copy of tools instead of the installed copy. Bug: 124313442 Test: m checkbuild Test: java.TestBinary Test: cc.TestInstallSharedLibs Test: deptag_test.go Change-Id: I725871249d561428e6f67bba6a7c65b580012b72 --- python/python.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'python/python.go') diff --git a/python/python.go b/python/python.go index e4c8e9481..456e1670e 100644 --- a/python/python.go +++ b/python/python.go @@ -214,10 +214,16 @@ type dependencyTag struct { name string } +type installDependencyTag struct { + blueprint.BaseDependencyTag + android.InstallAlwaysNeededDependencyTag + name string +} + var ( pythonLibTag = dependencyTag{name: "pythonLib"} launcherTag = dependencyTag{name: "launcher"} - launcherSharedLibTag = dependencyTag{name: "launcherSharedLib"} + launcherSharedLibTag = installDependencyTag{name: "launcherSharedLib"} pyIdentifierRegexp = regexp.MustCompile(`^[a-zA-Z_][a-zA-Z0-9_-]*$`) pyExt = ".py" protoExt = ".proto" @@ -328,6 +334,7 @@ func (p *Module) DepsMutator(ctx android.BottomUpMutatorContext) { // cannot read the property at this stage and it will be too late to add // dependencies later. ctx.AddFarVariationDependencies(ctx.Target().Variations(), launcherSharedLibTag, "libsqlite") + ctx.AddFarVariationDependencies(ctx.Target().Variations(), launcherSharedLibTag, "libc++") if ctx.Target().Os.Bionic() { ctx.AddFarVariationDependencies(ctx.Target().Variations(), launcherSharedLibTag, -- cgit v1.2.3-59-g8ed1b