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

Name conflict because . and - are both converted to _ #473

Open
JaredNeil opened this issue Oct 21, 2020 · 3 comments
Open

Name conflict because . and - are both converted to _ #473

JaredNeil opened this issue Oct 21, 2020 · 3 comments

Comments

@JaredNeil
Copy link
Contributor

JaredNeil commented Oct 21, 2020

com.google.api.client:google-api-client:1.4.1-beta and com.google.api-client:google-api-client:1.30.10 generate a target named @maven//:com_google_api_client_google_api_client.

I tried using override_targets to rename one or both of them, but it seems that happens after the collision and one of the targets is already lost.

Potential solutions:

  • Don't replace - with _
    • com.google.api-client:google-api-client:1.30.10 becomes @maven//:com_google_api-client_google-api-client_1_30_10
    • com.google.api.client:google-api-client:1.4.1-beta becomes @maven//:com_google_api_client_google-api-client_1_4_1_beta
  • Don't replace . with _
    • com.google.api-client:google-api-client:1.30.10 becomes @maven//:com.google.api_client_google_api_client_1.30.10
    • com.google.api.client:google-api-client:1.4.1-beta becomes @maven//:com.google.api.client_google_api_client_1.4.1_beta
  • Both of the above
    • com.google.api-client:google-api-client:1.30.10 becomes @maven//:com.google.api-client_google-api-client_1.30.10
    • com.google.api.client:google-api-client:1.4.1-beta becomes @maven//:com.google.api.client_google-api-client_1.4.1-beta

Since - and . are both valid anywhere in a target name, I don't see why we have to replace them.

On a related note, the : between group and artifact ID could also be maintained if we wanted to create a package for each group.

  • com.google.api-client:google-api-client:1.30.10 becomes @maven//com.google.api-client:google-api-client_1.30.10
  • com.google.api.client:google-api-client:1.4.1-beta becomes @maven//com.google.api.client:google-api-client_1.4.1-beta

Then the no-version name would match the artifact coord exactly.

  • com.google.api-client:google-api-client:1.30.10 becomes @maven//com.google.api-client:google-api-client
  • com.google.api.client:google-api-client:1.4.1-beta becomes @maven//com.google.api.client:google-api-client
@JaredNeil
Copy link
Contributor Author

I guess #268 would also be a solution to this issue.

@shs96c
Copy link
Collaborator

shs96c commented Oct 27, 2020

My feeling is that #268 provides a more scalable and neater solution, but would definitely be more work.

@jin
Copy link
Collaborator

jin commented Nov 13, 2020

#268 is definitely a better, more bazel-esque way of solving this problem. I reopened that issue.

@jin jin added the type: bug label Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants