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
Make target_compatible_with
work better on alias()
targets
#17983
Closed
Conversation
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
Currently the `target_compatible_with` on `alias()` targets only works when a `select()` is involved. That's because `alias()` targets by default don't have a toolchains evaluated. This patch changes the behaviour by making it so all `alias()` targets with a `target_compatible_with` attribute are skipped appropriately. When `target_compatible_with` is present, then toolchains are evaluated for `alias()` targets. The implementation is basically an enhancement to @gregestren's 1c3a245 (bazelbuild#14310). In addition to resolving toolchains when a `select()` is present, Bazel will now also resolve toolchains when a `target_compatible_with` attribute is set.
github-actions
bot
added
awaiting-review
PR is awaiting review from an assigned reviewer
team-Configurability
Issues for Configurability team
labels
Apr 5, 2023
@gregestren , FYI. |
gregestren
reviewed
Apr 5, 2023
src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
Outdated
Show resolved
Hide resolved
gregestren
approved these changes
Apr 6, 2023
gregestren
added
awaiting-PR-merge
PR has been approved by a reviewer and is ready to be merge internally
and removed
awaiting-review
PR is awaiting review from an assigned reviewer
labels
Apr 6, 2023
ShreeM01
removed
the
awaiting-PR-merge
PR has been approved by a reviewer and is ready to be merge internally
label
Apr 6, 2023
fweikert
pushed a commit
to fweikert/bazel
that referenced
this pull request
May 25, 2023
Currently the `target_compatible_with` on `alias()` targets only works when a `select()` is involved. That's because `alias()` targets by default don't have a toolchains evaluated. This patch changes the behaviour by making it so all `alias()` targets with a `target_compatible_with` attribute are skipped appropriately. When `target_compatible_with` is present, then toolchains are evaluated for `alias()` targets. The implementation is basically an enhancement to @gregestren's 1c3a245 (bazelbuild#14310). In addition to resolving toolchains when a `select()` is present, Bazel will now also resolve toolchains when a `target_compatible_with` attribute is set. I also took this opportunity to rename `HAS_SELECT` to something more appropriate. The name may be too long now, but I feel that at least it's descriptive. Fixes bazelbuild#17663 Closes bazelbuild#17983. PiperOrigin-RevId: 522446438 Change-Id: I80bce3e840553b75960022545df7f27ad1d1d363
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Currently the
target_compatible_with
onalias()
targets only workswhen a
select()
is involved. That's becausealias()
targets bydefault don't have a toolchains evaluated.
This patch changes the behaviour by making it so all
alias()
targetswith a
target_compatible_with
attribute are skipped appropriately.When
target_compatible_with
is present, then toolchains areevaluated for
alias()
targets.The implementation is basically an enhancement to @gregestren's
1c3a245 (#14310). In
addition to resolving toolchains when a
select()
is present, Bazelwill now also resolve toolchains when a
target_compatible_with
attribute is set.
I also took this opportunity to rename
HAS_SELECT
to somethingmore appropriate. The name may be too long now, but I feel
that at least it's descriptive.
Fixes #17663