Remove the orphaned AppleDylibBinary and AppleLoadableBundleBinary providers.
At one time, these were part of the implementation of the apple_binary rule, but the rules_apple equivalent no longer relies on these.
PiperOrigin-RevId: 443132305
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/AppleDylibBinaryInfo.java b/src/main/java/com/google/devtools/build/lib/rules/objc/AppleDylibBinaryInfo.java
deleted file mode 100644
index abf5ad2..0000000
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/AppleDylibBinaryInfo.java
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright 2017 The Bazel Authors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.google.devtools.build.lib.rules.objc;
-
-import com.google.devtools.build.lib.actions.Artifact;
-import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
-import com.google.devtools.build.lib.packages.BuiltinProvider;
-import com.google.devtools.build.lib.packages.NativeInfo;
-import com.google.devtools.build.lib.starlarkbuildapi.apple.AppleDylibBinaryApi;
-
-/**
- * Provider containing the executable binary output that was built using an apple_binary target with
- * the 'dylib' type. This provider contains:
- *
- * <ul>
- * <li>'binary': The dylib artifact output by apple_binary
- * <li>'objc': An {@link ObjcProvider} which contains information about the transitive
- * dependencies linked into the dylib, (intended so that binaries depending on this dylib may
- * avoid relinking symbols included in the dylib
- * </ul>
- */
-@Immutable
-public final class AppleDylibBinaryInfo extends NativeInfo implements AppleDylibBinaryApi {
-
- /** Starlark name for the AppleDylibBinaryInfo. */
- public static final String STARLARK_NAME = "AppleDylibBinary";
-
- /** Starlark constructor and identifier for AppleDylibBinaryInfo. */
- public static final BuiltinProvider<AppleDylibBinaryInfo> STARLARK_CONSTRUCTOR =
- new BuiltinProvider<AppleDylibBinaryInfo>(STARLARK_NAME, AppleDylibBinaryInfo.class) {};
-
- private final Artifact dylibBinary;
- private final ObjcProvider depsObjcProvider;
-
- public AppleDylibBinaryInfo(Artifact dylibBinary,
- ObjcProvider depsObjcProvider) {
- this.dylibBinary = dylibBinary;
- this.depsObjcProvider = depsObjcProvider;
- }
-
- @Override
- public BuiltinProvider<AppleDylibBinaryInfo> getProvider() {
- return STARLARK_CONSTRUCTOR;
- }
-
- /**
- * Returns the multi-architecture dylib binary that apple_binary created.
- */
- @Override
- public Artifact getAppleDylibBinary() {
- return dylibBinary;
- }
-
- /**
- * Returns the {@link ObjcProvider} which contains information about the transitive dependencies
- * linked into the dylib.
- */
- @Override
- public ObjcProvider getDepsObjcProvider() {
- return depsObjcProvider;
- }
-}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/AppleLoadableBundleBinaryInfo.java b/src/main/java/com/google/devtools/build/lib/rules/objc/AppleLoadableBundleBinaryInfo.java
deleted file mode 100644
index d1cd780..0000000
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/AppleLoadableBundleBinaryInfo.java
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2017 The Bazel Authors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.google.devtools.build.lib.rules.objc;
-
-import com.google.devtools.build.lib.actions.Artifact;
-import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
-import com.google.devtools.build.lib.packages.BuiltinProvider;
-import com.google.devtools.build.lib.packages.NativeInfo;
-import com.google.devtools.build.lib.starlarkbuildapi.apple.AppleLoadableBundleBinaryApi;
-
-/**
- * Provider containing the executable binary output that was built using an apple_binary target with
- * the 'loadable_bundle' type. This provider contains:
- *
- * <ul>
- * <li>'binary': The binary artifact output by apple_binary
- * <li>'objc': An {@link ObjcProvider} which contains information about the transitive
- * dependencies linked into the binary.
- * </ul>
- */
-@Immutable
-public final class AppleLoadableBundleBinaryInfo extends NativeInfo
- implements AppleLoadableBundleBinaryApi {
-
- /** Starlark name for the AppleLoadableBundleBinary. */
- public static final String STARLARK_NAME = "AppleLoadableBundleBinary";
-
- /** Starlark constructor and identifier for AppleLoadableBundleBinary. */
- public static final BuiltinProvider<AppleLoadableBundleBinaryInfo> STARLARK_CONSTRUCTOR =
- new BuiltinProvider<AppleLoadableBundleBinaryInfo>(
- STARLARK_NAME, AppleLoadableBundleBinaryInfo.class) {};
-
- private final Artifact appleLoadableBundleBinary;
- private final ObjcProvider depsObjcProvider;
-
- /**
- * Creates a new AppleLoadableBundleBinaryInfo provider that propagates the given apple_binary
- * configured as a loadable bundle binary.
- */
- public AppleLoadableBundleBinaryInfo(Artifact appleLoadableBundleBinary,
- ObjcProvider depsObjcProvider) {
- this.appleLoadableBundleBinary = appleLoadableBundleBinary;
- this.depsObjcProvider = depsObjcProvider;
- }
-
- @Override
- public BuiltinProvider<AppleLoadableBundleBinaryInfo> getProvider() {
- return STARLARK_CONSTRUCTOR;
- }
-
- /**
- * Returns the multi-architecture binary that apple_binary created.
- */
- @Override
- public Artifact getAppleLoadableBundleBinary() {
- return appleLoadableBundleBinary;
- }
-
- /**
- * Returns the {@link ObjcProvider} which contains information about the transitive dependencies
- * linked into the dylib.
- */
- @Override
- public ObjcProvider getDepsObjcProvider() {
- return depsObjcProvider;
- }
-}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/AppleStarlarkCommon.java b/src/main/java/com/google/devtools/build/lib/rules/objc/AppleStarlarkCommon.java
index cfaff6d..cc82a71 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/AppleStarlarkCommon.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/AppleStarlarkCommon.java
@@ -145,11 +145,6 @@
}
@Override
- public Provider getAppleDylibBinaryConstructor() {
- return AppleDylibBinaryInfo.STARLARK_CONSTRUCTOR;
- }
-
- @Override
public Provider getAppleExecutableBinaryConstructor() {
return AppleExecutableBinaryInfo.STARLARK_CONSTRUCTOR;
}
@@ -165,11 +160,6 @@
}
@Override
- public Provider getAppleLoadableBundleBinaryConstructor() {
- return AppleLoadableBundleBinaryInfo.STARLARK_CONSTRUCTOR;
- }
-
- @Override
public ImmutableMap<String, String> getAppleHostSystemEnv(XcodeConfigInfo xcodeConfig) {
return AppleConfiguration.getXcodeVersionEnv(xcodeConfig.getXcodeVersion());
}
diff --git a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/apple/AppleCommonApi.java b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/apple/AppleCommonApi.java
index 53d585c..acb150e 100644
--- a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/apple/AppleCommonApi.java
+++ b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/apple/AppleCommonApi.java
@@ -143,18 +143,6 @@
ProviderApi getAppleDynamicFrameworkConstructor();
@StarlarkMethod(
- name = "AppleDylibBinary",
- doc =
- "The constructor/key for the <code>AppleDylibBinary</code> provider.<p>If a target"
- + " propagates the <code>AppleDylibBinary</code> provider, use this as the key with"
- + " which to retrieve it. Example:<br><pre class='language-python'>\n"
- + "dep = ctx.attr.deps[0]\n"
- + "p = dep[apple_common.AppleDylibBinary]\n"
- + "</pre>",
- structField = true)
- ProviderApi getAppleDylibBinaryConstructor();
-
- @StarlarkMethod(
name = "AppleExecutableBinary",
doc =
"The constructor/key for the <code>AppleExecutableBinary</code> provider.<p>"
@@ -193,19 +181,6 @@
ProviderApi getAppleDebugOutputsConstructor();
@StarlarkMethod(
- name = "AppleLoadableBundleBinary",
- doc =
- "The constructor/key for the <code>AppleLoadableBundleBinary</code> provider.<p>"
- + "If a target propagates the <code>AppleLoadableBundleBinary</code> provider, "
- + "use this as the key with which to retrieve it. Example:<br>"
- + "<pre class='language-python'>\n"
- + "dep = ctx.attr.deps[0]\n"
- + "p = dep[apple_common.AppleLoadableBundleBinary]\n"
- + "</pre>",
- structField = true)
- ProviderApi getAppleLoadableBundleBinaryConstructor();
-
- @StarlarkMethod(
name = "apple_host_system_env",
doc =
"Returns a <a href='dict.html'>dict</a> of environment variables that should be set "
diff --git a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/apple/AppleDylibBinaryApi.java b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/apple/AppleDylibBinaryApi.java
deleted file mode 100644
index ad120a4..0000000
--- a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/apple/AppleDylibBinaryApi.java
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2018 The Bazel Authors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.google.devtools.build.lib.starlarkbuildapi.apple;
-
-import com.google.devtools.build.docgen.annot.DocCategory;
-import com.google.devtools.build.lib.starlarkbuildapi.FileApi;
-import com.google.devtools.build.lib.starlarkbuildapi.core.StructApi;
-import net.starlark.java.annot.StarlarkBuiltin;
-import net.starlark.java.annot.StarlarkMethod;
-
-/**
- * A provider containing the executable binary output that was built using an apple_binary target
- * with the 'dylib' type.
- */
-@StarlarkBuiltin(
- name = "AppleDylibBinary",
- category = DocCategory.PROVIDER,
- doc =
- "A provider containing the executable binary output that was built using an apple_binary "
- + "target with the 'dylib' type.")
-public interface AppleDylibBinaryApi extends StructApi {
-
- @StarlarkMethod(
- name = "binary",
- structField = true,
- doc = "The dylib file output by apple_binary.")
- FileApi getAppleDylibBinary();
-
- @StarlarkMethod(
- name = "objc",
- structField = true,
- doc =
- "A provider which contains information about the transitive dependencies linked into "
- + "the dylib, (intended so that binaries depending on this dylib may avoid relinking "
- + "symbols included in the dylib.")
- ObjcProviderApi<?> getDepsObjcProvider();
-}
diff --git a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/apple/AppleLoadableBundleBinaryApi.java b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/apple/AppleLoadableBundleBinaryApi.java
deleted file mode 100644
index 4f0bc6a..0000000
--- a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/apple/AppleLoadableBundleBinaryApi.java
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2018 The Bazel Authors. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.google.devtools.build.lib.starlarkbuildapi.apple;
-
-import com.google.devtools.build.docgen.annot.DocCategory;
-import com.google.devtools.build.lib.starlarkbuildapi.FileApi;
-import com.google.devtools.build.lib.starlarkbuildapi.core.StructApi;
-import net.starlark.java.annot.StarlarkBuiltin;
-import net.starlark.java.annot.StarlarkMethod;
-
-/**
- * A provider containing the executable binary output that was built using an apple_binary target
- * with the 'loadable_bundle' type.
- */
-@StarlarkBuiltin(
- name = "AppleLoadableBundleBinary",
- category = DocCategory.PROVIDER,
- doc =
- "A provider containing the executable binary output that was built using an "
- + "apple_binary target with the 'loadable_bundle' type.")
-public interface AppleLoadableBundleBinaryApi extends StructApi {
-
- @StarlarkMethod(
- name = "binary",
- structField = true,
- doc = "The binary file output by apple_binary.")
- FileApi getAppleLoadableBundleBinary();
-
- @StarlarkMethod(
- name = "objc",
- structField = true,
- doc =
- "A provider which contains information about the transitive dependencies linked into "
- + "the binary.")
- ObjcProviderApi<?> getDepsObjcProvider();
-}
diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/AppleBinaryStarlarkApiTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/AppleBinaryStarlarkApiTest.java
index e475126..fdac442 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/objc/AppleBinaryStarlarkApiTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/objc/AppleBinaryStarlarkApiTest.java
@@ -45,7 +45,6 @@
import com.google.devtools.build.lib.testutil.Scratch;
import com.google.devtools.build.lib.vfs.PathFragment;
import java.io.IOException;
-import java.util.List;
import java.util.Map;
import java.util.Set;
import net.starlark.java.eval.Dict;
@@ -382,7 +381,6 @@
}
@Test
- @SuppressWarnings("unchecked")
public void testProvider_executable() throws Exception {
scratch.file("examples/rule/BUILD");
scratch.file(
@@ -394,7 +392,6 @@
" return MyInfo(",
" binary = provider.binary,",
" objc = provider.objc,",
- " dep_dir = dir(dep),",
" )",
"test_rule = rule(implementation = _test_rule_impl,",
" attrs = {",
@@ -427,10 +424,6 @@
assertThat(myInfo.getValue("binary")).isInstanceOf(Artifact.class);
assertThat(myInfo.getValue("objc")).isInstanceOf(ObjcProvider.class);
-
- List<String> depProviders = (List<String>) myInfo.getValue("dep_dir");
- assertThat(depProviders).doesNotContain("AppleDylibBinary");
- assertThat(depProviders).doesNotContain("AppleLoadableBundleBinary");
}
@Test