-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Expose a py_proto_library target for build_event_stream.proto so that way the python programs outside the Bazel repo can consume the BEP #15874
Comments
Having applied the patch below to my Bazel fork, I think it's evident that this is not the right approach here. diff --git src/main/java/com/google/devtools/build/lib/buildeventstream/proto/BUILD src/main/java/com/google/devtools/build/lib/buildeventstream/proto/BUILD
index 313dccb6e1..8311ef385e 100644
--- src/main/java/com/google/devtools/build/lib/buildeventstream/proto/BUILD
+++ src/main/java/com/google/devtools/build/lib/buildeventstream/proto/BUILD
@@ -4,6 +4,12 @@ load("@rules_proto//proto:defs.bzl", "proto_library")
package(default_visibility = ["//src:__subpackages__"])
+exports_files([
+ "build_event_stream.proto",
+])
+
filegroup(
name = "srcs",
srcs = glob(["**"]),
While this patch makes To that end, I think requesting for the BES proto file to be made publicly visible may be misguided, and I should instead request for a EDIT: Unfortunately, building a |
cc @michaeledgar, BEP is under team-core, right? |
Yes, it is, so yes we'd be the team responsible for making the proposed change. But can someone on |
On second thought, there's already Therefore I think the proposed change is very reasonable. |
Bazel is using Line 47 in 570c1f2
The implementation is not perfect, but using that one, should prevent any compatibility issues and it hopefully doesn't have problems crossing repo boundaries. The Bazel team plans to provide |
Looking forward to that!
I experimented with exposing a py_proto_library target with that rule on my fork, but ingesting this Error message
[Edit]: I think I need to create |
Yes, it seems so. I didn't know that |
Hi team, any updates on this? I'm a little blocked by this right now. Neither of the two popular |
I too became interested in how |
Description of the feature request:
Make the
src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto
file publicly visible. Alternatively, export the file withexports_files()
.What underlying problem are you trying to solve with this feature?
I have a Python tool that needs to ingest the build event stream, so I'm trying to generate a Python protobuf library for the BES.
I'm using the
@com_github_grpc_grpc//py_proto_library
rule as such:However, since the proto file of interest is in an external workspace, the generated
build_event_stream_proto_pb2.py
file has the following content which can't be imported:The workaround to this is to declare a
filegroup
with the proto file of interest, manually build a local proto library, and then list that target as a dependency (I've verified that this approach works with public proto files such as@io_bazel//src/main/protobuf:extra_actions_base.proto
).Unfortunately, this workaround does not work for this case because
build_event_stream.proto
is not publicly visible.Which operating system are you running Bazel on?
Ubuntu 20.04.4 LTS
What is the output of
bazel info release
?release 4.2.2
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
Nothing exactly relevant, but there are a bunch of questions about which
py_proto_library
rule to actually use (I've found 3 implementations...).Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: