--compile_one_dependency suggestion should not trigger when source files are picked up by wildcards
6087f5d94779558ca044420a195547054db58a02 added a warning that triggers when building or testing the all the targets in any real-life package. E.g.,
$ cat BUILD
cc_test(
name = 't',
srcs = ['a.cc', 'b.cc']
)
$ bazel build //:*
WARNING: BUILD: //:BUILD is a source file, nothing will be built for it. If you want to build a target that consumes this file, try --compile_one_dependency
WARNING: BUILD:1:8: //:b.cc is a source file, nothing will be built for it. If you want to build a target that consumes this file, try --compile_one_dependency
WARNING:BUILD:1:8: //:a.cc is a source file, nothing will be built for it. If you want to build a target that consumes this file, try --compile_one_dependency
I suggest that is excessive.
It also doesn't make sense to print that warning for bazel run since we don't care whether it was a build output or a source file. For example running bazel run @go_sdk//:bin/go mod tidy prints this warning.
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.
@bazelbuild/triage Not stale
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.
This issue still exists.
+1 is there a way to disable the warning?