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

GoLink: warning: package "github.com/golang/protobuf/protoc-gen-go/descriptor" is provided by more than one rule #1552

Closed
junghoahnsc opened this issue Jun 14, 2018 · 4 comments

Comments

@junghoahnsc
Copy link

After I upgraded to 0.11.2, I can see many warnings like this:

INFO: From GoLink a/b/c/.../linux_amd64_stripped/multiassigner_test:
GoLink: warning: package "github.com/golang/protobuf/protoc-gen-go/descriptor" is provided by more than one rule:
    @com_github_golang_protobuf//protoc-gen-go/descriptor:go_default_library
    @io_bazel_rules_go//proto/wkt:descriptor_go_proto
Set "importmap" to different paths in each library.
This will be an error in the future.

There seem to be a few opened issues that are related to this.
Is this a known issue and will be fixed?

Thanks,

@rogerhub
Copy link

The custom BUILD rules for com_github_golang_protobuf suggest that the first rule is an alias of the second rule. Are you declaring your own com_github_golang_protobuf repository rule?

@jayconrod
Copy link
Contributor

As @rogerhub pointed out, I "fixed" this in master, but that fix is causing problems with builds that include pre-generated .pb.go files but don't use go_proto_library, so it will be rolled back.

#1548 is the plan to deal with this once and for all.

@junghoahnsc
Copy link
Author

Yes, we have our own:

go_repository(
        name = "com_github_golang_protobuf",
        importpath = "github.com/golang/protobuf",
        tag = "v1.1.0",
    )

@jayconrod
Copy link
Contributor

The fixes for #1548 have landed, and release 0.13.0 will be tagged in the next day or two with those fixes.

Note that the rules in com_github_golang_protobuf have some minor customization compared to what Gazelle generates, but I think if you add build_file_proto_mode = "disable_global" in that rule, that will get you very close.

Please reopen if you have issues with 0.13.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants