`bazel query` call to output groups or providers of a target
See original GitHub issueDescription of the problem / feature request:
It would be handy to be able to use bazel query
to list all of the output groups or providers that a target returns. This makes it easier for new users of bazel and for folks developing new rules or aspects to learn what you can rely on from a target and ease the API discovery process.
Feature requests: what underlying problem are you trying to solve with this feature?
There’s a lot of opacity on what a target will actually do and, even with pretty good documentation, you can end up reading a lot of code to figure out what it can give you. A bazel query
call you can make to get the output groups or providers would shortcut this process.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:12
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Configurable Query (cquery) - Bazel
This option prints a list of the output files produced by each target matched by the query similar to the list printed at...
Read more >How to list the output groups of a bazel rule? - Stack Overflow
If you want to get only .so outputs, you can use filegroup with dynamic_library output group. Where can I find the list of...
Read more >The Bazel Code Base
In Bazel parlance, we call them artifacts (discussed elsewhere). Not all files created during the build are targets; it's common for an output...
Read more >Is there a way to skip platform incompatible targets during the ...
The problem we hit is that “bazel build ProductA” does not combine with “target_compatible_with” attribute. As soon as in the transitive closure of...
Read more >buck query
The query language enables you to combine multiple operators in a single command. For example, to retrieve a list of all the tests...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Here is a full example of the new invocation:
For example, to show just the names of the providers which are available, you can call
.keys()
on the resultingdict
:Indeed, it does.
See the new documentation for this feature.
Particularly,
Use the new
providers()
function of this feature.