@@ -206,7 +206,6 @@ def _is_arch_supported_for_target_tuple(*, environment_arch, minimum_os_version,
206206def _command_line_options (
207207 * ,
208208 apple_platforms = [],
209- emit_swiftinterface = False ,
210209 environment_arch = None ,
211210 force_bundle_outputs = False ,
212211 minimum_os_version ,
@@ -221,8 +220,6 @@ def _command_line_options(
221220 first element will be applied to `platforms` as that will be what is resolved by the
222221 underlying rule. Defaults to an empty list, which will signal to Bazel that platform
223222 mapping can take place as a fallback measure.
224- emit_swiftinterface: Wheither to emit swift interfaces for the given target. Defaults to
225- `False`.
226223 environment_arch: A valid Apple environment when applicable with its architecture as a
227224 string (for example `sim_arm64` from `ios_sim_arm64`, or `arm64` from `ios_arm64`), or
228225 None to infer a value from command line options passed through settings.
@@ -284,7 +281,6 @@ def _command_line_options(
284281 platform = "watchos" ,
285282 platform_type = platform_type ,
286283 ),
287- "@build_bazel_rules_swift//swift:emit_swiftinterface" : emit_swiftinterface ,
288284 }
289285
290286def _xcframework_split_attr_key (* , arch , environment , platform_type ):
@@ -320,7 +316,6 @@ def _resolved_environment_arch_for_arch(*, arch, environment, platform_type):
320316
321317def _command_line_options_for_xcframework_platform (
322318 * ,
323- attr ,
324319 minimum_os_version ,
325320 platform_attr ,
326321 platform_type ,
@@ -329,7 +324,6 @@ def _command_line_options_for_xcframework_platform(
329324 """Generates a dictionary of command line options keyed by 1:2+ transition for this platform.
330325
331326 Args:
332- attr: The attributes passed to the transition function.
333327 minimum_os_version: A string representing the minimum OS version specified for this
334328 platform, represented as a dotted version number (for example, `"9.0"`).
335329 platform_attr: The attribute for the apple platform specifying in dictionary form which
@@ -363,10 +357,6 @@ def _command_line_options_for_xcframework_platform(
363357 environment = target_environment ,
364358 platform_type = platform_type ,
365359 ): _command_line_options (
366- emit_swiftinterface = _should_emit_swiftinterface (
367- attr ,
368- is_xcframework = True ,
369- ),
370360 environment_arch = resolved_environment_arch ,
371361 minimum_os_version = minimum_os_version ,
372362 platform_type = platform_type ,
@@ -377,28 +367,10 @@ def _command_line_options_for_xcframework_platform(
377367
378368 return output_dictionary
379369
380- def _should_emit_swiftinterface (attr , is_xcframework = False ):
381- """Determines if a .swiftinterface file should be generated for Swift dependencies.
382-
383- Needed until users of the framework rules are allowed to enable
384- library evolution on specific targets instead of having it automatically
385- applied to the entire dependency subgraph.
386- """
387-
388- features = getattr (attr , "features" , [])
389- if type (features ) == "list" and "apple.no_legacy_swiftinterface" in features :
390- return False
391-
392- # iOS and tvOS static frameworks require underlying swift_library targets generate a Swift
393- # interface file. These rules define a private attribute called `_emitswiftinterface` that
394- # let's this transition flip rules_swift config down the build graph.
395- return is_xcframework or hasattr (attr , "_emitswiftinterface" )
396-
397370def _apple_rule_base_transition_impl (settings , attr ):
398371 """Rule transition for Apple rules using Bazel CPUs and a valid Apple split transition."""
399372 platform_type = attr .platform_type
400373 return _command_line_options (
401- emit_swiftinterface = _should_emit_swiftinterface (attr ),
402374 environment_arch = _environment_archs (platform_type , settings )[0 ],
403375 minimum_os_version = attr .minimum_os_version ,
404376 platform_type = platform_type ,
@@ -444,7 +416,6 @@ _apple_rule_base_transition_outputs = [
444416 "//command_line_option:platforms" ,
445417 "//command_line_option:tvos_minimum_os" ,
446418 "//command_line_option:watchos_minimum_os" ,
447- "@build_bazel_rules_swift//swift:emit_swiftinterface" ,
448419]
449420_apple_universal_binary_rule_transition_outputs = _apple_rule_base_transition_outputs + [
450421 "//command_line_option:ios_multi_cpus" ,
@@ -469,7 +440,6 @@ def _apple_platforms_rule_base_transition_impl(settings, attr):
469440 environment_arch = _environment_archs (platform_type , settings )[0 ]
470441 return _command_line_options (
471442 apple_platforms = settings ["//command_line_option:apple_platforms" ],
472- emit_swiftinterface = _should_emit_swiftinterface (attr ),
473443 environment_arch = environment_arch ,
474444 minimum_os_version = minimum_os_version ,
475445 platform_type = platform_type ,
@@ -492,7 +462,6 @@ def _apple_platforms_rule_bundle_output_base_transition_impl(settings, attr):
492462 environment_arch = _environment_archs (platform_type , settings )[0 ]
493463 return _command_line_options (
494464 apple_platforms = settings ["//command_line_option:apple_platforms" ],
495- emit_swiftinterface = _should_emit_swiftinterface (attr ),
496465 environment_arch = environment_arch ,
497466 force_bundle_outputs = True ,
498467 minimum_os_version = minimum_os_version ,
@@ -569,11 +538,6 @@ def _apple_platform_split_transition_impl(settings, attr):
569538 output_dictionary = {}
570539 invalid_requested_archs = []
571540
572- # iOS and tvOS static frameworks require underlying swift_library targets generate a Swift
573- # interface file. These rules define a private attribute called `_emitswiftinterface` that
574- # let's this transition flip rules_swift config down the build graph.
575- emit_swiftinterface = _should_emit_swiftinterface (attr )
576-
577541 if settings ["//command_line_option:incompatible_enable_apple_toolchain_resolution" ]:
578542 platforms = (
579543 settings ["//command_line_option:apple_platforms" ] or
@@ -594,7 +558,6 @@ def _apple_platform_split_transition_impl(settings, attr):
594558 if str (platform ) not in output_dictionary :
595559 output_dictionary [str (platform )] = _command_line_options (
596560 apple_platforms = apple_platforms ,
597- emit_swiftinterface = emit_swiftinterface ,
598561 minimum_os_version = attr .minimum_os_version ,
599562 platform_type = attr .platform_type ,
600563 settings = settings ,
@@ -643,7 +606,6 @@ def _apple_platform_split_transition_impl(settings, attr):
643606 continue
644607
645608 output_dictionary [found_cpu ] = _command_line_options (
646- emit_swiftinterface = emit_swiftinterface ,
647609 environment_arch = environment_arch ,
648610 minimum_os_version = minimum_os_version ,
649611 platform_type = platform_type ,
@@ -694,7 +656,6 @@ def _xcframework_transition_impl(settings, attr):
694656 target_environments .append ("simulator" )
695657
696658 command_line_options = _command_line_options_for_xcframework_platform (
697- attr = attr ,
698659 minimum_os_version = attr .minimum_os_versions .get (platform_type ),
699660 platform_attr = platform_attr ,
700661 platform_type = platform_type ,
0 commit comments