查询从特定目标可见的目标如何?

huangapple go评论58阅读模式
英文:

How do I query for targets visible from a specific targets?

问题

Bazel使用visibility的概念来限制哪些目标可以依赖于哪些目标。对于目标//my:foo,我正在寻找一种查询Bazel以获取对//my:foo可见的目标列表的方法。

基本上,我正在尝试找出工作区中的哪些目标可以依赖于目标//my:foo。不知道是否可能?

英文:

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?

答案1

得分: 2

Query有一个visible函数。因此,bazel query 'visible(//my:foo, //...)'会打印出所有可能依赖于//my:foo的目标。

英文:

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

huangapple
  • 本文由 发表于 2023年7月3日 03:53:08
  • 转载请务必保留本文链接:https://go.coder-hub.com/76600545.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定