diff --git a/src/main/java/com/google/devtools/build/lib/packages/RuleVisibility.java b/src/main/java/com/google/devtools/build/lib/packages/RuleVisibility.java index 3b93a041560b38..1fb555c1e5e657 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/RuleVisibility.java +++ b/src/main/java/com/google/devtools/build/lib/packages/RuleVisibility.java @@ -34,20 +34,20 @@ public interface RuleVisibility { /** - * Returns the list of labels that need to be loaded so that the visibility decision can be made - * during analysis time. E.g. for package group visibility, this is the list of package groups - * referenced. Does not include labels that have special meanings in the visibility declaration, - * e.g. "//visibility:*" or "//*:__pkg__". + * Returns the list of all labels comprising this visibility. + * + *

This includes labels that are not loadable, such as //visibility:public and //foo:__pkg__. */ - List

I.e., this returns the labels of the top-level {@code package_group}s that must be loaded in + * order to determine the complete set of packages represented by this visibility. (Additional + * {@code package_group}s may need to be loaded due to their {@code includes} attribute.) */ - List

If {@code element} is already present in {@code visibility}, the result is just {@code + * visibility}. + * * @throws EvalException if there's a problem parsing {@code element} into a visibility */ static RuleVisibility concatWithElement(RuleVisibility visibility, Label element) @@ -175,10 +178,15 @@ static RuleVisibility concatWithElement(RuleVisibility visibility, Label element // Public is idempotent. return RuleVisibility.PUBLIC; } else { - ImmutableList.Builder