From dc6492f01bbfb4a0f3e10efe6fa8e7cb5a876982 Mon Sep 17 00:00:00 2001 From: Jihoon Kang Date: Fri, 11 Oct 2024 00:21:57 +0000 Subject: Set the appropriate deps property for the soong generated fs modules This change: - Adds a pre-deps bottom-up mutator that sets the appropriate deps properties for the soong generate filesystem partition modules - Makes `installInSysem` more genenric, so that it can be used for other partitions - Introduces `AppendDepsEntries` method in `android.PackagingBase` to utilize it in the aforementioned mutator - Modifies `fsDeps` from a 1D slice to a map (of partition to deps slice) Test: m nothing --no-skip-soong-tests Bug: 372771060 Change-Id: Ic251993d1d4c1caca544c5cebcaf29afd749da9e --- filesystem/filesystem.go | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'filesystem') diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go index 1e816a752..7d3b8e108 100644 --- a/filesystem/filesystem.go +++ b/filesystem/filesystem.go @@ -145,6 +145,10 @@ type FilesystemProperties struct { Unchecked_module *bool `blueprint:"mutated"` Erofs ErofsProperties + + // Determines if the module is auto-generated from Soong or not. If the module is + // auto-generated, its deps are exempted from visibility enforcement. + Is_auto_generated *bool } // Additional properties required to generate erofs FS partitions. @@ -179,13 +183,29 @@ func initFilesystemModule(module android.DefaultableModule, filesystemModule *fi android.InitDefaultableModule(module) } -var dependencyTag = struct { +type depTag struct { blueprint.BaseDependencyTag android.PackagingItemAlwaysDepTag -}{} +} + +var dependencyTag = depTag{} + +type depTagWithVisibilityEnforcementBypass struct { + depTag +} + +var _ android.ExcludeFromVisibilityEnforcementTag = (*depTagWithVisibilityEnforcementBypass)(nil) + +func (t depTagWithVisibilityEnforcementBypass) ExcludeFromVisibilityEnforcement() {} + +var dependencyTagWithVisibilityEnforcementBypass = depTagWithVisibilityEnforcementBypass{} func (f *filesystem) DepsMutator(ctx android.BottomUpMutatorContext) { - f.AddDeps(ctx, dependencyTag) + if proptools.Bool(f.properties.Is_auto_generated) { + f.AddDeps(ctx, dependencyTagWithVisibilityEnforcementBypass) + } else { + f.AddDeps(ctx, dependencyTag) + } } type fsType int -- cgit v1.2.3-59-g8ed1b