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

Protobuf / GRPC rules implictly require @io_bazel_rules_rust//proto/raze #170

Closed
GregBowyer opened this issue Dec 10, 2018 · 3 comments
Closed

Comments

@GregBowyer
Copy link
Contributor

I might be missing something, but following the documentation for using a custom location for the deps for these rules leads to the following failure at compile time.

greg@gregslaptop ~/work/core-ticketing-host $ bazel build --config x64 --config debug //third_party/bazel:extra_actions_proto_rust_stubs
ERROR: /home/greg/.cache/bazel/_bazel_greg/c75e2059c1e63a4c3c0afb06f978fe5a/external/io_bazel_rules_rust/proto/raze/BUILD:25:1: no such package '@raze__protobuf__1_6_0//': The repository could not be resolved and referenced by '@io_bazel_rules_rust//proto/raze:protobuf'
ERROR: Analysis of target '//third_party/bazel:extra_actions_proto_rust_stubs' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.311s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)

If I hack the file rust_rules/proto/toolchain.bzl to have the following

PROTO_COMPILE_DEPS = [
    "@bedrock//third_party/rust:protobuf",
    #"@io_bazel_rules_rust//proto/raze:protobuf",
]
"""Default dependencies needed to compile protobuf stubs."""

I then get a clean compile. I am not referencing this anywhere in my actual BUILD files (I am calling out the deps directly).

I think bazel is trying to resolve the labels in the line default = [Label(l) for l in PROTO_COMPILE_DEPS], to rules, and coming up short.

I cannot think about how to get around this without using bind in the WORKSPACE

any thoughts?

@mfarrugi
Copy link
Collaborator

I assume it wasn't intended to require bind, and it's surprising that the unused default value is resolved.

@damienmg any thoughts on this?

@damienmg
Copy link
Collaborator

You can change it by setting rust_deps to the rust_grpc_library. I just realized the documentation about that is incorrect.

@damienmg
Copy link
Collaborator

Send a PR to fix the documentation :)

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