From 2cc542ab55335dff09da8af42e4c69d7f005699d Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Fri, 28 Apr 2023 09:39:42 -0700 Subject: [PATCH] `swift_import`: always link the import. `swift_library` is also moving in this direction. SwiftPM works by linking all the .o files, so this should end up in a state that seem users familiar with SwiftPM/Xcode will expect. Otherwise an `@objc` class might not be findable by name only, or a protocol conformance might not get included leading to confusing runtime problems. PiperOrigin-RevId: 527908878 --- swift/swift_import.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/swift/swift_import.bzl b/swift/swift_import.bzl index aa12fd1c2..dc98b8f2d 100644 --- a/swift/swift_import.bzl +++ b/swift/swift_import.bzl @@ -72,6 +72,7 @@ def _swift_import_impl(ctx): libraries_to_link = [ cc_common.create_library_to_link( actions = ctx.actions, + alwayslink = True, cc_toolchain = swift_toolchain.cc_toolchain_info, feature_configuration = get_cc_feature_configuration( feature_configuration,