-
-
Notifications
You must be signed in to change notification settings - Fork 678
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
Multiple providers for the same importpath #2206
Comments
This is not the only incidence of having multiple providers for the same importpath when it comes to wkt protos, which is defined in both @io_bazel_rules_go and @com_github_golang_protobuf. Making it worse, developers such as me do NOT have full control over the build files generated by gazelle, which has special rules for generating go_proto_library() targets that use rules_go/wkt definitions. I can understand how this divergence came about. But would like to see more convergence in the future. At the very least, I do not want such an issue to break my build in the future. |
This problem is described in Avoiding conflicts. Since you're using pre-generated .pb.go files here (or at least, not generated with
Yeah, the current situation is certainly not ideal. It will require a lot of time and careful thought to resolve without breaking builds. For now, the workaround above is all I can recommend.
I don't expect to make the warning above into an error until there's an easier (more automatic) way to resolve it. |
I'm having a similar issue, but I'm not sure
I'm getting a warning about that conflict - with a note this will become error in a future release. Anything I can do about besides overwriting |
What version of rules_go are you using?
0.19.1
What version of gazelle are you using?
0.18.1
What version of Bazel are you using?
0.28.0
Does this issue reproduce with the latest releases of all the above?
Not sure, but most probably does.
What operating system and processor architecture are you using?
Ubuntu 18.04.2
amd64
Any other potentially useful information about your toolchain?
N.A.
What did you do?
Run
What did you expect to see?
The
go_binary
targetadd_person
builds correctly.What did you see instead?
The binary does build, but with warnings such as below:
17:25 $ bazel build examples/proto/base/go:add_person INFO: Invocation ID: e0ce57c1-6a46-4c0a-9bab-2bce87595aea INFO: Analyzed target //examples/proto/base/go:add_person (0 packages loaded, 0 targets configured). INFO: Found 1 target... INFO: Writing explanation of rebuilds to 'build/logs' INFO: From GoLink examples/proto/base/go/linux_amd64_stripped/add_person: link: warning: package "github.com/golang/protobuf/ptypes/timestamp" is provided by more than one rule: @com_github_golang_protobuf//ptypes/timestamp:go_default_library @io_bazel_rules_go//proto/wkt:timestamp_go_proto Set "importmap" to different paths in each library. This will be an error in the future. link: warning: package "github.com/golang/protobuf/ptypes/any" is provided by more than one rule: @com_github_golang_protobuf//ptypes/any:go_default_library @io_bazel_rules_go//proto/wkt:any_go_proto Set "importmap" to different paths in each library. This will be an error in the future. link: warning: package "github.com/golang/protobuf/ptypes/duration" is provided by more than one rule: @com_github_golang_protobuf//ptypes/duration:go_default_library @io_bazel_rules_go//proto/wkt:duration_go_proto Set "importmap" to different paths in each library. This will be an error in the future. link: warning: package "github.com/golang/protobuf/ptypes" is provided by more than one rule: @com_github_golang_protobuf//ptypes:go_default_library_gen @com_github_golang_protobuf//ptypes:go_default_library Set "importmap" to different paths in each library. This will be an error in the future. Target //examples/proto/base/go:add_person up-to-date: build/bin/examples/proto/base/go/linux_amd64_stripped/add_person
The dependency graph is:
a.pdf
The
@com_github_golang_protobuf
repo is specified like the following:The text was updated successfully, but these errors were encountered: