Don't error out if cc_toolchain.toolchain_config attribute returns null instead of a CcToolchainConfigInfo
RELNOTES: None.
@@ -51,7 +51,6 @@ import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
import com.google.devtools.build.lib.collect.nestedset.Order;
import com.google.devtools.build.lib.events.Location;
-import com.google.devtools.build.lib.packages.BuildType;
import com.google.devtools.build.lib.packages.License;
import com.google.devtools.build.lib.rules.cpp.CppConfiguration.Tool;
import com.google.devtools.build.lib.rules.cpp.FdoProvider.FdoMode;
@@ -673,16 +672,6 @@ public class CcToolchain implements RuleConfiguredTargetFactory {
} catch (InvalidConfigurationException e) {
throw ruleContext.throwWithRuleError(e.getMessage());
}
- } else {
- ruleContext.attributeError(
- CcToolchainRule.TOOLCHAIN_CONFIG_ATTR,
- String.format(
- "The target '%s' from '%s' attribute does not provide "
- + "a CcToolchainConfigInfo provider",
- CcToolchainRule.TOOLCHAIN_CONFIG_ATTR,
- ruleContext
- .attributes()
- .get(CcToolchainRule.TOOLCHAIN_CONFIG_ATTR, BuildType.LABEL)));
}
}
