Bazel rules can compose other bazel rules. For example:
def cpp_library(name,deps=[]):
explicit_cpp_file = name + ".cpp"
explicit_hpp_file = name + ".hpp"
native.cc_library(
name = name,
srcs = [explicit_cpp_file],
hdrs = [explicit_hpp_file],
deps = deps,
)
Here we see that the cpp_library
uses native.cc_library
.
Is there a way to use a bazel query to print this relationship information?
You can imagine the difficulty of wanting to know which rules are used by which other rules as a project grows in size and many rules are available.