Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format "Repository names and strict deps" bullet list #22663

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions site/en/external/module.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,18 @@ multiple versions of the module in the entire dependency graph (see
Note that **the canonical name format** is not an API you should depend on and
**is subject to change at any time**. Instead of hard-coding the canonical name,
use a supported way to get it directly from Bazel:
* In BUILD and `.bzl` files, use
[`Label.repo_name`](/rules/lib/builtins/Label#repo_name) on a `Label` instance
constructed from a label string given by the apparent name of the repo, e.g.,
`Label("@bazel_skylib").repo_name`.
* When looking up runfiles, use
[`$(rlocationpath ...)`](https://bazel.build/reference/be/make-variables#predefined_label_variables)
or one of the runfiles libraries in
`@bazel_tools//tools/{bash,cpp,java}/runfiles` or, for a ruleset `rules_foo`,
in `@rules_foo//foo/runfiles`.
* When interacting with Bazel from an external tool such as an IDE or language
server, use the `bazel mod dump_repo_mapping` command to get the mapping from
apparent names to canonical names for a given set of repositories.
* In BUILD and `.bzl` files, use
[`Label.repo_name`](/rules/lib/builtins/Label#repo_name) on a `Label` instance
constructed from a label string given by the apparent name of the repo, e.g.,
`Label("@bazel_skylib").repo_name`.
* When looking up runfiles, use
[`$(rlocationpath ...)`](https://bazel.build/reference/be/make-variables#predefined_label_variables)
or one of the runfiles libraries in
`@bazel_tools//tools/{bash,cpp,java}/runfiles` or, for a ruleset `rules_foo`,
in `@rules_foo//foo/runfiles`.
* When interacting with Bazel from an external tool such as an IDE or language
server, use the `bazel mod dump_repo_mapping` command to get the mapping from
apparent names to canonical names for a given set of repositories.

[Module extensions](/external/extension) can also introduce additional repos
into the visible scope of a module.
Loading