bazelbuild / bazelbuild/bazel

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

Open
#14,539 7 comments 9 reactions 0 assignees View on GitHub
not stale P3 team-Rules-CPP type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

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.

Contributor guide

Open the contributing guide

Research direction

Reproduce the warning with the BUILD example and `bazel build //:*`; then trace the warning behavior introduced by commit 6087f5d94779558ca044420a195547054db58a02. Done means wildcard expansion no longer suggests `--compile_one_dependency` for source files consumed by matching targets, while the intended warning remains for genuinely unbuildable source targets.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.