Skip to content

Commit

Permalink
chore: Handle + in canonical repo name
Browse files Browse the repository at this point in the history
To prepare for bazelbuild/bazel#23098
  • Loading branch information
honnix authored Oct 16, 2024
1 parent 8a19e94 commit 42a5823
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ruby/private/utils.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ def normalize_bzlmod_repository_name(name):
"""Converts Bzlmod repostory to its private name.
This is needed to define a target that is called the same as the repository.
For example, given a canonical name "rules_ruby~override~ruby~bundle",
For example, given a canonical name "rules_ruby+override+ruby+bundle" or
"rules_ruby~override~ruby~bundle",
the function would return "bundle" as the name.
This is a hacky workaround and will be fixed upstream.
Expand All @@ -156,6 +157,9 @@ def normalize_bzlmod_repository_name(name):
Returns:
repository name
"""
if "+" in name:
return name.rpartition("+")[-1]

return name.rpartition("~")[-1]

def to_rlocation_path(source):
Expand Down

0 comments on commit 42a5823

Please sign in to comment.