Forbid the empty-string configuration
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the bug:
In a bazelrc file, I can write:
```
common -c opt
common:opt -c opt
common: -c opt
```
In my case, the last line was a typo. I was surprised to see the line was silently ignored, and wasted time because of this. In practice, the line does something if the user passes `--config=` without a name!
I don't see why someone would want to do that, so I'd suggest this should be an error when parsing bazelrc files.
### Which category does this issue belong to?
Core
### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
_No response_
### Which operating system are you running Bazel on?
_No response_
### What is the output of `bazel info release`?
release 7.1.0
### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.
_No response_
### What's the output of `git remote get-url origin; git rev-parse HEAD` ?
_No response_
### Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
_No response_
### Have you found anything relevant by searching the web?
_No response_
### Any other information, logs, or outputs that you want to share?
_No response_
Contributor guide
Research direction
Start at Bazel's bazelrc parsing entry point and reproduce the examples from the issue, especially the empty `common:` scope and `--config=` behavior. Trace how configuration names are validated and add coverage showing that an empty configuration is rejected while named configurations continue to work.
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
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100