summaryrefslogtreecommitdiff
path: root/sdk/update.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2024-09-05 16:41:24 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-09-05 16:41:24 +0000
commit3bdb2b5274e4715a77ec387351d4c82167ed91f7 (patch)
tree6aff9fb8b6162e5be7e318f074632d594c392c23 /sdk/update.go
parentb379955f0eb571b8ce603242513a7dfc5916e9d8 (diff)
parent2c20726d44708bdb739f4cd67e0d20332315fc8e (diff)
Merge "Change visibility of module sdk prebuilts to //visibility:public" into main
Diffstat (limited to 'sdk/update.go')
-rw-r--r--sdk/update.go30
1 files changed, 16 insertions, 14 deletions
diff --git a/sdk/update.go b/sdk/update.go
index e1b363a89..9379f36cb 100644
--- a/sdk/update.go
+++ b/sdk/update.go
@@ -1109,20 +1109,22 @@ func (s *snapshotBuilder) AddPrebuiltModule(member android.SdkMember, moduleType
// same package so can be marked as private.
m.AddProperty("visibility", []string{"//visibility:private"})
} else {
- // Extract visibility information from a member variant. All variants have the same
- // visibility so it doesn't matter which one is used.
- visibilityRules := android.EffectiveVisibilityRules(s.ctx, variant)
-
- // Add any additional visibility rules needed for the prebuilts to reference each other.
- err := visibilityRules.Widen(s.sdk.properties.Prebuilt_visibility)
- if err != nil {
- s.ctx.PropertyErrorf("prebuilt_visibility", "%s", err)
- }
-
- visibility := visibilityRules.Strings()
- if len(visibility) != 0 {
- m.AddProperty("visibility", visibility)
- }
+ // Change the visibility of the module SDK prebuilts to public.
+ // This includes
+ // 1. Stub libraries of `sdk` modules
+ // 2. Binaries and libraries of `module_exports` modules
+ //
+ // This is a workaround to improve maintainlibility of the module SDK.
+ // Since module sdks are generated from release branches and dropped to development
+ // branches, there might be a visibility skew between the sources and prebuilts
+ // of a specific module.
+ // To reconcile this potential skew, change the visibility to public
+ //
+ // This is safe for (1) since these are stub libraries.
+ // This is ok for (2) since these are host and test exports and are intended for
+ // ART development.
+ // TODO (b/361303067): This can be removed if ART uses full manifests.
+ m.AddProperty("visibility", []string{"//visibility:public"})
}
// Where available copy apex_available properties from the member.