Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce the swift_common.get_toolchain helper function #1226

Merged

Conversation

brentleyjones
Copy link
Collaborator

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 884e544)

brentleyjones referenced this pull request Jun 19, 2024
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
@brentleyjones brentleyjones changed the title Introduce the swift_common.get_toolchain helper function Introduce the swift_common.get_toolchain helper function Jun 19, 2024
@brentleyjones brentleyjones force-pushed the bj/cp-884e54426535acb820c746ccff074546b5796402 branch from 444dcab to a39ee60 Compare June 19, 2024 22:45
@brentleyjones brentleyjones marked this pull request as ready for review June 19, 2024 22:45
@brentleyjones brentleyjones enabled auto-merge (rebase) June 19, 2024 22:45
@brentleyjones brentleyjones force-pushed the bj/cp-884e54426535acb820c746ccff074546b5796402 branch 2 times, most recently from 31078e8 to f58ae29 Compare June 19, 2024 23:03
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 884e544)
Signed-off-by: Brentley Jones <github@brentleyjones.com>
@brentleyjones brentleyjones force-pushed the bj/cp-884e54426535acb820c746ccff074546b5796402 branch from f58ae29 to 3c645d6 Compare June 19, 2024 23:06
@brentleyjones brentleyjones merged commit aa2aea2 into master Jun 19, 2024
14 checks passed
@brentleyjones brentleyjones deleted the bj/cp-884e54426535acb820c746ccff074546b5796402 branch June 19, 2024 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants