Merge changes from topic "reland_embedded_jni" into main

* changes:
  Install transitive deps of jni libs, but not the jni libs themselves
  Add SkipToTransitiveDepsTag interface for dependency tags
  Revert "Revert "Collect transitve deps of jni libs only for bund..."
  Revert^2 "Always embed jni libs and store uncompressed"
This commit is contained in:
Jiyong Park
2024-05-10 22:53:08 +00:00
committed by Gerrit Code Review
10 changed files with 173 additions and 200 deletions

View File

@@ -1470,15 +1470,27 @@ func (m *ModuleBase) computeInstallDeps(ctx ModuleContext) ([]*DepSet[InstallPat
var installDeps []*DepSet[InstallPath]
var packagingSpecs []*DepSet[PackagingSpec]
ctx.VisitDirectDeps(func(dep Module) {
if isInstallDepNeeded(dep, ctx.OtherModuleDependencyTag(dep)) {
depTag := ctx.OtherModuleDependencyTag(dep)
// If this is true, the direct outputs from the module is not gathered, but its
// transitive deps are still gathered.
skipToTransitive := IsSkipToTransitiveDepsTag(depTag)
if isInstallDepNeeded(dep, depTag) || skipToTransitive {
// Installation is still handled by Make, so anything hidden from Make is not
// installable.
if !dep.IsHideFromMake() && !dep.IsSkipInstall() {
installDeps = append(installDeps, dep.base().installFilesDepSet)
if skipToTransitive {
installDeps = append(installDeps, dep.base().installFilesDepSet.transitive...)
} else {
installDeps = append(installDeps, dep.base().installFilesDepSet)
}
}
// Add packaging deps even when the dependency is not installed so that uninstallable
// modules can still be packaged. Often the package will be installed instead.
packagingSpecs = append(packagingSpecs, dep.base().packagingSpecsDepSet)
if skipToTransitive {
packagingSpecs = append(packagingSpecs, dep.base().packagingSpecsDepSet.transitive...)
} else {
packagingSpecs = append(packagingSpecs, dep.base().packagingSpecsDepSet)
}
}
})