diff --git a/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrModule.java b/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrModule.java index 9230f66ca98a7a..db1048f9f0d9b0 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrModule.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrModule.java @@ -330,7 +330,7 @@ private static ImmutableList> getProvid for (Object o : starlarkList) { if (!(o instanceof Sequence)) { - throw Starlark.errorf(errorMsg, PROVIDERS_ARG, "an element of type " + Starlark.type(o)); + throw Starlark.errorf(errorMsg, argumentName, "an element of type " + Starlark.type(o)); } for (Object value : (Sequence) o) { if (!isProvider(value)) { diff --git a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkRuleFunctionsApi.java b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkRuleFunctionsApi.java index 2a82a6ee45632b..9a8467fc01a830 100644 --- a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkRuleFunctionsApi.java +++ b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkRuleFunctionsApi.java @@ -447,9 +447,10 @@ StarlarkCallable rule( defaultValue = "[]", doc = "This attribute allows this aspect to inspect other aspects. The value must be a " - + "list containing individual providers or lists of providers. For example, " - + "[FooInfo, BarInfo, [BazInfo, QuxInfo]] is a " - + "valid value." + + "list containing either individual providers or lists of providers but not " + + "both. For example, [[FooInfo], [BarInfo], [BazInfo, QuxInfo]] " + + "is a valid value while [FooInfo, BarInfo, [BazInfo, QuxInfo]] " + + "is not valid." + "" + "

An unnested list of providers will automatically be converted to a list " + "containing one list of providers. That is, " @@ -459,8 +460,8 @@ StarlarkCallable rule( + "

To make another aspect (e.g. other_aspect) visible to this " + "aspect, other_aspect must provide all providers from at least " + "one of the lists. In the example of " - + "[FooInfo, BarInfo, [BazInfo, QuxInfo]], this aspect can only " - + "see other_aspect if and only if other_aspect " + + "[[FooInfo], [BarInfo], [BazInfo, QuxInfo]], this aspect can " + + "only see other_aspect if and only if other_aspect " + "provides FooInfo *or* BarInfo *or* both " + "BazInfo *and* QuxInfo."), @Param(name = "provides", named = true, defaultValue = "[]", doc = PROVIDES_DOC),