Skip to content

Commit

Permalink
Fix go_sdk extension failure for unnamed root module (#3612)
Browse files Browse the repository at this point in the history
Fixes failures such as the following of the root module never calls `module`:

```
                 go_download_sdk_rule(
 Error in repository_rule: invalid user-provided repo name '__download_0': valid names may contain only A-Z, a-z, 0-9, '-', '_', '.', and must start with a letter
```
  • Loading branch information
fmeum authored Jul 2, 2023
1 parent c70c70f commit 87a94b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion go/private/extensions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ def _default_go_sdk_name(*, module, multi_version, tag_type, index):
# Keep the version out of the repository name if possible to prevent unnecessary rebuilds when
# it changes.
return "{name}_{version}_{tag_type}_{index}".format(
name = module.name,
# "main_" is not a valid module name and thus can't collide.
name = module.name or "main_",
version = module.version if multi_version else "",
tag_type = tag_type,
index = index,
Expand Down

0 comments on commit 87a94b6

Please sign in to comment.