Skip to content

Commit b750c57

Browse files
Remove explicit Swift execution group (#2822)
Part of 3da7b31. Signed-off-by: Brentley Jones <github@brentleyjones.com>
1 parent afa4478 commit b750c57

2 files changed

Lines changed: 10 additions & 33 deletions

File tree

apple/internal/apple_framework_import.bzl

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ load(
7878
"AppleFrameworkImportBundleInfo",
7979
)
8080

81-
# The name of the execution group that houses the Swift toolchain and is used to
82-
# run Swift actions.
83-
_SWIFT_EXEC_GROUP = "swift"
84-
8581
def _swiftmodule_for_cpu(swiftmodule_files, cpu):
8682
"""Select the cpu specific swiftmodule."""
8783

@@ -259,7 +255,7 @@ def _apple_dynamic_framework_import_impl(ctx):
259255

260256
if "apple._import_framework_via_swiftinterface" in features and framework.swift_interface_imports:
261257
# Create SwiftInfo provider
262-
swift_toolchain = swift_common.get_toolchain(ctx, exec_group = _SWIFT_EXEC_GROUP)
258+
swift_toolchain = swift_common.get_toolchain(ctx)
263259
swiftinterface_files = framework_import_support.get_swift_module_files_with_target_triplet(
264260
swift_module_files = framework.swift_interface_imports,
265261
target_triplet = target_triplet,
@@ -325,7 +321,7 @@ def _apple_static_framework_import_impl(ctx):
325321
additional_objc_providers = []
326322
additional_objc_provider_fields = {}
327323
if framework.swift_interface_imports or framework.swift_module_imports or has_swift:
328-
toolchain = swift_common.get_toolchain(ctx, exec_group = _SWIFT_EXEC_GROUP)
324+
toolchain = swift_common.get_toolchain(ctx)
329325
providers.append(SwiftUsageInfo())
330326

331327
# The Swift toolchain propagates Swift-specific linker flags (e.g.,
@@ -397,7 +393,7 @@ def _apple_static_framework_import_impl(ctx):
397393

398394
if "apple._import_framework_via_swiftinterface" in features and framework.swift_interface_imports:
399395
# Create SwiftInfo provider
400-
swift_toolchain = swift_common.get_toolchain(ctx, exec_group = _SWIFT_EXEC_GROUP)
396+
swift_toolchain = swift_common.get_toolchain(ctx)
401397
swiftinterface_files = framework_import_support.get_swift_module_files_with_target_triplet(
402398
swift_module_files = framework.swift_interface_imports,
403399
target_triplet = target_triplet,
@@ -497,7 +493,7 @@ objc_library(
497493
)
498494
```
499495
""",
500-
toolchains = use_cpp_toolchain(),
496+
toolchains = swift_common.use_toolchain() + use_cpp_toolchain(),
501497
)
502498

503499
apple_static_framework_import = rule(
@@ -581,12 +577,7 @@ not include Swift interface or Swift module files.
581577
),
582578
},
583579
),
584-
exec_groups = {
585-
_SWIFT_EXEC_GROUP: exec_group(
586-
toolchains = swift_common.use_toolchain(),
587-
),
588-
},
589-
toolchains = use_cpp_toolchain(),
580+
toolchains = swift_common.use_toolchain() + use_cpp_toolchain(),
590581
doc = """
591582
This rule encapsulates an already-built static framework. It is defined by a list of
592583
files in exactly one `.framework` directory. `apple_static_framework_import` targets

apple/internal/apple_xcframework_import.bzl

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ load(
6262
# This defines an _enum_ to identify an imported XCFramework bundle type.
6363
_BUNDLE_TYPE = struct(frameworks = 1, libraries = 2)
6464

65-
# The name of the execution group that houses the Swift toolchain and is used to
66-
# run Swift actions.
67-
_SWIFT_EXEC_GROUP = "swift"
68-
6965
def _classify_xcframework_imports(config_vars, xcframework_imports):
7066
"""Classifies XCFramework files for later processing.
7167
@@ -566,7 +562,7 @@ def _apple_dynamic_xcframework_import_impl(ctx):
566562

567563
if "apple._import_framework_via_swiftinterface" in features and xcframework_library.swift_module_interface:
568564
# Create SwiftInfo provider
569-
swift_toolchain = swift_common.get_toolchain(ctx, exec_group = _SWIFT_EXEC_GROUP)
565+
swift_toolchain = swift_common.get_toolchain(ctx)
570566
providers.append(
571567
framework_import_support.swift_info_from_module_interface(
572568
actions = actions,
@@ -643,7 +639,7 @@ def _apple_static_xcframework_import_impl(ctx):
643639
if xcframework.files_by_category.swift_interface_imports or \
644640
xcframework.files_by_category.swift_module_imports or \
645641
has_swift:
646-
swift_toolchain = swift_common.get_toolchain(ctx, exec_group = _SWIFT_EXEC_GROUP)
642+
swift_toolchain = swift_common.get_toolchain(ctx)
647643
providers.append(SwiftUsageInfo())
648644

649645
# The Swift toolchain propagates Swift-specific linker flags (e.g.,
@@ -700,7 +696,7 @@ def _apple_static_xcframework_import_impl(ctx):
700696

701697
if "apple._import_framework_via_swiftinterface" in features and xcframework_library.swift_module_interface:
702698
# Create SwiftInfo provider
703-
swift_toolchain = swift_common.get_toolchain(ctx, exec_group = _SWIFT_EXEC_GROUP)
699+
swift_toolchain = swift_common.get_toolchain(ctx)
704700
providers.append(
705701
framework_import_support.swift_info_from_module_interface(
706702
actions = actions,
@@ -795,18 +791,13 @@ Unnecssary and ignored, will be removed in the future.
795791
),
796792
},
797793
),
798-
exec_groups = {
799-
_SWIFT_EXEC_GROUP: exec_group(
800-
toolchains = swift_common.use_toolchain(),
801-
),
802-
},
803794
fragments = ["apple", "cpp"],
804795
provides = [
805796
AppleFrameworkImportInfo,
806797
CcInfo,
807798
AppleDynamicFrameworkInfo,
808799
],
809-
toolchains = use_cpp_toolchain(),
800+
toolchains = swift_common.use_toolchain() + use_cpp_toolchain(),
810801
)
811802

812803
apple_static_xcframework_import = rule(
@@ -935,11 +926,6 @@ Unnecssary and ignored, will be removed in the future.
935926
),
936927
},
937928
),
938-
exec_groups = {
939-
_SWIFT_EXEC_GROUP: exec_group(
940-
toolchains = swift_common.use_toolchain(),
941-
),
942-
},
943929
fragments = ["apple", "cpp", "objc"],
944-
toolchains = use_cpp_toolchain(),
930+
toolchains = swift_common.use_toolchain() + use_cpp_toolchain(),
945931
)

0 commit comments

Comments
 (0)