diff --git a/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java b/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java index aae8a7a69f89d2..5d7324634f293b 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java @@ -1269,8 +1269,11 @@ public Object call(StarlarkThread thread, Tuple args, Dict kwarg currentRuleClass.getName(), attr, value, - // Reify to the location of the initializer definition - currentRuleClass.getLabelConverterForInitializer()); + // Reify to the location of the initializer definition (except for outputs) + attr.getType() == BuildType.OUTPUT + || attr.getType() == BuildType.OUTPUT_LIST + ? pkgBuilder.getLabelConverter() + : currentRuleClass.getLabelConverterForInitializer()); kwargs.putEntry(nativeName, reifiedValue); } }