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

Conflict with new_go_repository() #23

Closed
junghoahnsc opened this issue Oct 5, 2016 · 3 comments
Closed

Conflict with new_go_repository() #23

junghoahnsc opened this issue Oct 5, 2016 · 3 comments

Comments

@junghoahnsc
Copy link

When some of go_proto_repositories likecom_github_golang_protobuf and org_golang_x_net are automatically imported by the dependencies of new_go_repository(), there are conflicts like

ERROR: /usr/local/share/users/jungho.ahn/cache/bazel/_bazel_jungho.ahn/c8d993de066bb9ba420445c3170a1d5a/external/org_pubref_rules_protobuf/go/BUILD:5:1: no such target '@com_github_golang_protobuf//:protoc_gen_go': target 'protoc_gen_go' not declared in package '' defined by /usr/local/share/users/jungho.ahn/cache/bazel/_bazel_jungho.ahn/c8d993de066bb9ba420445c3170a1d5a/external/com_github_golang_protobuf/BUILD and referenced by '@org_pubref_rules_protobuf//go:go'.
ERROR: /home/jungho.ahn/work/snapcraft/snapcraft/snapcraft_serving/proto/BUILD:14:1: no such target '@com_github_golang_protobuf//:proto': target 'proto' not declared in package ''; however, a source directory of this name exists.  (Perhaps add 'exports_files(["proto"])' to /BUILD, or define a filegroup?) defined by /usr/local/share/users/jungho.ahn/cache/bazel/_bazel_jungho.ahn/c8d993de066bb9ba420445c3170a1d5a/external/com_github_golang_protobuf/BUILD and referenced by '//proto:style_deployment_proto_go'.
ERROR: Analysis of target '//proto:style_deployment_proto_go' failed; build aborted.

This is because the BUILD files in protobuf/build_file and go/rules.bzl are using specific library names while the generated Go BUILD files by new_go_repository() are using go_default_library name.

Is there any work around for this?

@pcj
Copy link
Contributor

pcj commented Oct 5, 2016

  1. Option 1: You can suppress loading of specific go_proto_repositories deps according to https://github.com/pubref/rules_protobuf#overriding-or-excluding-workspace-dependencies, however I don't think this will completely solve the problem as the target names are different and there may be residual unmet label dependencies.
  2. Await Switch to new_go_repository. #16 that seeks to switch over the go deps in this repo to new_go_repository. This is probably the way to go.

@junghoahnsc
Copy link
Author

I tried 1), but it doesn't fix the issue as you said.
I'll wait #16.

Thanks!

@pcj
Copy link
Contributor

pcj commented Oct 7, 2016

new_go_repository is now the default in v0.7.0 (4b2d8fe)

@pcj pcj closed this as completed Oct 7, 2016
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

2 participants