-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Incompatible Target Skipping breaks rules with custom providers #12553
Labels
P1
I'll work on this now. (Assignee required)
team-Configurability
platforms, toolchains, cquery, select(), config transitions
Comments
I'll try to figure out what a less hacky way of addressing this is. /cc @gregestren , @AustinSchuh |
aiuto
added
P1
I'll work on this now. (Assignee required)
team-Configurability
platforms, toolchains, cquery, select(), config transitions
labels
Nov 25, 2020
philsc
added a commit
to philsc/bazel
that referenced
this issue
Nov 25, 2020
philsc
added a commit
to philsc/bazel
that referenced
this issue
Nov 25, 2020
While adding `target_compatible_with` attributes in the FRC team 971's code base I came across bug bazelbuild#12553. It wasn't possible to have transitive incompatibility for Python targets. This patch fixes that issue by teaching `RuleContext` about incompatible prerequisites. I struggled a bit to come up with what ended up becoming `RuleContextConstraintSemantics.IncompatibleCheckResult`. The purpose of that class is to centralize the logic for checking for `OutputFileConfiguredTarget`. When I implemented this, I realized that the `TopLevelConstraintSemantics` logic also had a problem. It didn't deal with the `OutputFileConfiguredTarget` problem at all. I took the liberty of fixing that issue in this patch also because it nicely re-used the same new helper. I could not figure out a good way to avoid making `RuleContext` depend on `RuleContextConstraintSemantics`. Fixes bazelbuild#12553
philsc
added a commit
to philsc/bazel
that referenced
this issue
Nov 25, 2020
While adding `target_compatible_with` attributes in the FRC team 971's code base I came across bug bazelbuild#12553. It wasn't possible to have transitive incompatibility for Python targets. This patch fixes that issue by teaching `RuleContext` about incompatible prerequisites. I struggled a bit to come up with what ended up becoming `RuleContextConstraintSemantics.IncompatibleCheckResult`. The purpose of that class is to centralize the logic for checking for `OutputFileConfiguredTarget`. When I implemented this, I realized that the `TopLevelConstraintSemantics` logic also had a problem. It didn't deal with the `OutputFileConfiguredTarget` problem at all. I took the liberty of fixing that issue in this patch also because it nicely re-used the same new helper. I could not figure out a good way to avoid making `RuleContext` depend on `RuleContextConstraintSemantics`. Fixes bazelbuild#12553
Hmm. I discovered another bug while testing #12560. A |
There may also be something similar going on with the checks for the extensions.
|
philsc
added a commit
to philsc/bazel
that referenced
this issue
Dec 2, 2020
While adding `target_compatible_with` attributes in the FRC team 971's code base I came across bug bazelbuild#12553. It wasn't possible to make a Python target depend on another incompatible Python target. This patch fixes that issue by teaching `RuleContext` about incompatible prerequisites. This also fixes an issue with the validation of file extensions. It's possible that `validateDirectPrerequisite()` skips a bit too much validation. It was unfortunately the cleanest way I could think of. I struggled a bit to come up with what ended up becoming `RuleContextConstraintSemantics.IncompatibleCheckResult`. The purpose of that class is to centralize the logic for checking for `OutputFileConfiguredTarget` dependencies. Such dependencies need a bit of special logic in order to find `IncompatiblePlatformProvider` instances. When I implemented this patch, I realized that the `TopLevelConstraintSemantics` logic had a very similar problem. It didn't deal with the `OutputFileConfiguredTarget` problem at all. I took the liberty of fixing that issue in this patch also because it nicely re-used the same new helper. I could not figure out a good way to avoid making `RuleContext` depend on `RuleContextConstraintSemantics`. Fixes bazelbuild#12553
philsc
added a commit
to philsc/bazel
that referenced
this issue
Dec 10, 2020
While adding `target_compatible_with` attributes in the FRC team 971's code base I came across bug bazelbuild#12553. It wasn't possible to make a Python target depend on another incompatible Python target. This patch fixes that issue by teaching `RuleContext` about incompatible prerequisites. This also fixes an issue with the validation of file extensions. It's possible that `validateDirectPrerequisite()` skips a bit too much validation. It was unfortunately the cleanest way I could think of. I struggled a bit to come up with what ended up becoming `RuleContextConstraintSemantics.IncompatibleCheckResult`. The purpose of that class is to centralize the logic for checking for `OutputFileConfiguredTarget` dependencies. Such dependencies need a bit of special logic in order to find `IncompatiblePlatformProvider` instances. When I implemented this patch, I realized that the `TopLevelConstraintSemantics` logic had a very similar problem. It didn't deal with the `OutputFileConfiguredTarget` problem at all. I took the liberty of fixing that issue in this patch also because it nicely re-used the same new helper. I could not figure out a good way to avoid making `RuleContext` depend on `RuleContextConstraintSemantics`. Fixes bazelbuild#12553
meisterT
pushed a commit
that referenced
this issue
Dec 15, 2020
While adding `target_compatible_with` attributes in the FRC team 971's code base I came across bug #12553. It wasn't possible to make a Python target depend on another incompatible Python target. This patch fixes that issue by teaching `RuleContext` about incompatible prerequisites. This also fixes an issue with the validation of file extensions. It's possible that `validateDirectPrerequisite()` skips a bit too much validation. It was unfortunately the cleanest way I could think of. I struggled a bit to come up with what ended up becoming `RuleContextConstraintSemantics.IncompatibleCheckResult`. The purpose of that class is to centralize the logic for checking for `OutputFileConfiguredTarget` dependencies. Such dependencies need a bit of special logic in order to find `IncompatiblePlatformProvider` instances. When I implemented this patch, I realized that the `TopLevelConstraintSemantics` logic had a very similar problem. It didn't deal with the `OutputFileConfiguredTarget` problem at all. I took the liberty of fixing that issue in this patch also because it nicely re-used the same new helper. I could not figure out a good way to avoid making `RuleContext` depend on `RuleContextConstraintSemantics`. Fixes #12553 Closes #12560. PiperOrigin-RevId: 346796174
ulfjack
pushed a commit
to EngFlow/bazel
that referenced
this issue
Mar 5, 2021
While adding `target_compatible_with` attributes in the FRC team 971's code base I came across bug bazelbuild#12553. It wasn't possible to make a Python target depend on another incompatible Python target. This patch fixes that issue by teaching `RuleContext` about incompatible prerequisites. This also fixes an issue with the validation of file extensions. It's possible that `validateDirectPrerequisite()` skips a bit too much validation. It was unfortunately the cleanest way I could think of. I struggled a bit to come up with what ended up becoming `RuleContextConstraintSemantics.IncompatibleCheckResult`. The purpose of that class is to centralize the logic for checking for `OutputFileConfiguredTarget` dependencies. Such dependencies need a bit of special logic in order to find `IncompatiblePlatformProvider` instances. When I implemented this patch, I realized that the `TopLevelConstraintSemantics` logic had a very similar problem. It didn't deal with the `OutputFileConfiguredTarget` problem at all. I took the liberty of fixing that issue in this patch also because it nicely re-used the same new helper. I could not figure out a good way to avoid making `RuleContext` depend on `RuleContextConstraintSemantics`. Fixes bazelbuild#12553 Closes bazelbuild#12560. PiperOrigin-RevId: 346796174
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
P1
I'll work on this now. (Assignee required)
team-Configurability
platforms, toolchains, cquery, select(), config transitions
Description of the problem / feature request:
Consider the following Starlark rule:
If you instantiate it like this:
then building fails with:
This occurs because the incompatible target is assigned an
IncompatiblePlatformProvider
and not aDummyProvider
.The same thing happens when using Python targets:
A quick hack to fix this is:
What operating system are you running Bazel on?
x86_64 Linux
What's the output of
bazel info release
?Running off latest master (d0efd7b).
If
bazel info release
returns "development version" or "(@non-git)", tell us how you built Bazel.$ bazel build -c opt //src:bazel
The text was updated successfully, but these errors were encountered: