diff --git a/apple/internal/apple_xcframework_import.bzl b/apple/internal/apple_xcframework_import.bzl index e4ef14675..30b20bdde 100644 --- a/apple/internal/apple_xcframework_import.bzl +++ b/apple/internal/apple_xcframework_import.bzl @@ -500,7 +500,7 @@ def _apple_dynamic_xcframework_import_impl(ctx): if xcframework_library.swift_module_interface: # Create SwiftInfo provider - swift_toolchain = swift_common.get_toolchain(ctx, "_swift_toolchain") + swift_toolchain = ctx.attr._toolchain[SwiftToolchainInfo] providers.append( framework_import_support.swift_info_from_module_interface( actions = actions, @@ -638,7 +638,7 @@ def _apple_static_xcframework_import_impl(ctx): if xcframework_library.swift_module_interface: # Create SwiftInfo provider - swift_toolchain = swift_common.get_toolchain(ctx, "_swift_toolchain") + swift_toolchain = ctx.attr._toolchain[SwiftToolchainInfo] providers.append( framework_import_support.swift_info_from_module_interface( actions = actions, @@ -694,7 +694,7 @@ objc_library( implementation = _apple_dynamic_xcframework_import_impl, attrs = dicts.add( rule_factory.common_tool_attributes, - swift_common.toolchain_attrs(toolchain_attr_name = "_swift_toolchain"), + swift_common.toolchain_attrs(), { "xcframework_imports": attr.label_list( allow_empty = False, @@ -769,7 +769,7 @@ objc_library( implementation = _apple_static_xcframework_import_impl, attrs = dicts.add( rule_factory.common_tool_attributes, - swift_common.toolchain_attrs(toolchain_attr_name = "_swift_toolchain"), + swift_common.toolchain_attrs(), { "alwayslink": attr.bool( default = False, diff --git a/test/starlark_tests/targets_under_test/ios/BUILD b/test/starlark_tests/targets_under_test/ios/BUILD index f67b3fdca..30ebf98fd 100644 --- a/test/starlark_tests/targets_under_test/ios/BUILD +++ b/test/starlark_tests/targets_under_test/ios/BUILD @@ -2290,9 +2290,23 @@ swift_library( tags = common.fixture_tags, deps = [ "//test/starlark_tests/targets_under_test/apple:ios_imported_static_xcframework_depends_on_base", + "//test/starlark_tests/targets_under_test/apple:ios_imported_swift_static_xcframework", ], ) +genrule( + name = "static_swift_xcframework_depending_swift_lib_src", + outs = ["SwiftWithStaticSwiftFramework.swift"], + cmd = """cat > $@ <