Skip to content

Prost rules failing with googleapis/google/api/annotations.proto #2046

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

Closed
UebelAndre opened this issue Jul 3, 2023 · 1 comment · Fixed by #2047
Closed

Prost rules failing with googleapis/google/api/annotations.proto #2046

UebelAndre opened this issue Jul 3, 2023 · 1 comment · Fixed by #2047

Comments

@UebelAndre
Copy link
Collaborator

Continuing from #2033 (comment)

@aaronmondal

@illicitonion @freeformstu I believe there is still some issue remaining that you mentioned regarding googleapis and remoteapis. The failed CI runs for 74e5b08 seem to also indicate that this is not just a windows issue. Curiously, I can get client.proto to build fine, but annotations.proto still fails:

rust_prost_library(
    name = "annotations",
    proto = "@googleapis//google/api:annotations_proto",
)
ERROR: /home/aaron/.cache/bazel/_bazel_aaron/36db8dcbcbc6b1f82b5ba98ed0247b3e/external/googleapis/google/api/BUILD.bazel:9:14: TonicGenProto @googleapis//google/api:annotatio
ns_proto failed: (Exit 101): protoc_wrapper failed: error executing command (from target @googleapis//google/api:annotations_proto) 
  (cd /home/aaron/.cache/bazel/_bazel_aaron/36db8dcbcbc6b1f82b5ba98ed0247b3e/sandbox/linux-sandbox/612/execroot/turbo-cache && \
  exec env - \
    PATH=/home/aaron/.cache/bazelisk/downloads/bazelbuild/bazel-6.2.1-linux-x86_64/bin:/home/aaron/.bun/bin:/home/aaron/.bun/bin:/home/aaron/.bun/bin:/home/aaron/.nix-profile
/bin:/nix/var/nix/profiles/default/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/bin:/usr/lib/llvm/16/bin:/home/aaron/Downloads/node/node-v18.16.0-linux-x64/bin:/home/aaro
n/.cargo/bin:/home/aaron/.local/bin:/home/aaron/Downloads/node/node-v18.16.0-linux-x64/bin:/home/aaron/.cargo/bin:/home/aaron/.local/bin:/home/aaron/Downloads/node/node-v18.1
6.0-linux-x64/bin:/home/aaron/.cargo/bin:/home/aaron/.local/bin \
  bazel-out/k8-opt-exec-2B5CBBC6/bin/external/rules_rust/proto/prost/private/protoc_wrapper '--protoc=bazel-out/k8-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/protoc' 
'--label=@googleapis//google/api:annotations_proto' '--out_librs=bazel-out/k8-fastbuild/bin/external/googleapis/google/api/annotations_proto.lib.tonic.rs' '--package_info_out
put=annotations_proto=bazel-out/k8-fastbuild/bin/external/googleapis/google/api/annotations_proto.tonic_package_info' '--deps_info=bazel-out/k8-fastbuild/bin/external/googlea
pis/google/api/annotations_proto.tonic_deps_info' '--prost_opt=compile_well_known_types' '--descriptor_set=bazel-out/k8-fastbuild/bin/external/googleapis/google/api/annotatio
ns_proto-descriptor-set.proto.bin' '--plugin=protoc-gen-tonic=bazel-out/k8-opt-exec-2B5CBBC6/bin/external/crate_index__protoc-gen-tonic-0.2.2/protoc-gen-tonic__bin' '--tonic_
opt=no_include' '--tonic_opt=compile_well_known_types' --is_tonic '--rustfmt=external/rustfmt_nightly-2023-06-01__x86_64-unknown-linux-gnu_tools/bin/rustfmt' '--prost_out=baz
el-out/k8-fastbuild/bin' '--plugin=protoc-gen-prost=bazel-out/k8-opt-exec-2B5CBBC6/bin/external/crate_index__protoc-gen-prost-0.2.2/protoc-gen-prost__bin' '--proto_path=exter
nal/googleapis' '--proto_path=bazel-out/k8-fastbuild/bin/external/com_google_protobuf/_virtual_imports/descriptor_proto' '-Igoogle/api/annotations.proto=external/googleapis/g
oogle/api/annotations.proto' '-Igoogle/api/http.proto=external/googleapis/google/api/http.proto' '-Igoogle/protobuf/descriptor.proto=bazel-out/k8-fastbuild/bin/external/com_g
oogle_protobuf/_virtual_imports/descriptor_proto/google/protobuf/descriptor.proto' external/googleapis/google/api/annotations.proto)
# Configuration: ca63adb307a1bd0f693440015ddae19ec8302707b6d51da41eab328714b1af2a
# Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
thread 'main' panicked at 'No .rs files were generated by prost.', external/rules_rust/proto/prost/private/protoc_wrapper.rs:724:9
@UebelAndre
Copy link
Collaborator Author

cc @illicitonion @freeformstu

illicitonion pushed a commit that referenced this issue Jul 5, 2023
…n. (#2047)

This PR consolidates rust_prost_library and rust_tonic_library into one rule; `rust_prost_library`. `rust_prost_library` will generate tonic services if you provide a `tonic_plugin` in the toolchain definition. If you do not provide that plugin and you try to build a proto with services, it will print a warning that you should add a `tonic_plugin`.

This PR also handles extension-only proto files. Prost does not generate a file if there are no messages, enums, or services and it appears that Prost doesn't even support proto2 extensions. So to work around this issue, protoc_wrapper will generate an empty `.rs` file in the case that there are only extensions defined in a file.

Closes: #2046
Silcet pushed a commit to Silcet/rules_rust that referenced this issue Jul 10, 2023
…n. (bazelbuild#2047)

This PR consolidates rust_prost_library and rust_tonic_library into one rule; `rust_prost_library`. `rust_prost_library` will generate tonic services if you provide a `tonic_plugin` in the toolchain definition. If you do not provide that plugin and you try to build a proto with services, it will print a warning that you should add a `tonic_plugin`.

This PR also handles extension-only proto files. Prost does not generate a file if there are no messages, enums, or services and it appears that Prost doesn't even support proto2 extensions. So to work around this issue, protoc_wrapper will generate an empty `.rs` file in the case that there are only extensions defined in a file.

Closes: bazelbuild#2046
Silcet pushed a commit to Silcet/rules_rust that referenced this issue Jul 10, 2023
…n. (bazelbuild#2047)

This PR consolidates rust_prost_library and rust_tonic_library into one rule; `rust_prost_library`. `rust_prost_library` will generate tonic services if you provide a `tonic_plugin` in the toolchain definition. If you do not provide that plugin and you try to build a proto with services, it will print a warning that you should add a `tonic_plugin`.

This PR also handles extension-only proto files. Prost does not generate a file if there are no messages, enums, or services and it appears that Prost doesn't even support proto2 extensions. So to work around this issue, protoc_wrapper will generate an empty `.rs` file in the case that there are only extensions defined in a file.

Closes: bazelbuild#2046
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant