`--enable_platform_specific_config` does not behave similarly as command-line argument as in .bazelrc
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the bug:
With a `.bazelrc` of (I'm using the failure to load the downloader config file to see what is configuration applied):
```
common --enable_platform_specific_config
common --downloader_config=common_downloader.cfg
common:linux --downloader_config=linux_downloader.cfg
common:macos --downloader_config=macos_downloader.cfg
```
I get the following output on a Linux machine:
```
% bazel test ...
ERROR: Failed to parse downloader config: Unable to find downloader config file common_downloader.cfg
% bazel test --config=linux ...
ERROR: Failed to parse downloader config: Unable to find downloader config file linux_downloader.cfg
% bazel test --enable_platform_specific_config ...
ERROR: Failed to parse downloader config: Unable to find downloader config file linux_downloader.cfg
```
This seems to conflict with [the documentation that indicates](https://bazel.build/versions/8.4.0/reference/command-line-reference#flag--enable_platform_specific_config) that `--enable_platform_specific_config` (specified it in the .bazelrc) is equivalent to applying `--config=linux`. (And also in [this .bazelrc documentation](https://bazel.build/versions/8.4.0/run/bazelrc#enable_platform_specific_config))
Note that if I remove the `common --downloader_config=common_downloader.cfg` line, it does seem to take the `common:linux` configuration. It's difficult for me to understand what is going on here. Maybe there is a conflict between `common` and `common:linux` when no command-line arguments are specified? It's confusing to me that the behavior is different when specifying `--enable_platform_specific_config` in .bazelrc and in command-line.
### Which category does this issue belong to?
Client, Core
### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
https://github.com/chrisirhc/bazel-repro contains a reproduction.
### Which operating system are you running Bazel on?
Linux
### What is the output of `bazel info release`?
release 8.4.1
### 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` ?
```text
```
### If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.
_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 with the linked bazel-repro and compare `bazel test`, `bazel test --config=linux`, and `bazel test --enable_platform_specific_config` using the shown `.bazelrc`. Trace how the `common` and `common:linux` entries are applied in each invocation. Done means the command-line flag and the `.bazelrc` setting select equivalent configuration, with tests covering the downloader-config behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100