Incomplete stacktrace in `bazel mod show_repo`
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the bug:
The command `bazel mod show_repo` includes a stacktrace at the end of the output. In most cases, it just says ` in `, which doesn't give any information. I'd expect for example to get the line of `bazel_dep` in a MODULE.bazel file.
Example:
```starlark
$ bazel mod show_repo rules_cc@0.0.9
## rules_cc@0.0.9:
#
http_archive(
name = "rules_cc~",
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"],
integrity = "sha256-IDeHW5pEVtzkp50RKorohbvEqtlo5lh9ym5k86CQDN8=",
strip_prefix = "rules_cc-0.0.9",
remote_file_urls = {},
remote_file_integrity = {},
remote_patches = {"https://bcr.bazel.build/modules/rules_cc/0.0.9/patches/module_dot_bazel_version.patch": "sha256-mM+qzOI0SgAdaJBlWOSMwMPKpaA9b7R37Hj/tp5bb4g="},
remote_patch_strip = 0,
)
# Rule rules_cc~ instantiated at (most recent call last):
# in
# Rule http_archive defined at (most recent call last):
# /Users/laurent/output_base/external/bazel_tools/tools/build_defs/repo/http.bzl:388:31 in
```
### 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.
_No response_
### Which operating system are you running Bazel on?
_No response_
### What is the output of `bazel info release`?
_No response_
### 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 by reproducing `bazel mod show_repo rules_cc@0.0.9` and tracing how its stacktrace is assembled, using the shown `MODULE.bazel` `bazel_dep` context and `http.bzl:388:31` as reference points. Done means the output identifies the relevant MODULE.bazel source line instead of only showing ` in `.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100