Skip to content
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

Closed
wants to merge 1 commit into from

Commits on Dec 10, 2020

  1. Fix a couple of bugs with Incompatible Target Skipping

    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 committed Dec 10, 2020
    Configuration menu
    Copy the full SHA
    57a2e9a View commit details
    Browse the repository at this point in the history