Skip to content

Commit

Permalink
Remove the SwiftToolchainInfo.cc_toolchain_files field.
Browse files Browse the repository at this point in the history
CcToolchainInfo now provides a field for these, so we no longer have to pass them around separately.

RELNOTES: None.
PiperOrigin-RevId: 249343003
  • Loading branch information
allevato authored and swiple-rules-gardener committed May 21, 2019
1 parent b6fb2b1 commit 5933dae
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 13 deletions.
3 changes: 1 addition & 2 deletions swift/internal/linking.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ def _register_static_library_link_action(
execution_requirements = swift_toolchain.execution_requirements,
inputs = depset(
direct = objects,
# TODO(bazelbuild/bazel#7427): Use `CcToolchainInfo` getters when they are available.
transitive = [swift_toolchain.cc_toolchain_files],
transitive = [swift_toolchain.cc_toolchain_info.all_files],
),
mnemonic = "SwiftArchive",
outputs = [output],
Expand Down
6 changes: 0 additions & 6 deletions swift/internal/providers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,6 @@ code.
`Struct` containing two Skylib `partial`s: `run`, which registers an action using `actions.run`; and
`run_shell`, which registers an action using `actions.run_shell`. These partials allow the toolchain
to set the environment and execution requirements, as well as use a wrapper script if necessary.
""",
"cc_toolchain_files": """
A `depset` of the `File`s in the C++ toolchain.
This field is temporary until `cc_common.CcToolchainInfo` provides getters to access these files
(https://github.com/bazelbuild/bazel/issues/7427).
""",
"cc_toolchain_info": """
The `cc_common.CcToolchainInfo` provider from the Bazel C++ toolchain that this Swift toolchain
Expand Down
4 changes: 1 addition & 3 deletions swift/internal/swift_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ def _run_swift_action(toolchain_tools, swift_wrapper, actions, **kwargs):
def _swift_toolchain_impl(ctx):
toolchain_root = ctx.attr.root
cc_toolchain = find_cpp_toolchain(ctx)
cc_toolchain_files = cc_toolchain.all_files

linker_opts_producer = partial.make(
_default_linker_opts,
Expand All @@ -185,7 +184,7 @@ def _swift_toolchain_impl(ctx):
toolchain_root,
)

tools = depset(transitive = [ctx.attr._cc_toolchain.files])
tools = depset(transitive = [cc_toolchain.all_files])
action_registrars = struct(
run = partial.make(_run_action, tools),
run_shell = partial.make(_run_shell_action, tools),
Expand All @@ -204,7 +203,6 @@ def _swift_toolchain_impl(ctx):
SwiftToolchainInfo(
action_environment = {},
action_registrars = action_registrars,
cc_toolchain_files = cc_toolchain_files,
cc_toolchain_info = cc_toolchain,
clang_executable = ctx.attr.clang_executable,
command_line_copts = ctx.fragments.swift.copts(),
Expand Down
2 changes: 0 additions & 2 deletions swift/internal/xcode_swift_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,6 @@ def _xcode_swift_toolchain_impl(ctx):
)

cc_toolchain = find_cpp_toolchain(ctx)
cc_toolchain_files = cc_toolchain.all_files

# Compute the default requested features and conditional ones based on Xcode version.
requested_features = features_for_build_modes(ctx, objc_fragment = ctx.fragments.objc)
Expand All @@ -528,7 +527,6 @@ def _xcode_swift_toolchain_impl(ctx):
SwiftToolchainInfo(
action_environment = env,
action_registrars = action_registrars,
cc_toolchain_files = cc_toolchain_files,
cc_toolchain_info = cc_toolchain,
clang_executable = None,
command_line_copts = command_line_copts,
Expand Down

0 comments on commit 5933dae

Please sign in to comment.