-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand target_compatible_with to all non-workspace rules
This patch makes it so the `target_compatible_with` attribute can be used with all non-workspace rules. The motivation here is to allow rules like `filegroup` and `cc_import` to also make use of incompatible target skipping. Even though these rules don't inherently generate files that are incompatible with the target platform, they can be used to provide incompatible files to other targets. Before this patch the user had to do something like this to create an incompatible pre-compiled library: cc_import( name = "foo_import", shared_library = "foo.so", ) cc_library( name = "foo", deps = [":foo_import"], target_compatible_with = ["//:foo_platform"], ) Now users can directly declare compatibility on the `cc_import` rule. cc_import( name = "foo_import", shared_library = "foo.so", target_compatible_with = ["//:foo_platform"], ) Unfortunately, This does mean that some rules like `cc_toolchain` now have a `target_compatible_with` that doesn't serve any purpose. Before the changes in `BaseRulesClasses.java` the test would error out with meesages like this: //target_skipping:some_precompiled_library: no such attribute 'target_compatible_with' in 'cc_import' rule //target_skipping:filegroup: no such attribute 'target_compatible_with' in 'filegroup' rule I also took this opportunity to update the documentation a bit. Fixes #12745 Closes #13170. PiperOrigin-RevId: 363185186
- Loading branch information
1 parent
ec17683
commit d052ece
Showing
4 changed files
with
75 additions
and
10 deletions.
There are no files selected for viewing
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
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
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
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