From f618917c3b22b232af23dcdcc8ccc0225fb1ff28 Mon Sep 17 00:00:00 2001 From: Brentley Jones Date: Fri, 22 Nov 2024 12:32:26 -0600 Subject: [PATCH] Fix `apple.swizzle_absolute_xcttestsourcelocation` usage (#1457) Regressed in 43af3816b5bea4e0add6523ee1642d75157f783d. Signed-off-by: Brentley Jones (cherry picked from commit 26d4f8f3e65fc852367a820661f414ca30cd4ba0) --- swift/swift_test.bzl | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/swift/swift_test.bzl b/swift/swift_test.bzl index 4beaccc27..5c3199e1e 100644 --- a/swift/swift_test.bzl +++ b/swift/swift_test.bzl @@ -347,17 +347,6 @@ def _swift_test_impl(ctx): # Mach-O type `MH_BUNDLE` instead of `MH_EXECUTE`. extra_linkopts = ["-Wl,-bundle"] if is_bundled else [] - # `is_feature_enabled` isn't used, as it requires the prefix of the feature - # to start with `swift.` - swizzle_absolute_xcttestsourcelocation = ( - "apple.swizzle_absolute_xcttestsourcelocation" in - feature_configuration._enabled_features - ) - - extra_link_deps = [] - if swizzle_absolute_xcttestsourcelocation: - extra_link_deps.append(ctx.attr._swizzle_absolute_xcttestsourcelocation) - deps = list(ctx.attr.deps) test_runner_deps = list(ctx.attr._test_runner_deps) @@ -370,6 +359,17 @@ def _swift_test_impl(ctx): else: additional_link_deps = [] + # `is_feature_enabled` isn't used, as it requires the prefix of the feature + # to start with `swift.` + swizzle_absolute_xcttestsourcelocation = ( + "apple.swizzle_absolute_xcttestsourcelocation" in + feature_configuration._enabled_features + ) + if swizzle_absolute_xcttestsourcelocation: + additional_link_deps.append( + ctx.attr._swizzle_absolute_xcttestsourcelocation, + ) + # We also need to collect nested providers from `SwiftBinaryInfo` since we # support testing those. deps_cc_infos = []