-
Notifications
You must be signed in to change notification settings - Fork 327
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
Update protobuf with relative repo names patch #29
Conversation
Essentially a "cherrypick" of protocolbuffers/protobuf#9187
Won't changing the name here break all existing users of proto? If they want to use bazel mod |
No, as long as they specify the bazel_dep(name="protobuf", version="3.19.0", repo_name="com_google_protobuf") They wouldn't need to update their references. |
So is the plan as repos add themselves to this to change their names to not use the previous conventions? |
This seems scary in general. There isn't an agreement on what to name repositories in general (three core rulesets disagree on io_bazel_stardoc for example). bzlmod picking new names just adds a footgun for users. I don't think this is the layer where you can do vanity renames. |
By "add themselves to this", do you mean projects submitting themselves to the central registry? They yes, I think it's the most sensible to use something immediately recognizable, instead of the reverse domain convention.
This is exactly what the central registry aims to resolve. The modules in the registry have a clear name; the module "foo" will become the repo
Could you clarify your concern? Why is this a footgun? I would expect, as a user, that adding a dependency on a module called "foo" should give me |
earlier you said
and I don't think users are going to know they have to do that. You're giving them an easy way to make the repo be named "@protobuf" which is breaking but not an easy way to make it be named "@com_google_protobuf" which will be required for interop with all other rulesets. I'm fairly confident this will be a major obstacle to bzlmod adoption. |
@alexeagle Let me clarify a bit how For example, if A depends on B and C, B depends on C. In A's MODULE.bazel file, you can define:
Then A can refer to targets of C via repo name "@com_foo_bar_c".
then B still sees targets of module C via "@C". So, basically different modules can depend on the same module with different repo names. We implemented this with the repo mapping feature. Every module has a canonical repo name (<module_name>.), that's used to create the Here's a little example: https://github.com/meteorcloudy/bzlmod-examples/blob/main/examples/09-repo-name/MODULE.bazel |
What Yun said; to be more explicit, this part
is not true. You can use any |
thanks @meteorcloudy and @Wyverald I think I understand, any ruleset that depends on com_google_protobuf today will have to include an explicit |
Essentially a "cherrypick" of protocolbuffers/protobuf#9187