`bazel info` fails with missing repo rule
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the bug:
If you have a project like this:
```bzl
# MODULE.bazel
host_platform = use_repo_rule("//:platform.bzl", "host_platform")
host_platform(name = "host_platform")
```
```bzl
# .bazelrc
build --platforms=@host_platform//:platform
```
And you run `bazel info` it fails with:
```
ERROR: com.google.devtools.build.lib.packages.BuildFileNotFoundException: no such package '@@host_platform//': The repository '@@host_platform' could not be resolved: Repository '@@host_platform' is not defined
```
`bazel build` works correctly.
### Which category does this issue belong to?
_No response_
### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
run `bazel info` in this project: [repro3.zip](https://github.com/user-attachments/files/18607853/repro3.zip)
### Which operating system are you running Bazel on?
macOS / Linux
### What is the output of `bazel info release`?
8.0.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` ?
```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
Unpack repro3.zip and inspect MODULE.bazel and .bazelrc, then run bazel info on Bazel 8.0.0 on macOS or Linux to reproduce the missing repository error. Compare the behavior with bazel build; done means bazel info resolves @host_platform successfully without breaking the existing build.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100