Comments (9)
The expected generated file is currently based on the protofile basename rather than the short_path, but this should be a supported use case.
from rules_protobuf.
Should be fixed by cc4556c. Can you confirm and close issue if it works for you?
from rules_protobuf.
I got the following error:
RROR: /usr/local/share/users/jungho.ahn/cache/bazel/_bazel_jungho.ahn/c8d993de066bb9ba420445c3170a1d5a/external/pb_schema/BUILD:17:1: in proto_compile rule @pb_schema//:snapcraft_proto.pb:
Traceback (most recent call last):
File "/usr/local/share/users/jungho.ahn/cache/bazel/_bazel_jungho.ahn/c8d993de066bb9ba420445c3170a1d5a/external/pb_schema/BUILD", line 17
proto_compile(name = 'snapcraft_proto.pb')
File "/usr/local/share/users/jungho.ahn/cache/bazel/_bazel_jungho.ahn/c8d993de066bb9ba420445c3170a1d5a/external/org_pubref_rules_protobuf/protobuf/internal/proto_compile.bzl", line 512, in _proto_compile_impl
_build_output_files(run, builder)
File "/usr/local/share/users/jungho.ahn/cache/bazel/_bazel_jungho.ahn/c8d993de066bb9ba420445c3170a1d5a/external/org_pubref_rules_protobuf/protobuf/internal/proto_compile.bzl", line 186, in _build_output_files
ctx.new_file("/".join(path))
external/pb_schema/./pb_schema/snapmind/snapcraft.pb.h.
ERROR: Analysis of target '@pb_schema//:snapcraft_proto' failed; build aborted.
WORKSPACE:
new_local_repository(
name = "pb_schema",
build_file = "BUILD.pb_schema",
path = __workspace_dir__ + "/pb_schema/proto",
)
BUILD:
load("@org_pubref_rules_protobuf//cpp:rules.bzl", "cc_proto_library")
cc_proto_library(
name = "snapcraft_proto",
protos = ["snapmind/snapcraft.proto"],
verbose = 2,
with_grpc = True,
deps = ["@protobuf//:cc_wkt_protos"],
)
from rules_protobuf.
OK, it'll look at it again :) There are two uses cases here, I guess I just solved for the first one:
- Invoking
protos = ["snapmind/snapcraft.proto"]
in own WORKSPACE. - Invoking
protos = ["snapmind/snapcraft.proto"]
in an external WORKSPACE (like your example).
from rules_protobuf.
Want to try 4a76440? It's not merged on master. Has a test example that you can refer to as well.
from rules_protobuf.
Thanks for the fix. It works!
BTW, when two local repositories have the same paths, how can I distinguish them in #include
?
E.g., repository A and B has proto/a/b.proto and I'd like to include A's proto/a/b.pb.h.
I tried #include "external/A/proto/a/b.pb.h"
. It seems to find it, but I got some unrelated errors like
In file included from model_server/server.cc:16:0:
bazel-out/local-fastbuild/genfiles/external/pb_schema/proto/snapcraft/snapcraft.grpc.pb.h:126:84: error: 'grpc::ServerUnaryStreamer' has not been declared
virtual ::grpc::Status StreamedStylize(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::snapcraft::StylizationRequest,::snapcraft::StylizationResponse>* server_unary_streamer) = 0;
from rules_protobuf.
What does your cc_library rule look like? Does it depend on both A and B's proto_library rule?
from rules_protobuf.
For now, the cc_library depends on only A. But I'm just curious when cc_library depends on both.
from rules_protobuf.
I have not tried it, but I would imagine that one would have to disambiguate the names somehow. Since the name of #include file would be the same (does not incorporate the workspace name A|B), would be confusing.
In that case perhaps a genrule to cp the proto file to a new namespace might work.
Glad to hear the fix worked. Thanks for your testing and feedback.
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.