Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
Delete the swift_common.swift_runtime_linkopts function.
Browse files Browse the repository at this point in the history
This should have been deleted in the previous change that refactored the linker flags. It no longer works because it tries to access a provide field that no longer exists, but nothing broke because nothing calls it anymore. Yay weak typing.

PiperOrigin-RevId: 378673728
  • Loading branch information
allevato authored and swiple-rules-gardener committed Jun 10, 2021
1 parent 7b40da1 commit 503c9cc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
27 changes: 0 additions & 27 deletions swift/internal/linking.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"""Implementation of linking logic for Swift."""

load("@bazel_skylib//lib:collections.bzl", "collections")
load("@bazel_skylib//lib:partial.bzl", "partial")
load(
"@bazel_tools//tools/build_defs/cc:action_names.bzl",
"CPP_LINK_STATIC_LIBRARY_ACTION_NAME",
Expand Down Expand Up @@ -279,29 +278,3 @@ def register_link_binary_action(
output_type = output_type,
stamp = stamp,
)

def swift_runtime_linkopts(is_static, toolchain, is_test = False):
"""Returns the flags that should be passed when linking a Swift binary.
This function provides the appropriate linker arguments to callers who need
to link a binary using something other than `swift_binary` (for example, an
application bundle containing a universal `apple_binary`).
Args:
is_static: A `Boolean` value indicating whether the binary should be
linked against the static (rather than the dynamic) Swift runtime
libraries.
toolchain: The `SwiftToolchainInfo` provider of the toolchain whose
linker options are desired.
is_test: A `Boolean` value indicating whether the target being linked is
a test target.
Returns:
A `list` of command line flags that should be passed when linking a
binary against the Swift runtime libraries.
"""
return partial.call(
toolchain.linker_opts_producer,
is_static = is_static,
is_test = is_test,
)
2 changes: 0 additions & 2 deletions swift/internal/swift_common.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ load(
"get_cc_feature_configuration",
"is_feature_enabled",
)
load(":linking.bzl", "swift_runtime_linkopts")
load(
":providers.bzl",
"create_clang_module",
Expand All @@ -67,6 +66,5 @@ swift_common = struct(
is_enabled = is_feature_enabled,
library_rule_attrs = swift_library_rule_attrs,
precompile_clang_module = precompile_clang_module,
swift_runtime_linkopts = swift_runtime_linkopts,
toolchain_attrs = swift_toolchain_attrs,
)

0 comments on commit 503c9cc

Please sign in to comment.