-
Notifications
You must be signed in to change notification settings - Fork 172
Change rules based toolchain macOS conditions to Apple #614
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
Open
keith
wants to merge
2
commits into
bazelbuild:main
Choose a base branch
from
keith:ks/change-rules-based-toolchain-macos-conditions-to-apple
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| load("@bazel_skylib//lib:selects.bzl", "selects") | ||
|
|
||
| selects.config_setting_group( | ||
| name = "default_apple_constraint", | ||
| match_any = [ | ||
| "@platforms//os:ios", | ||
| "@platforms//os:macos", | ||
| "@platforms//os:tvos", | ||
| "@platforms//os:visionos", | ||
| "@platforms//os:watchos", | ||
| ], | ||
| visibility = ["//visibility:private"], | ||
| ) | ||
|
|
||
| label_flag( | ||
| name = "apple_constraint", | ||
| build_setting_default = ":default_apple_constraint", | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Sorry, didn't catch this on my first pass:
Does this need to be public? Considering it's a flag, anyone can set it to match their own canonical definition. I'd prefer this doesn't become load-bearing. If it does, we might want to bikeshed for a moment on naming:
platformdoesn't seem correct to me, since that's a very distinct thing.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.
yea very good question. I think the downside of not making it public is that downstream toolchains cannot perfectly mirror what happens in the default
cc_argsthat read this version. realistically that's minor, but it would cause very subtly issues for the few people who would ever need to change this.it being load bearing is annoying because actual downstream users should use apple_support's definitions for this instead, I just don't want to try to add that circular dependency here.
it's also possible that the best solution is to move this into platforms_contrib (since it's unlikely
platformsitself wants this)Uh oh!
There was an error while loading. Please reload this page.
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.
I suggest putting it in
@rules_cc/cc/settings:apple_constraintif we're going to make this public. Centralizing the configuration flags makes for a better user experience, and is consistent with existingrules_*modules.Other rulesets have varying naming patterns for centralized settings:
Then we should pursue putting the flag and base definition in platforms_contrib, and we can just swap the label_flag with an alias eventually.
@trybka this will be setting a precedent, so flagging the discussion.
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.
fine with me, moved it to the suggestion