How do I query for targets visible from a specific targets?
Asked Answered
C

1

0

Bazel uses the concept of visibility to limit which targets can depend on which targets. Given a target //my:foo, I am looking for a way to query Bazel for a list of targets visible to //my:foo.

Basically, I am trying to figure out which targets in the workspace the target //my:foo can depend on. Any idea if this is possible at all?

Clan answered 2/7, 2023 at 19:53 Comment(0)
T
3

Query has a visible function. So, bazel query 'visible(//my:foo, //...)' prints all the targets that //my:foo may depend on.

Timaru answered 3/7, 2023 at 5:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.