@@ -206,7 +206,6 @@ def _is_arch_supported_for_target_tuple(*, environment_arch, minimum_os_version,
206
206
def _command_line_options (
207
207
* ,
208
208
apple_platforms = [],
209
- emit_swiftinterface = False ,
210
209
environment_arch = None ,
211
210
force_bundle_outputs = False ,
212
211
minimum_os_version ,
@@ -221,8 +220,6 @@ def _command_line_options(
221
220
first element will be applied to `platforms` as that will be what is resolved by the
222
221
underlying rule. Defaults to an empty list, which will signal to Bazel that platform
223
222
mapping can take place as a fallback measure.
224
- emit_swiftinterface: Wheither to emit swift interfaces for the given target. Defaults to
225
- `False`.
226
223
environment_arch: A valid Apple environment when applicable with its architecture as a
227
224
string (for example `sim_arm64` from `ios_sim_arm64`, or `arm64` from `ios_arm64`), or
228
225
None to infer a value from command line options passed through settings.
@@ -284,7 +281,6 @@ def _command_line_options(
284
281
platform = "watchos" ,
285
282
platform_type = platform_type ,
286
283
),
287
- "@build_bazel_rules_swift//swift:emit_swiftinterface" : emit_swiftinterface ,
288
284
}
289
285
290
286
def _xcframework_split_attr_key (* , arch , environment , platform_type ):
@@ -320,7 +316,6 @@ def _resolved_environment_arch_for_arch(*, arch, environment, platform_type):
320
316
321
317
def _command_line_options_for_xcframework_platform (
322
318
* ,
323
- attr ,
324
319
minimum_os_version ,
325
320
platform_attr ,
326
321
platform_type ,
@@ -329,7 +324,6 @@ def _command_line_options_for_xcframework_platform(
329
324
"""Generates a dictionary of command line options keyed by 1:2+ transition for this platform.
330
325
331
326
Args:
332
- attr: The attributes passed to the transition function.
333
327
minimum_os_version: A string representing the minimum OS version specified for this
334
328
platform, represented as a dotted version number (for example, `"9.0"`).
335
329
platform_attr: The attribute for the apple platform specifying in dictionary form which
@@ -363,10 +357,6 @@ def _command_line_options_for_xcframework_platform(
363
357
environment = target_environment ,
364
358
platform_type = platform_type ,
365
359
): _command_line_options (
366
- emit_swiftinterface = _should_emit_swiftinterface (
367
- attr ,
368
- is_xcframework = True ,
369
- ),
370
360
environment_arch = resolved_environment_arch ,
371
361
minimum_os_version = minimum_os_version ,
372
362
platform_type = platform_type ,
@@ -377,28 +367,10 @@ def _command_line_options_for_xcframework_platform(
377
367
378
368
return output_dictionary
379
369
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
-
397
370
def _apple_rule_base_transition_impl (settings , attr ):
398
371
"""Rule transition for Apple rules using Bazel CPUs and a valid Apple split transition."""
399
372
platform_type = attr .platform_type
400
373
return _command_line_options (
401
- emit_swiftinterface = _should_emit_swiftinterface (attr ),
402
374
environment_arch = _environment_archs (platform_type , settings )[0 ],
403
375
minimum_os_version = attr .minimum_os_version ,
404
376
platform_type = platform_type ,
@@ -444,7 +416,6 @@ _apple_rule_base_transition_outputs = [
444
416
"//command_line_option:platforms" ,
445
417
"//command_line_option:tvos_minimum_os" ,
446
418
"//command_line_option:watchos_minimum_os" ,
447
- "@build_bazel_rules_swift//swift:emit_swiftinterface" ,
448
419
]
449
420
_apple_universal_binary_rule_transition_outputs = _apple_rule_base_transition_outputs + [
450
421
"//command_line_option:ios_multi_cpus" ,
@@ -469,7 +440,6 @@ def _apple_platforms_rule_base_transition_impl(settings, attr):
469
440
environment_arch = _environment_archs (platform_type , settings )[0 ]
470
441
return _command_line_options (
471
442
apple_platforms = settings ["//command_line_option:apple_platforms" ],
472
- emit_swiftinterface = _should_emit_swiftinterface (attr ),
473
443
environment_arch = environment_arch ,
474
444
minimum_os_version = minimum_os_version ,
475
445
platform_type = platform_type ,
@@ -492,7 +462,6 @@ def _apple_platforms_rule_bundle_output_base_transition_impl(settings, attr):
492
462
environment_arch = _environment_archs (platform_type , settings )[0 ]
493
463
return _command_line_options (
494
464
apple_platforms = settings ["//command_line_option:apple_platforms" ],
495
- emit_swiftinterface = _should_emit_swiftinterface (attr ),
496
465
environment_arch = environment_arch ,
497
466
force_bundle_outputs = True ,
498
467
minimum_os_version = minimum_os_version ,
@@ -569,11 +538,6 @@ def _apple_platform_split_transition_impl(settings, attr):
569
538
output_dictionary = {}
570
539
invalid_requested_archs = []
571
540
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
-
577
541
if settings ["//command_line_option:incompatible_enable_apple_toolchain_resolution" ]:
578
542
platforms = (
579
543
settings ["//command_line_option:apple_platforms" ] or
@@ -594,7 +558,6 @@ def _apple_platform_split_transition_impl(settings, attr):
594
558
if str (platform ) not in output_dictionary :
595
559
output_dictionary [str (platform )] = _command_line_options (
596
560
apple_platforms = apple_platforms ,
597
- emit_swiftinterface = emit_swiftinterface ,
598
561
minimum_os_version = attr .minimum_os_version ,
599
562
platform_type = attr .platform_type ,
600
563
settings = settings ,
@@ -643,7 +606,6 @@ def _apple_platform_split_transition_impl(settings, attr):
643
606
continue
644
607
645
608
output_dictionary [found_cpu ] = _command_line_options (
646
- emit_swiftinterface = emit_swiftinterface ,
647
609
environment_arch = environment_arch ,
648
610
minimum_os_version = minimum_os_version ,
649
611
platform_type = platform_type ,
@@ -694,7 +656,6 @@ def _xcframework_transition_impl(settings, attr):
694
656
target_environments .append ("simulator" )
695
657
696
658
command_line_options = _command_line_options_for_xcframework_platform (
697
- attr = attr ,
698
659
minimum_os_version = attr .minimum_os_versions .get (platform_type ),
699
660
platform_attr = platform_attr ,
700
661
platform_type = platform_type ,
0 commit comments