Add required configuration fragments for platform rules.
@@ -18,6 +18,7 @@ import static com.google.devtools.build.lib.packages.Attribute.attr;
import com.google.common.collect.ImmutableList;
import com.google.devtools.build.lib.analysis.BaseRuleClasses;
+import com.google.devtools.build.lib.analysis.PlatformConfiguration;
import com.google.devtools.build.lib.analysis.RuleDefinition;
import com.google.devtools.build.lib.analysis.RuleDefinitionEnvironment;
import com.google.devtools.build.lib.packages.RuleClass;
@@ -33,6 +34,7 @@ public class PlatformBaseRule implements RuleDefinition{
@Override
public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env) {
return builder
+ .requiresConfigurationFragments(PlatformConfiguration.class)
.override(
attr("tags", Type.STRING_LIST)
// No need to show up in ":all", etc. target patterns.
