-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate
XcodeConfigInfo
to Starlark.
Unlike the other providers, this one is very public API, used by any rule that needs to access the user's desired minimum OS version or the Xcode version used in the build. While the provider is initialized by passing all of the min OS and SDK version numbers, it only defines _functions_ to read them back out. To preserve this API during the Starlark migration, we have to make the new provider likewise return functions that capture the values that were passed in at the time of construction. Once it's moved to apple_support, we can explore refactoring this to make it a more "normal" provider, and supply other APIs to interpret the values inside it. PiperOrigin-RevId: 625718058 Change-Id: Ibe40774203d193e0aa4e06b2c39b2c5767a7d7f6
- Loading branch information
1 parent
6b62f77
commit cf5951e
Showing
11 changed files
with
358 additions
and
665 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
cf5951e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@allevato Before this commit the
apple_common.XcodeVersionConfig
constructor looked like this:and now it's this:
Just letting you know this is a breaking change: https://buildkite.com/bazel/apple-support-darwin/builds/2520#018f87f2-6ddb-46c5-93f4-1a4552db2f47/259-296
cf5951e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That change is intentional; the old
camelCaseName
s didn't meet Starlark naming conventions and no pre-existing external Starlark code was expected to use the old incorrect API. The apple_support PRs that migrate the Xcode rules to external Starlark are only meant to be used with Bazel versions that follow this commit, though I suppose you could use a version check of some sort to figure out which form of the API you need if you want to use it with something earlier.cf5951e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it was public API, right? That was my main call out, in case people were using the API.
cf5951e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically yes, it's a breaking change—but there will be a lot of breaking changes as the remaining Apple/Xcode logic is eventually removed from Bazel core. The only reason this API was kept at all instead of being migrated completely to apple_support is because of the dependency in the
ObjcBinarySymbolStrip
action; if it weren't for that, it would have been deleted entirely, which also would have been a breaking change.In practice, I don't expect it to break anything because the only reason to use the API would be to write one's own custom
xcode_config
rule. I don't have the full history behind why the API was exposed to Starlark in the first place, because (at least internally) it doesn't appear to have ever been used in Starlark after that.