Comments (11)
Just tried:
ERROR: /home/jungho.ahn/work/p/rules_protobuf_java_test/examples/proto/BUILD:19:1: error executing shell command: 'bazel-out/host/bin/external/com_github_google_protobuf/protoc --descriptor_set_out=bazel-out/local-fastbuild/genfiles/examples/proto/java.pb.descriptor_set --java_out=bazel-out/local-fastbuild/genf...' failed: linux-sandbox failed: error executing command
(cd /usr/local/share/users/jungho.ahn/cache/bazel/_bazel_jungho.ahn/7d1ea5683c20646cb1228e609b45731f/execroot/rules_protobuf_java_test && \
exec env - \
/usr/local/share/users/jungho.ahn/cache/bazel/_bazel_jungho.ahn/7d1ea5683c20646cb1228e609b45731f/execroot/rules_protobuf_java_test/_bin/linux-sandbox @/usr/local/share/users/jungho.ahn/cache/bazel/_bazel_jungho.ahn/7d1ea5683c20646cb1228e609b45731f/execroot/rules_protobuf_java_test/bazel-sandbox/18414400-34a3-459f-89d0-39d3fd5e3623-1.params -- /bin/bash -c 'bazel-out/host/bin/external/com_github_google_protobuf/protoc --descriptor_set_out=bazel-out/local-fastbuild/genfiles/examples/proto/java.pb.descriptor_set --java_out=bazel-out/local-fastbuild/genfiles/examples/proto/java.pb_java.jar --plugin=protoc-gen-grpc-java=bazel-out/host/genfiles/external/org_pubref_rules_protobuf/third_party/protoc_gen_grpc_java/protoc_gen_grpc_java --grpc-java_out=bazel-out/local-fastbuild/genfiles/examples/proto/java.pb_java.jar --proto_path=external/com_github_google_protobuf/src --proto_path=. examples/proto/common.proto').
external/com_github_google_protobuf/src: warning: directory does not exist.
google/protobuf/descriptor.proto: File not found.
examples/proto/common.proto: Import "google/protobuf/descriptor.proto" was not found or had errors.
examples/proto/common.proto:12:3: "google.protobuf.FileDescriptorProto" is not defined.
Target //examples/proto:java failed to build
from rules_protobuf.
Can you try pcj/rules_protobuf_java_test@2fb34ae? Could run into the same issue.
from rules_protobuf.
Sure. Yes, I got the same issue:
ubuntu-trusty-1:~/.../rules_protobuf_java_test/examples/proto] bazel build :java
.
WARNING: /usr/local/share/users/jungho.ahn/cache/bazel/_bazel_jungho.ahn/7d1ea5683c20646cb1228e609b45731f/external/org_pubref_rules_protobuf/protobuf/internal/proto_compile.bzl:413:5: proto_compile examples/proto/BUILD:java.pb.
WARNING: /usr/local/share/users/jungho.ahn/cache/bazel/_bazel_jungho.ahn/7d1ea5683c20646cb1228e609b45731f/external/org_pubref_rules_protobuf/protobuf/internal/proto_compile.bzl:380:5:
************************************************************
cd $(bazel info execution_root) && bazel-out/host/bin/external/com_github_google_protobuf/protoc \
--descriptor_set_out=bazel-out/local-fastbuild/genfiles/examples/proto/java.pb.descriptor_set \
--java_out=bazel-out/local-fastbuild/genfiles/examples/proto/java.pb_java.jar \
--plugin=protoc-gen-grpc-java=bazel-out/host/genfiles/external/org_pubref_rules_protobuf/third_party/protoc_gen_grpc_java/protoc_gen_grpc_java \
--grpc-java_out=bazel-out/local-fastbuild/genfiles/examples/proto/java.pb_java.jar \
--proto_path=external/com_github_google_protobuf/src \
--proto_path=. \
examples/proto/common.proto
************************************************************
examples/proto/java.pb_java.jar
examples/proto/java.pb.descriptor_set
************************************************************
.
INFO: Found 1 target...
ERROR: /home/jungho.ahn/work/p/rules_protobuf_java_test/examples/proto/BUILD:27:1: error executing shell command: 'bazel-out/host/bin/external/com_github_google_protobuf/protoc --descriptor_set_out=bazel-out/local-fastbuild/genfiles/examples/proto/java.pb.descriptor_set --java_out=bazel-out/local-fastbuild/genf...' failed: linux-sandbox failed: error executing command /usr/local/share/users/jungho.ahn/cache/bazel/_bazel_jungho.ahn/7d1ea5683c20646cb1228e609b45731f/execroot/rules_protobuf_java_test/_bin/linux-sandbox ... (remaining 5 argument(s) skipped).
external/com_github_google_protobuf/src: warning: directory does not exist.
google/protobuf/descriptor.proto: File not found.
examples/proto/common.proto: Import "google/protobuf/descriptor.proto" was not found or had errors.
examples/proto/common.proto:12:3: "google.protobuf.FileDescriptorProto" is not defined.
Target //examples/proto:java failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 33.262s, Critical Path: 20.48s
BTW, I'm also trying to generate for Go and Python, but Go failed like:
$ bazel build --spawn_strategy=standalone :goproto
ERROR: /home/jungho.ahn/work/p/rules_protobuf_java_test/examples/proto/BUILD:46:1: null failed: goproto.a.GoCompileFile.params failed: error executing command bazel-out/local-fastbuild/bin/examples/proto/bazel-out/local-fastbuild/bin/examples/proto/goproto.a.GoCompileFile.params: com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
bazel-out/local-fastbuild/genfiles/examples/proto/common.pb.go:19: can't find import: "google/protobuf"
Target //examples/proto:goproto failed to build
BUILD:
go_proto_library(
name = "goproto",
protos = ["common.proto"],
imports = ['external/com_github_google_protobuf/src'],
)
from rules_protobuf.
Assuming you called go_proto_repositories()
in the WORKSPACE
, looks like same issue.
from rules_protobuf.
Yes I called go_proto_repositories().
But with Go, it failed even when I gave --spawn_strategy=standalone
.
from rules_protobuf.
Looks like there are two issues.
- I tried
google/protobuf/timestamp.proto
instead ofdescriptor.prot
.
It seems to work withdeps= [ "@com_github_golang_protobuf//:ptypes/timestamp"]
,
but it failed withdeps= [ "@com_github_golang_protobuf//:ptypes"]
ERROR: /usr/local/share/users/jungho.ahn/cache/bazel/_bazel_jungho.ahn/7d1ea5683c20646cb1228e609b45731f/external/com_github_golang_protobuf/BUILD:76:1: in go_library rule @com_github_golang_protobuf//:ptypes:
Traceback (most recent call last):
File "/usr/local/share/users/jungho.ahn/cache/bazel/_bazel_jungho.ahn/7d1ea5683c20646cb1228e609b45731f/external/com_github_golang_protobuf/BUILD", line 76
go_library(name = 'ptypes')
File "/usr/local/share/users/jungho.ahn/cache/bazel/_bazel_jungho.ahn/7d1ea5683c20646cb1228e609b45731f/external/io_bazel_rules_go/go/def.bzl", line 275, in go_library_impl
fail("may not be empty", "srcs")
attribute srcs: may not be empty.
ERROR: Analysis of target '//examples/proto:proto_go' failed; build aborted.
- Unlike other google/protobuf/*, descriptor.proto has a different go_package.
https://github.com/google/protobuf/blob/master/src/google/protobuf/descriptor.proto#L43
I think M
param should be passed to --go_out
like Mgoogle/protobuf/descriptor.proto=github.com/golang/protobuf/protoc-gen-go/descriptor
and deps= [ "@com_github_golang_protobuf//:protoc-gen-go/descriptor" ]
should be added.
from rules_protobuf.
Looks like it compiled with
proto_compile_args = { 'importmap': {'google/protobuf/descriptor.proto': 'github.com/golang/protobuf/protoc-gen-go/descriptor'}},
Is this a right way to do that?
from rules_protobuf.
Yes! (nice job, BTW).
It should be easier than all this.
- The importmap option should better exposed such as
go_proto_library(importmap={...})
. - This should go in the
go/README.md
documentation. - The importmapping in go is always a bit confusing. It would be nice to have a table that maps out the accessible protos that exist in the provided deps.
Do you agree? I'll make a PR to update 1.
from rules_protobuf.
Yeah. It would be better!
from rules_protobuf.
Did you have any success getting well known types to work with java_proto_library?
from rules_protobuf.
Closing due to inactivity.
from rules_protobuf.
Related Issues (20)
- Can't build GRPC when using cpp_proto_repositories HOT 5
- py_proto_library fails when taking input from a genrule HOT 1
- Not work with rules_go v0.13.0 HOT 3
- Dart support? HOT 4
- Go rules HOT 1
- Can't resolve @go_googleapis//google/api HOT 1
- Custom protoc generators HOT 1
- using imports in py_proto_compile fails: _pb2.py and pb2_grpc.py not created HOT 1
- gogo_proto_library with the "well known types" (google/protobuf) HOT 12
- Non repeatable build for grpc_cli HOT 1
- Update rules_protobuf to rules_go 0.16.0 HOT 7
- Addition of protoc-gen-grpc-web HOT 2
- 32-bit C++ compilation HOT 3
- including well known protos in ruby_proto_compile HOT 4
- support latest grpc version HOT 1
- Bazel deprecated native http_archive rule HOT 2
- Unable to load package for 'org_pubref_rules_protobuf/java/rules.bzl' HOT 1
- name 'FileType' is not defined HOT 2
- BUG: Error in label: label() got unexpected keyword argument 'single_file' HOT 2
- file '//protobuf:rules.bzl' does not contain symbol 'proto_compile'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rules_protobuf.