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

Failure to build rules_proto targets: missing strict dependencies #123

Closed
jacobstr opened this issue Feb 8, 2018 · 1 comment
Closed

Comments

@jacobstr
Copy link

jacobstr commented Feb 8, 2018

Reproducible with the following WORKSPACE + bazel 0.10. rules_go, bazel_gazelle, and rules_proto are all HEAD as of the opening of this ticket.

Command

bazel build @com_github_grpc_ecosystem_grpc_gateway//runtime:go_default_library

Workspace

git_repository(
    name = "io_bazel_rules_go",
    remote = "https://github.com/bazelbuild/rules_go.git",
    commit = "59327146e5395cd1773bab0107d974f660cc0852",
)
git_repository(
    name = "bazel_gazelle",
    remote = "https://github.com/bazelbuild/bazel-gazelle.git",
    commit = "683e26c7a735ee7539ef4e2ec1d9f4351e2b98b2",
)

load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
go_rules_dependencies()
go_register_toolchains()

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
gazelle_dependencies()

git_repository(
    name='org_pubref_rules_protobuf',
    remote='https://github.com/pubref/rules_protobuf',
    # Includes a fix for bazel 0.8.
    commit='1e42832fe73a7a15c33a96f31618e98a826447d5',
)
load('@org_pubref_rules_protobuf//go:rules.bzl', 'go_proto_repositories')
load('@org_pubref_rules_protobuf//grpc_gateway:rules.bzl', 'grpc_gateway_proto_repositories')

go_proto_repositories()
grpc_gateway_proto_repositories()

Error

GoCompile external/com_github_grpc_ecosystem_grpc_gateway/runtime/darwin_amd64_stripped/go_default_library~/github.com/grpc-ecosystem/grpc-gateway/runtime.a failed (Exit 1)
2018/02/08 14:45:31 missing strict dependencies:
	external/com_github_grpc_ecosystem_grpc_gateway/runtime/handler.go: import of github.com/grpc-ecosystem/grpc-gateway/runtime/internal, which is not a direct dependency
Target @com_github_grpc_ecosystem_grpc_gateway//runtime:go_default_library failed to build
@jayconrod
Copy link
Contributor

This is the build file from runtime/internal:

load("@io_bazel_rules_go//go:def.bzl", "go_library")

filegroup(
    name = "go_default_library_protos",
    srcs = ["stream_chunk.proto"],
    visibility = ["//visibility:public"],
)

go_library(
    name = "go_default_library",
    srcs = ["stream_chunk.pb.go"],
    importpath = "internal",
    visibility = ["//visibility:public"],
    deps = ["@com_github_golang_protobuf//proto:go_default_library"],
)

importpath is internal but should be github.com/grpc-ecosystem/grpc-gateway/runtime/internal. This happens because the .proto file in that directory has option go_package = "internal";. This was fixed in #125. So this issue should go away if you update to the tip of master.

I'll close this issue as a duplicate of #124, but please re-open if you still have problems.

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