Find all aliases depending on a target

389 views
Skip to first unread message

markus....@ecosia.org

unread,
Sep 3, 2018, 6:09:00 AM9/3/18
to bazel-discuss
I would like to do something like `bazel query 'kind(alias, rdeps(//..., //target:target))'`, i.e. given a target show me all aliases that are dependent on that target. But it does not seem possible this way. Is this use-case currently supported?

Alex Humesky

unread,
Sep 11, 2018, 9:29:29 PM9/11/18
to markus....@ecosia.org, bazel-discuss
Seems to work for me:


$ bazel version
Build label: 0.16.1

$ cat a/BUILD
genrule(
  name = "genfoo",
  outs = ["foo"],
  cmd = "echo foo > $@",
  visibility = ["//visibility:public"],
)

$ cat b/BUILD
alias(
  name = "foo",
  actual = "//a:foo"
)

$ bazel query "kind(alias, rdeps(//..., //a:foo))"
//b:foo

We might need more information.

On Mon, Sep 3, 2018 at 6:09 AM <markus....@ecosia.org> wrote:
I would like to do something like `bazel query 'kind(alias, rdeps(//..., //target:target))'`, i.e. given a target show me all aliases that are dependent on that target. But it does not seem possible this way. Is this use-case currently supported?

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/edbb68e6-cecf-43e2-8d30-2a583c8966ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages