bazelbuild / bazelbuild/bazel

valid user-provided repo names are not documented

Open
#24,285 1 comment 1 reaction 1 assignee Claimed by @Wyverald View on GitHub
help wanted P2 team-Documentation team-ExternalDeps type: documentation (cleanup)
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Page link:

_No response_

### Problem description (include actual vs expected text, if applicable):

I ran into an error like this when trying to enable bzlmod in our repository (with Bazel 7.2.1):
```
Error in use_repo: invalid user-provided repo name '2022-05-11_log': valid names may contain only A-Z, a-z, 0-9, '-', '_', '.', and must start with a letter
```
Interestingly enough, this repository name was just fine without bzlmod enabled.
Where are the restrictions on user-provided repo names documented on bazel.build? I saw nothing relevant on https://bazel.build/rules/lib/globals/module#use_repo

### Where do you see this issue? (include link to specific section of the page, if applicable)

One place where it appears to be missing is https://bazel.build/rules/lib/globals/module#use_repo but I suspect it should be mentioned more centrally as well, as it is intended to apply to all repository names.

### Any other information you'd like to share?

Comments from @Wyverald on the Bazel slack:

Screenshot 2024-11-11 at 11 12 13 PM

Links in the screenshot are:
* https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkRepositoryModule.java;drc=c4eba38eacc73c7908eb7fc59261bfc4ce8d821a;l=273 (Starlark repo rule)
* https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/packages/WorkspaceFactory.java;drc=c4eba38eacc73c7908eb7fc59261bfc4ce8d821a;l=271 (native repo rule)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.