-
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
Fix a couple of bugs with Incompatible Target Skipping #12560
Conversation
Okay, this is ready for review. I'm still not happy about making |
This is the same version as 4.0.0rc2 except with 2 cherry-picks: a3c94ec2ed Fix builds for filegroup targets with incompatible dependencies b3c9d7381c Fix a couple of bugs with Incompatible Target Skipping The patch for the filegroup fix has already merged on master: bazelbuild/bazel#12601 The other patch is still under review: bazelbuild/bazel#12560 This should enable us to convert the code base to use platforms. Change-Id: I35f078c2576f5268d5e3fb33e9bd86732529f744
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.
This overall looks good to me. I also don't think it's that huge a deal with the new dependency from RuleContext
, although I appreciate the general concern about that.
Just the code placing comment as my only nit.
.../java/com/google/devtools/build/lib/analysis/constraints/RuleContextConstraintSemantics.java
Outdated
Show resolved
Hide resolved
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
This is the upstream rc6 branch with two cherry-picks: Fix a couple of bugs with Incompatible Target Skipping bazelbuild/bazel#12560 Add --{no,}autodetect_server_javabase bazelbuild/bazel#12542 This patch also uses the new --noautodetect_server_javabase flag. Change-Id: I7a397e4a9f17b942d0f81c7affb829d2de385a30
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
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
While adding
target_compatible_with
attributes in the FRC team 971'scode 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
aboutincompatible prerequisites. This also fixes an issue with the
validation of file extensions.
It's possible that
validateDirectPrerequisite()
skips a bit too muchvalidation. 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 purposeof that class is to centralize the logic for checking for
OutputFileConfiguredTarget
dependencies. Such dependencies need abit 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. Itdidn't deal with the
OutputFileConfiguredTarget
problem at all. Itook 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
dependon
RuleContextConstraintSemantics
.Fixes #12553