Skip to content

Commit

Permalink
Fixes _module_repo_name when building with Bazel@HEAD or Bazel 7.1 (#…
Browse files Browse the repository at this point in the history
…21486)

If `get_canonical_repo_name` no longer returns the repo name with
version due to containing
a54a393,
the `_module_repo_name` should not either.

Fixes: #21292

Closes #21324.

PiperOrigin-RevId: 606646238
Change-Id: I8835a84842c2c66929586b39156eb9f5a541652f

Co-authored-by: Yun Peng <pcloudy@google.com>
  • Loading branch information
fweikert and meteorcloudy authored Feb 23, 2024
1 parent add245c commit f4205cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/tools/bzlmod/utils.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,9 @@ def _module_repo_name(module):
module_name = module["name"]
if module_name in _WELL_KNOWN_MODULES:
return module_name

# TODO(pcloudy): Simplify the following logic after we upgrade to 7.1
if get_canonical_repo_name("rules_cc").endswith("~"):
return "{}~".format(module_name)

return "{}~{}".format(module_name, module["version"])

0 comments on commit f4205cf

Please sign in to comment.