-
-
Notifications
You must be signed in to change notification settings - Fork 286
scalapb_proto_library does not support well known protobufs #312
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
Comments
I've managed to solve the problem. Ultimately it came down to using |
I take it back. I'm still struggling with this. Given this
And this
Building
I'm using the latest https://github.com/google/protobuf and https://github.com/bazelbuild/rules_scala but that doesn't seem to make a difference. I don't know what I did to break things since yesterday but here we are. |
Did you mean to close the issue? Asking since it seems your problem hasn't
been resolved
…On Thu, 19 Oct 2017 at 21:34 Ryan Bourgeois ***@***.***> wrote:
I take it back. I'm still struggling with this. Given this WORKSPACE file:
workspace(
name = "com_github_zenreach_platypus_protocols",
)
protobuf_version = "09e0dbcf8f8a078070921e18b0592dbe7f9628df"
protobuf_sha = "3e037866c379c902d3d3c26ef930a3d4dc230773f830de853a35ddf3d9012518"
rules_scala_version = "fda0f4b1d68ad371481b7f5ad1592d4323497d8e"
http_archive(
name = "com_google_protobuf",
url = "https://github.com/google/protobuf/archive/%s.tar.gz" % protobuf_version,
strip_prefix = "protobuf-%s" % protobuf_version,
sha256 = protobuf_sha,
)
http_archive(
name = "com_google_protobuf_cc",
url = "https://github.com/google/protobuf/archive/%s.tar.gz" % protobuf_version,
strip_prefix = "protobuf-%s" % protobuf_version,
sha256 = protobuf_sha,
)
http_archive(
name = "com_google_protobuf_java",
url = "https://github.com/google/protobuf/archive/%s.tar.gz" % protobuf_version,
strip_prefix = "protobuf-%s" % protobuf_version,
sha256 = protobuf_sha,
)
http_archive(
name = "io_bazel_rules_go",
url = "https://github.com/bazelbuild/rules_go/releases/download/0.6.0/rules_go-0.6.0.tar.gz",
sha256 = "ba6feabc94a5d205013e70792accb6cce989169476668fbaf98ea9b342e13b59",
)
http_archive(
name = "io_bazel_rules_scala",
url = "https://github.com/bazelbuild/rules_scala/archive/%s.tar.gz" % rules_scala_version,
strip_prefix = "rules_scala-%s" % rules_scala_version
)
***@***.***_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
***@***.***_bazel_rules_go//proto:def.bzl", "proto_register_toolchains")
***@***.***_bazel_rules_scala//scala:scala.bzl", "scala_repositories")
***@***.***_bazel_rules_scala//scala_proto:scala_proto.bzl", "scala_proto_repositories")
proto_register_toolchains()
go_rules_dependencies()
go_register_toolchains()
scala_repositories()
scala_proto_repositories()
And this scalapb/BUILD file:
***@***.***_bazel_rules_scala//scala_proto:scala_proto.bzl", "scalapb_proto_library")
proto_library(
name = "scalapb_proto",
srcs = ["scalapb.proto"],
deps = [
***@***.***_google_protobuf//:descriptor_proto",
],
visibility = ["//visibility:public"],
)
java_proto_library(
name = "scalapb_java_proto",
deps = [":scalapb_proto"],
visibility = ["//visibility:public"],
)
scalapb_proto_library(
name = "scalapb_scala_proto",
deps = [":scalapb_proto"],
#deps = [":scalapb_java_proto"],
#with_java = True,
with_flat_package = True,
visibility = ["//visibility:public"],
)
Building scalapb_proto and scalapb_java_proto succeed. However, building
scalapb_scala_proto fails with the following output:
$ bazel build scalapb:scalapb_scala_proto
INFO: Found 1 target...
ERROR: /home/sadpengu/Work/src/github.com/zenreach/platypus/protocols/scalapb/BUILD:18:1: scala //scalapb:scalapb_scala_proto failed (Exit 1).
java.lang.RuntimeException: Must have input files from either source jars or local files.
at io.bazel.rulesscala.scalac.ScalacProcessor.processRequest(ScalacProcessor.java:60)
at io.bazel.rulesscala.worker.GenericWorker.run(GenericWorker.java:125)
at io.bazel.rulesscala.scalac.ScalaCInvoker.main(ScalaCInvoker.java:41)
Target //scalapb:scalapb_scala_proto failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.322s, Critical Path: 0.19s
I'm using the latest https://github.com/google/protobuf and
https://github.com/bazelbuild/rules_scala but that doesn't seem to make a
difference. I don't know what I did to break things since yesterday but
here we are.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#312 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABUIF22OvehgG1l9jaZhlw8OrtMktOFLks5st5Y5gaJpZM4P-FQh>
.
|
No I meant to re-open it actually. I've worked around the problem by copying the well-known protos from https://github.com/google/protobuf into our repo and adding |
So I've got this build file:
Building it results in the following output:
Using
with_java
and setting the dependency to thescalapb_java_library
results in a more cryptic error:Based on the description of #281 I assume this is due to these files (technically) being remote.
Keeping a local copy of all the well-known protos (and writing a stack of BUILD files) seems like an unnecessary step since Bazel has to download this to get protobuf support at all. Is there a more elegant work-around? Or am I just doing something wrong?
The text was updated successfully, but these errors were encountered: