Make CompilationSupport use the specified CcToolchainProvider even if the :cc_toolchain implicit attributes are not available.
RELNOTES: Banana.
@@ -725,19 +725,12 @@ public class CompilationSupport {
this.outputGroupCollector = outputGroupCollector;
this.objectFilesCollector = objectFilesCollector;
this.usePch = usePch;
- // TODO(b/62143697): Remove this check once all rules are using the crosstool support.
- if (ruleContext
- .attributes()
- .has(CcToolchain.CC_TOOLCHAIN_DEFAULT_ATTRIBUTE_NAME, BuildType.LABEL)
- || ruleContext.attributes().has(":j2objc_cc_toolchain", BuildType.LABEL)) {
- if (toolchain == null) {
+ if (toolchain == null && ruleContext.attributes().has(
+ CcToolchain.CC_TOOLCHAIN_DEFAULT_ATTRIBUTE_NAME, BuildType.LABEL)) {
toolchain = CppHelper.getToolchainUsingDefaultCcToolchainAttribute(ruleContext);
}
+
this.toolchain = toolchain;
- } else {
- // Since the rule context doesn't have a toolchain at all, ignore any provided override.
- this.toolchain = null;
- }
}
/** Builder for {@link CompilationSupport} */
