bazel icon indicating copy to clipboard operation
bazel copied to clipboard

--compile_one_dependency suggestion should not trigger when source files are picked up by wildcards

Open benjaminp opened this issue 3 years ago • 5 comments

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.

benjaminp avatar Jan 10 '22 20:01 benjaminp

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.

alexeagle avatar Mar 31 '22 04:03 alexeagle

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.

github-actions[bot] avatar Jun 13 '23 01:06 github-actions[bot]

@bazelbuild/triage Not stale

benjaminp avatar Jun 13 '23 01:06 benjaminp

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.

github-actions[bot] avatar Aug 18 '24 01:08 github-actions[bot]

This issue still exists.

benjaminp avatar Aug 21 '24 14:08 benjaminp

+1 is there a way to disable the warning?

antspy avatar Jul 04 '25 06:07 antspy