Skip to content
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

Using maven as the repo name causes duplicate warnings when using bzlmod #16839

Open
jschaf opened this issue May 13, 2024 · 0 comments
Open
Labels
untriaged auto added to all issues by default when created.

Comments

@jschaf
Copy link

jschaf commented May 13, 2024

Downstream bug in rules_jvm_external: bazelbuild/rules_jvm_external#916

What version of protobuf and what language are you using?

v23.1

What did you expect to see

A clean build when using bzlmod.

What did you see instead?

DEBUG: $TMP/external/rules_jvm_external~/private/extensions/maven.bzl:154:14:
The maven repository 'maven' is used in two different bazel modules,
originally in '<my_workspace>' and now in 'protobuf'

Summarizing @shs96c in bazelbuild/rules_jvm_external#916 (comment)

The common maven repo name allows rulesets to contribute to the user's JARs. However, this implies that maven is for the end user, not for transitive dependencies. If a ruleset needs private dependencies, it should use a custom namespace rather than the maven namespace.

Proposed fixes

There are a few ways to fix the logline:

  1. Patch protobuf in the Bazel Central Registry rewrite maven to protobuf_maven.
  2. Modify the protobuf repo to rewrite maven to protobuf_maven.
  3. Fetch the JARs manually without using Maven or rules_jvm_external. Trims the dependency graph a fair bit.

I think 2 is the best short-term option. If you're open to it, I can send a PR.

@jschaf jschaf added the untriaged auto added to all issues by default when created. label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged auto added to all issues by default when created.
Projects
None yet
Development

No branches or pull requests

1 participant