-
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.
cquery --show_config_fragments: report fragments used by transitions
Also: 1 Move collection logic into its own utility class to declutter a hard-enough-to-understand core class 2 Change the signature on Starlark transition requirements from fragment classes to the user-friendly strings they ultimately get transformed to. We do this early because transitions report options, not fragments. Trying to reduce them to fragments involves a way more complicated API with no real benefit (particularly for Starlark flags and CoreOptions, which have no fragment). This change has some quirks, which is why I changed some existing test signatures. But it's far preferable IMO to overly complicating Blaze's core APIs One of 2's particular quirks is that the final "required fragments" string isn't consistent. For example, if a rule definition requires the C++ fragment it returns "CppConfiguration", whereas if a select() or transition requires a C++ option it returns "CppOptions". This is arguably confusing. But the alternative of forcing everything into a proper Fragment (CppConfiguration) requires passing a FragmentOptions -> Fragment map to all code that computes FragmentOptions, which really complicates Blaze's APIs. Furthermore, "blaze config" outputs a mapping of fragments to FragmentOptions, which means consumers have all the info they need to connect and deduplicate. The result is a minor inconvenience that's not too invasive to Blaze and doesn't compromise ultimate correctness. In service of #11258. PiperOrigin-RevId: 319306418
- Loading branch information
1 parent
17bedb8
commit 24e09f7
Showing
11 changed files
with
462 additions
and
176 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
Oops, something went wrong.