Skip to content

Commit f8b51ff

Browse files
keithcopybara-github
authored andcommitted
Remove dead objc setup code
This appears to be unused Closes #12073. RELNOTES[INC]: This removes `--objc_header_scanner_tool`. The flag was primarily used internally, and to our knowledge, a compatible tool was never released. Therefore this flag is believed to be unused. PiperOrigin-RevId: 331152446
1 parent 6186ee2 commit f8b51ff

13 files changed

Lines changed: 3 additions & 200 deletions

src/main/java/com/google/devtools/build/lib/rules/objc/AbstractObjcRuleSet.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ public void init(ConfiguredRuleClassProvider.Builder builder) {
6767
builder.addRuleDefinition(new ObjcRuleClasses.SdkFrameworksDependerRule());
6868
builder.addRuleDefinition(new ObjcRuleClasses.CompileDependencyRule());
6969
builder.addRuleDefinition(new ObjcRuleClasses.XcrunRule());
70-
builder.addRuleDefinition(new ObjcRuleClasses.LibtoolRule());
7170
builder.addRuleDefinition(new ObjcRuleClasses.CrosstoolRule());
7271
builder.addRuleDefinition(new XcodeConfigRule());
7372
builder.addRuleDefinition(new XcodeConfigAliasRule());

src/main/java/com/google/devtools/build/lib/rules/objc/AppleStaticLibrary.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import static com.google.common.collect.ImmutableListMultimap.toImmutableListMultimap;
1818
import static com.google.devtools.build.lib.rules.objc.ObjcProvider.MULTI_ARCH_LINKED_ARCHIVES;
1919

20-
import com.google.common.annotations.VisibleForTesting;
2120
import com.google.common.base.Optional;
2221
import com.google.common.collect.ImmutableList;
2322
import com.google.common.collect.ImmutableListMultimap;
@@ -58,10 +57,6 @@ public class AppleStaticLibrary implements RuleConfiguredTargetFactory {
5857
ImmutableSet.<Key<?>>of(
5958
ObjcProvider.SDK_DYLIB, ObjcProvider.SDK_FRAMEWORK, ObjcProvider.WEAK_SDK_FRAMEWORK);
6059

61-
@VisibleForTesting
62-
static final String UNSUPPORTED_PLATFORM_TYPE_ERROR_FORMAT =
63-
"Unsupported platform type \"%s\"";
64-
6560
@Override
6661
public final ConfiguredTarget create(RuleContext ruleContext)
6762
throws InterruptedException, RuleErrorException, ActionConflictException {

src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,6 @@ public static final FilesToRunProvider xcrunwrapper(RuleContext ruleContext) {
214214
return ruleContext.getExecutablePrerequisite("$xcrunwrapper");
215215
}
216216

217-
/** Returns the location of the libtool tool. */
218-
public static final FilesToRunProvider libtool(RuleContext ruleContext) {
219-
return ruleContext.getExecutablePrerequisite(ObjcRuleClasses.LIBTOOL_ATTRIBUTE);
220-
}
221-
222217
/**
223218
* Files which can be instrumented along with the attributes in which they may occur and the
224219
* attributes along which they are propagated from dependencies (via {@link

src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcAspect.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,6 @@ public AspectDefinition getDefinition(AspectParameters aspectParameters) {
203203
.cfg(HostTransition.createFactory())
204204
.exec()
205205
.value(Label.parseAbsoluteUnchecked(toolsRepository + "//tools/objc:xcrunwrapper")))
206-
.add(
207-
attr(ObjcRuleClasses.LIBTOOL_ATTRIBUTE, LABEL)
208-
.cfg(HostTransition.createFactory())
209-
.exec()
210-
.value(Label.parseAbsoluteUnchecked(toolsRepository + "//tools/objc:libtool")))
211206
.add(
212207
attr(XcodeConfigRule.XCODE_CONFIG_ATTR_NAME, LABEL)
213208
.allowedRuleClasses("xcode_config")

src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcLibraryRule.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ public Metadata getMetadata() {
9696
.ancestors(
9797
J2ObjcLibraryBaseRule.class,
9898
ObjcRuleClasses.CrosstoolRule.class,
99-
ObjcRuleClasses.LibtoolRule.class,
10099
ObjcRuleClasses.XcrunRule.class)
101100
.build();
102101
}

src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommandLineOptions.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -225,17 +225,6 @@ public class ObjcCommandLineOptions extends FragmentOptions {
225225
help = "Whether to perform include scanning for objective C/C++.")
226226
public boolean scanIncludes;
227227

228-
@Option(
229-
name = "objc_header_scanner_tool",
230-
defaultValue = "@bazel_tools//tools/objc:header_scanner",
231-
converter = LabelConverter.class,
232-
documentationCategory = OptionDocumentationCategory.TOOLCHAIN,
233-
effectTags = {OptionEffectTag.CHANGES_INPUTS},
234-
help =
235-
"Location of tool to scan Objective-C code for inclusions and output a .headers_list "
236-
+ "file.")
237-
public Label objcHeaderScannerTool;
238-
239228
@Option(
240229
name = "apple_sdk",
241230
defaultValue = "null",

src/main/java/com/google/devtools/build/lib/rules/objc/ObjcConfiguration.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import com.google.devtools.build.lib.analysis.config.CompilationMode;
2121
import com.google.devtools.build.lib.analysis.config.CoreOptions;
2222
import com.google.devtools.build.lib.analysis.config.Fragment;
23-
import com.google.devtools.build.lib.cmdline.Label;
2423
import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
2524
import com.google.devtools.build.lib.rules.apple.ApplePlatform.PlatformType;
2625
import com.google.devtools.build.lib.rules.apple.DottedVersion;
@@ -66,7 +65,6 @@ public class ObjcConfiguration extends Fragment implements ObjcConfigurationApi<
6665
private final boolean enableAppleBinaryNativeProtos;
6766
private final HeaderDiscovery.DotdPruningMode dotdPruningPlan;
6867
private final boolean shouldScanIncludes;
69-
private final Label appleSdk;
7068
private final boolean compileInfoMigration;
7169

7270
ObjcConfiguration(
@@ -96,7 +94,6 @@ public class ObjcConfiguration extends Fragment implements ObjcConfigurationApi<
9694
? HeaderDiscovery.DotdPruningMode.USE
9795
: HeaderDiscovery.DotdPruningMode.DO_NOT_USE;
9896
this.shouldScanIncludes = objcOptions.scanIncludes;
99-
this.appleSdk = objcOptions.appleSdk;
10097
this.compileInfoMigration = objcOptions.incompatibleObjcCompileInfoMigration;
10198
}
10299

@@ -257,11 +254,6 @@ public boolean shouldScanIncludes() {
257254
return shouldScanIncludes;
258255
}
259256

260-
/** Returns the label for the Apple SDK for current build configuration. */
261-
public Label getAppleSdk() {
262-
return appleSdk;
263-
}
264-
265257
/** Whether native rules can assume compile info has been migrated to CcInfo. */
266258
public boolean compileInfoMigration() {
267259
return compileInfoMigration;

src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,6 @@
5959
* Shared rule classes and associated utility code for Objective-C rules.
6060
*/
6161
public class ObjcRuleClasses {
62-
63-
/**
64-
* Name of the attribute used for implicit dependency on the libtool wrapper.
65-
*/
66-
public static final String LIBTOOL_ATTRIBUTE = "$libtool";
67-
/** Name of attribute used for implicit dependency on the apple SDKs. */
68-
public static final String APPLE_SDK_ATTRIBUTE = ":apple_sdk";
69-
7062
static final String LIPO = "lipo";
7163
static final String STRIP = "strip";
7264

@@ -510,37 +502,12 @@ public Metadata getMetadata() {
510502
BaseRuleClasses.RuleBase.class,
511503
CompileDependencyRule.class,
512504
CoptsRule.class,
513-
LibtoolRule.class,
514505
XcrunRule.class,
515506
CrosstoolRule.class)
516507
.build();
517508
}
518509
}
519510

520-
/**
521-
* Common attributes for {@code objc_*} rules that need to call libtool.
522-
*/
523-
public static class LibtoolRule implements RuleDefinition {
524-
@Override
525-
public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env) {
526-
return builder
527-
.add(
528-
attr(LIBTOOL_ATTRIBUTE, LABEL)
529-
.cfg(HostTransition.createFactory())
530-
.exec()
531-
.value(env.getToolsLabel("//tools/objc:libtool")))
532-
.build();
533-
}
534-
@Override
535-
public Metadata getMetadata() {
536-
return RuleDefinition.Metadata.builder()
537-
.name("$objc_libtool_rule")
538-
.type(RuleClassType.ABSTRACT)
539-
.ancestors(XcrunRule.class)
540-
.build();
541-
}
542-
}
543-
544511
/**
545512
* Common attributes for {@code objc_*} rules that can optionally be set to {@code alwayslink}.
546513
*/
@@ -786,8 +753,7 @@ public Metadata getMetadata() {
786753
BaseRuleClasses.RuleBase.class,
787754
CppRuleClasses.CcIncludeScanningRule.class,
788755
XcrunRule.class,
789-
SdkFrameworksDependerRule.class,
790-
LibtoolRule.class)
756+
SdkFrameworksDependerRule.class)
791757
.build();
792758
}
793759
}

