Skip to content

Commit

Permalink
Fix apple.swizzle_absolute_xcttestsourcelocation usage (#1457)
Browse files Browse the repository at this point in the history
Regressed in 43af381.

Signed-off-by: Brentley Jones <[email protected]>
(cherry picked from commit 26d4f8f)
  • Loading branch information
brentleyjones committed Nov 22, 2024
1 parent 00a52db commit f618917
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions swift/swift_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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 = []
Expand Down

0 comments on commit f618917

Please sign in to comment.