Skip to content

bazel query rdeps fails in //external because //:dummy target doesn't exist #8175

@jschaf

Description

@jschaf

Description of the problem / feature request:

Using rdeps against the //external package fails because Bazel tries to resolve the android_sdk_for_testing bind rule to //:dummy using the local repository instead of Bazel's root BUILD.

# src/main/java/com/google/devtools/build/lib/bazel/rules/android/android.WORKSPACE
bind(
    name = "android_sdk_for_testing",
    actual = "//:dummy",
)

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

# WORKSPACE
workspace(name = "bazel_dummy_target")
bazel query 'rdeps(//external:*, //external:bazel_tools, 3)'
ERROR: /DEFAULT.WORKSPACE:25:1: no such target '//:dummy': target 'dummy' 
  not declared in package '' defined by <BAZEL>/BUILD.bazel 
  and referenced by '//external:android_sdk_for_testing'

ERROR: /DEFAULT.WORKSPACE:25:1: no such target '//:dummy': target 'dummy' 
  not declared in package '' defined by <BAZEL>/BUILD.bazel 
  and referenced by '//external:android_sdk_for_testing'

What operating system are you running Bazel on?

MacOS

What's the output of bazel info release?

release 0.24.1

Any other information, logs, or outputs that you want to share?

A workaround is to add the dummy target in my local repo. It seems like Bazel should use it's own dummy target.

filegroup(
    name = "dummy",
    visibility = ["//visibility:public"],
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2We'll consider working on this in future. (Assignee optional)team-AndroidIssues for Android teamtype: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions