bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23.13k stars 4.05k forks source link

Bazel reports an non-existant BUILD file when .bzl file is present #4056

Closed gregmagolan closed 6 years ago

gregmagolan commented 6 years ago

Please provide the following information. The more we know about your system and use case, the more easily and likely we can help.

Description of the problem / feature request / question:

Bazel 0.7.0 reports a non-existent BUILD in the same folder as a dependent .bzl file.

If possible, provide a minimal example to reproduce the problem:

Minimum example repo is here: https://github.com/gregmagolan/bazel-buildfiles-bug

Run bazel query "buildfiles(deps(set(:sometarget)))" with Bazel 0.7.0 and you'll see

//:somerule.bzl
//:BUILD.bazel
//:BUILD

instead of the expected

//:somerule.bzl
//:BUILD.bazel

since there is no BUILD file present

Environment info

Have you found anything relevant by searching the web?

(e.g. StackOverflow answers, GitHub issues, email threads on the bazel-discuss Google group)

Anything else, information or logs or outputs that would be helpful?

(If they are large, please upload as attachment or provide link).

damienmg commented 6 years ago

/cc @katre fyi

katre commented 6 years ago

Hmm, that's pretty odd. I'll investigate.

katre commented 6 years ago

Sent https://bazel-review.googlesource.com/#/c/bazel/+/20530