Skip to content

Commit

Permalink
Remove apple_common.multi_arch_split
Browse files Browse the repository at this point in the history
Remove the apple_binary and apple_static_library tests. The tests involved hardcoded Starlark implementation of apple_binary that diverged from the implementation that is used.

Add a simple hardcoded implementation of the apple_platform_split_transition to tests. This keep the coverage of objc rules that are in builtins. (Also the implementations of multi_arch_split has diverged from apple_platform_split_transition).

RELNOTES[INC]: Removed multi_arch_split, use transition_support.apple_platform_split_transition from rules_apple instead.

https://github.com/bazelbuild/rules_apple/blob/master/apple/internal/transition_support.bzl#L608

PiperOrigin-RevId: 553171946
Change-Id: I874e8b9e39b291774a74b0192926521a3c88c103
  • Loading branch information
comius authored and Copybara-Service committed Aug 2, 2023
1 parent d993957 commit a76763c
Show file tree
Hide file tree
Showing 15 changed files with 98 additions and 2,832 deletions.
Expand Up @@ -44,7 +44,6 @@
import com.google.devtools.build.lib.rules.cpp.CppSemantics;
import com.google.devtools.build.lib.rules.cpp.UserVariablesExtension;
import com.google.devtools.build.lib.rules.objc.ObjcProvider.Flag;
import com.google.devtools.build.lib.starlarkbuildapi.SplitTransitionProviderApi;
import com.google.devtools.build.lib.starlarkbuildapi.objc.AppleCommonApi;
import java.util.Map;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -169,11 +168,6 @@ public ImmutableMap<String, String> getTargetAppleEnvironment(
platform, xcodeConfig.getSdkVersionForPlatform(platform));
}

@Override
public SplitTransitionProviderApi getMultiArchSplitProvider() {
return new MultiArchSplitTransitionProvider();
}

@Override
// This method is registered statically for Starlark, and never called directly.
public ObjcProvider newObjcProvider(Dict<String, Object> kwargs, StarlarkThread thread)
Expand Down

This file was deleted.

Expand Up @@ -20,7 +20,6 @@
import com.google.devtools.build.lib.analysis.config.transitions.StarlarkExposedRuleTransitionFactory;
import com.google.devtools.build.lib.collect.nestedset.Depset;
import com.google.devtools.build.lib.starlarkbuildapi.FileApi;
import com.google.devtools.build.lib.starlarkbuildapi.SplitTransitionProviderApi;
import com.google.devtools.build.lib.starlarkbuildapi.StarlarkRuleContextApi;
import com.google.devtools.build.lib.starlarkbuildapi.apple.ApplePlatformApi;
import com.google.devtools.build.lib.starlarkbuildapi.apple.AppleToolchainApi;
Expand Down Expand Up @@ -217,27 +216,6 @@ public interface AppleCommonApi<
ImmutableMap<String, String> getTargetAppleEnvironment(
XcodeConfigInfoApiT xcodeConfig, ApplePlatformApiT platform);

@StarlarkMethod(
name = "multi_arch_split",
doc =
"A configuration transition for rule attributes to build dependencies in one or more"
+ " Apple platforms. <p>Use of this transition requires that the 'platform_type' and"
+ " 'minimum_os_version' string attributes are defined and mandatory on the"
+ " rule.</p><p>The value of the platform_type attribute will dictate the target"
+ " architectures for which dependencies along this configuration transition will"
+ " be built.</p><p>Options are:</p><ul><li><code>ios</code>: architectures gathered"
+ " from <code>--ios_multi_cpus</code>.</li><li><code>macos</code>: architectures"
+ " gathered from <code>--macos_cpus</code>.</li><li><code>tvos</code>:"
+ " architectures gathered from"
+ " <code>--tvos_cpus</code>.</li><li><code>watchos</code>: architectures gathered"
+ " from <code>--watchos_cpus</code>.</li></ul><p>minimum_os_version should be a"
+ " dotted version string such as '7.3', and is used to set the minimum operating"
+ " system on the configuration similarly based on platform type. For example,"
+ " specifying platform_type 'ios' and minimum_os_version '8.0' will ensure that"
+ " dependencies are built with minimum iOS version '8.0'.",
structField = true)
SplitTransitionProviderApi getMultiArchSplitProvider();

@StarlarkMethod(
name = "new_objc_provider",
doc = "Creates a new ObjcProvider instance.",
Expand Down

0 comments on commit a76763c

Please sign in to comment.