Skip to content

Include the repo root directory in show_repo output - #31176

Open
fmeum wants to merge 2 commits into
bazelbuild:masterfrom
fmeum:claude/mod-repo-root-d3h3bs
Open

fmeum wants to merge 2 commits into
bazelbuild:masterfrom
fmeum:claude/mod-repo-root-d3h3bs

Conversation

@fmeum

@fmeum fmeum commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Description

Motivation

Give users an easy way to obtain the location of an external repo, especially one that avoids them having to compose it manually and hardcoding external.

Build API Changes

No

Checklist

  • I have added tests for the new use cases (if any).
  • I have updated the documentation (if applicable).

Release Notes

RELNOTES: bazel mod show_repo now prints the path of each repo's directory as a # Located at: comment in text output and as the new repo_root field in proto and JSON output.

Users currently have to compose `$(bazel info output_base)/external/<canonical
name>` by hand to locate a fetched repo on disk. `bazel mod show_repo` now
prints the path of each repo's root directory as a `# Located at:` comment in
text output and as the new `repo_root` field in the streamed proto and JSON
outputs. The path is derived without fetching the repo, so the directory only
exists after the repo has been fetched.

RELNOTES: `bazel mod show_repo` now prints the path of each repo's root
directory, as a `# Located at:` comment in text output and as the `repo_root`
field in proto and JSON output.
@fmeum
fmeum force-pushed the claude/mod-repo-root-d3h3bs branch from 7c127c5 to 747d8b9 Compare September 17, 2026 10:50
@fmeum
fmeum marked this pull request as ready for review September 17, 2026 10:51
@fmeum
fmeum requested a review from keith September 17, 2026 10:52
@github-actions github-actions Bot added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. area-Bzlmod Bzlmod-specific PRs, issues, and feature requests awaiting-review PR is awaiting review from an assigned reviewer labels Sep 17, 2026
@bazel-docs-pr-commenter

bazel-docs-pr-commenter Bot commented Sep 17, 2026

Copy link
Copy Markdown

[example](#mod-example6)). Use `--all_repos` to show definitions of all
repos in the entire dependency graph, or `--all_visible_repos` to show
definitions of all repos visible from the `--base_module`.
* `show_repo <arg>...`: Displays the definition and location of the

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Should we hint that this location will only materialize after the repo is fetched?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Bzlmod Bzlmod-specific PRs, issues, and feature requests awaiting-review PR is awaiting review from an assigned reviewer team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants