From eb96faa9ca420ede635eff792a26abd7c8277e3b Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Fri, 11 Aug 2023 12:55:01 -0700 Subject: [PATCH] compat --- apple/internal/apple_xcframework_import.bzl | 8 ++++---- test/starlark_tests/targets_under_test/ios/BUILD | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) 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 > $@ <