Remove the null lipo context collector from the objc rules, which do not use LIPO. Remove the check that requires a context collector to be present.
PiperOrigin-RevId: 170341259
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibraryHelper.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibraryHelper.java
index 371690a..166ee77 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibraryHelper.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibraryHelper.java
@@ -47,7 +47,6 @@
import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
import com.google.devtools.build.lib.collect.nestedset.Order;
import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
-import com.google.devtools.build.lib.packages.BuildType;
import com.google.devtools.build.lib.packages.RuleClass.ConfiguredTargetFactory.RuleErrorException;
import com.google.devtools.build.lib.rules.cpp.CcToolchainFeatures.FeatureConfiguration;
import com.google.devtools.build.lib.rules.cpp.CcToolchainFeatures.Variables.VariablesExtension;
@@ -933,13 +932,6 @@
* @throws RuleErrorException
*/
public Info build() throws RuleErrorException, InterruptedException {
- // Fail early if there is no lipo context collector on the rule - otherwise we end up failing
- // in lipo optimization.
- Preconditions.checkState(
- // 'cc_inc_library' rules do not compile, and thus are not affected by LIPO.
- ruleContext.getRule().getRuleClass().equals("cc_inc_library")
- || ruleContext.isAttrDefined(":lipo_context_collector", BuildType.LABEL));
-
if (checkDepsGenerateCpp) {
for (LanguageDependentFragment dep :
AnalysisUtils.getProviders(deps, LanguageDependentFragment.class)) {
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcAspect.java b/src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcAspect.java
index 87c24ab..5cda226 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcAspect.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcAspect.java
@@ -216,14 +216,6 @@
Label.parseAbsoluteUnchecked(
toolsRepository + "//tools/j2objc:j2objc_proto_blacklist"))))
.add(attr(":j2objc_cc_toolchain", LABEL).value(ObjcRuleClasses.APPLE_TOOLCHAIN))
- .add(
- // Objc builds do not use a lipo context collector, but must specify the attribute as
- // a late-bound attribute to match with the similar attribute on the cc rules.
- // TODO(b/28084560): Allow :lipo_context_collector not to be set instead of having a
- // null instance.
- attr(":lipo_context_collector", LABEL)
- .value(LateBoundDefault.alwaysNull())
- .skipPrereqValidatorCheck())
.build();
}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java
index e292f00..c27e52a 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java
@@ -524,14 +524,6 @@
.add(
attr(CcToolchain.CC_TOOLCHAIN_TYPE_ATTRIBUTE_NAME, LABEL)
.value(CppRuleClasses.ccToolchainTypeAttribute(env)))
- .add(
- // Objc builds do not use a lipo context collector, but must specify the attribute as
- // a late-bound attribute to match with the similar attribute on the cc rules.
- // TODO(b/28084560): Allow :lipo_context_collector not to be set instead of having a
- // null instance.
- attr(":lipo_context_collector", LABEL)
- .value(LateBoundDefault.alwaysNull())
- .skipPrereqValidatorCheck())
.addRequiredToolchains(
ImmutableList.of(CppHelper.getCcToolchainType(env.getToolsRepository())))
.build();