tools/objc/BUILD

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package(default_visibility = ["//visibility:public"])
2-
31
load("@rules_cc//cc:defs.bzl", "objc_library")
42

3+
package(default_visibility = ["//visibility:public"])
4+
55
# Files which shouldn't be publicly visible and dependencies of all objc_* or ios_* rules shouldn't be in this package.
66
exports_files(glob(["**"]))
77

@@ -10,35 +10,11 @@ filegroup(
1010
srcs = glob(["**"]),
1111
)
1212

13-
sh_binary(
14-
name = "libtool",
15-
srcs = [":libtool.sh"],
16-
data = [
17-
":make_hashed_objlist.py",
18-
":xcrunwrapper",
19-
],
20-
)
21-
2213
sh_binary(
2314
name = "xcrunwrapper",
2415
srcs = [":xcrunwrapper.sh"],
2516
)
2617

27-
filegroup(
28-
name = "xctest_infoplist",
29-
srcs = ["XCTest-Info.plist"],
30-
)
31-
32-
filegroup(
33-
name = "gcov",
34-
srcs = [":gcov_stub"],
35-
)
36-
37-
filegroup(
38-
name = "mcov",
39-
srcs = [":mcov_stub"],
40-
)
41-
4218
xcode_config(
4319
name = "host_xcodes",
4420
)
@@ -60,11 +36,6 @@ filegroup(
6036
srcs = ["protobuf_compiler_wrapper.sh"],
6137
)
6238

63-
filegroup(
64-
name = "protobuf_compiler",
65-
srcs = ["protobuf_compiler.py"],
66-
)
67-
6839
filegroup(
6940
name = "protobuf_compiler_support",
7041
srcs = ["protobuf_support"],
@@ -74,9 +45,3 @@ filegroup(
7445
name = "protobuf_well_known_types",
7546
srcs = ["dummy.proto"],
7647
)
77-
78-
# Intentionally empty
79-
filegroup(
80-
name = "header_scanner",
81-
srcs = [],
82-
)

tools/objc/XCTest-Info.plist

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)