This is change 1 of N to migrate the Swift build rules to use new-style Bazel toolchains. This change:
Updates the toolchain configuration rules to wrap the SwiftToolchainInfo provider in platform_common.ToolchainInfo, for future use by toolchain() rules.
Funnels all toolchain access through a new swift_toolchain.get_toolchain() function that looks up the toolchain using ctx.toolchains, falling back to the implicit attribute.
Since ctx.toolchains isn't defined yet, the second change is a no-op but it simplifies future parts of the migration.
PiperOrigin-RevId: 439638938
(cherry picked from commit 884e54426535acb820c746ccff074546b5796402)
This is change 1 of N to migrate the Swift build rules to use new-style Bazel toolchains. This change:
SwiftToolchainInfo
provider inplatform_common.ToolchainInfo
, for future use bytoolchain()
rules.swift_toolchain.get_toolchain()
function that looks up the toolchain usingctx.toolchains
, falling back to the implicit attribute.Since
ctx.toolchains
isn't defined yet, the second change is a no-op but it simplifies future parts of the migration.PiperOrigin-RevId: 439638938 (cherry picked from commit 884e54426535acb820c746ccff074546b5796402)