Hello world example does not compile
- Dominant language
- Rust
- Stars
- 12.5k
- Forks
- 1.3k
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 24
Description
## Bug Report
### Version
Latests `master` on github
### Platform
Linux dev-fedora 6.1.43-1.qubes.fc32.x86_64
### Description
I did the following
`git clone https://github.com/hyperium/tonic.git`
`cd tonic/examples`
`cargo build --bin helloworld-server`
and then I get the following error:
```
Compiling examples v0.1.0 (/home/user/dev/experiments/tonic/examples)
error: failed to run custom build command for `examples v0.1.0 (/home/user/dev/experiments/tonic/examples)`
Caused by:
process didn't exit successfully: `/home/user/dev/experiments/tonic/target/debug/build/examples-e0eba3978652fe71/build-script-build` (exit status: 101)
--- stdout
cargo:rerun-if-changed=proto/routeguide/route_guide.proto
cargo:rerun-if-changed=proto
cargo:rerun-if-changed=proto/helloworld/helloworld.proto
cargo:rerun-if-changed=proto
cargo:rerun-if-changed=proto/echo/echo.proto
cargo:rerun-if-changed=proto/echo
cargo:rerun-if-changed=proto/unaryecho/echo.proto
cargo:rerun-if-changed=proto/unaryecho
cargo:rerun-if-changed=proto/attrs/attrs.proto
cargo:rerun-if-changed=proto
cargo:rerun-if-changed=proto/googleapis/google/pubsub/v1/pubsub.proto
cargo:rerun-if-changed=proto/googleapis
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "protoc failed: google/protobuf/descriptor.proto: File not found.\ngoogle/api/annotations.proto:20:1: Import \"google/protobuf/descriptor.proto\" was not found or had errors.\ngoogle/api/annotations.proto:28:8: \"google.protobuf.MethodOptions\" is not defined.\ngoogle/api/client.proto:19:1: Import \"google/protobuf/descriptor.proto\" was not found or had errors.\ngoogle/api/client.proto:27:8: \"google.protobuf.MethodOptions\" is not defined.\ngoogle/api/client.proto:66:8: \"google.protobuf.ServiceOptions\" is not defined.\ngoogle/api/client.proto: \"google.protobuf.ServiceOptions\" is not defined.\ngoogle/api/field_behavior.proto:19:1: Import \"google/protobuf/descriptor.proto\" was not found or had errors.\ngoogle/api/field_behavior.proto:27:8: \"google.protobuf.FieldOptions\" is not defined.\ngoogle/api/resource.proto:19:1: Import \"google/protobuf/descriptor.proto\" was not found or had errors.\ngoogle/api/resource.proto:28:8: \"google.protobuf.FieldOptions\" is not defined.\ngoogle/api/resource.proto:34:8: \"google.protobuf.FileOptions\" is not defined.\ngoogle/api/resource.proto:40:8: \"google.protobuf.MessageOptions\" is not defined.\ngoogle/protobuf/duration.proto: File not found.\ngoogle/protobuf/empty.proto: File not found.\ngoogle/protobuf/field_mask.proto: File not found.\ngoogle/protobuf/timestamp.proto: File not found.\ngoogle/pubsub/v1/schema.proto:19:1: Import \"google/api/annotations.proto\" was not found or had errors.\ngoogle/pubsub/v1/schema.proto:20:1: Import \"google/api/client.proto\" was not found or had errors.\ngoogle/pubsub/v1/schema.proto:21:1: Import \"google/api/field_behavior.proto\" was not found or had errors.\ngoogle/pubsub/v1/schema.proto:22:1: Import \"google/api/resource.proto\" was not found or had errors.\ngoogle/pubsub/v1/schema.proto:23:1: Import \"google/protobuf/empty.proto\" was not found or had errors.\ngoogle/pubsub/v1/schema.proto:70:50: \"google.protobuf.Empty\" is not defined.\ngoogle/pubsub/v1/pubsub.proto:19:1: Import \"google/api/annotations.proto\" was not found or had errors.\ngoogle/pubsub/v1/pubsub.proto:20:1: Import \"google/api/client.proto\" was not found or had errors.\ngoogle/pubsub/v1/pubsub.proto:21:1: Import \"google/api/field_behavior.proto\" was not found or had errors.\ngoogle/pubsub/v1/pubsub.proto:22:1: Import \"google/api/resource.proto\" was not found or had errors.\ngoogle/pubsub/v1/pubsub.proto:23:1: Import \"google/protobuf/duration.proto\" was not found or had errors.\ngoogle/pubsub/v1/pubsub.proto:24:1: Import \"google/protobuf/empty.proto\" was not found or had errors.\ngoogle/pubsub/v1/pubsub.proto:25:1: Import \"google/protobuf/field_mask.proto\" was not found or had errors.\ngoogle/pubsub/v1/pubsub.proto:26:1: Import \"google/protobuf/timestamp.proto\" was not found or had errors.\ngoogle/pubsub/v1/pubsub.proto:27:1: Import \"google/pubsub/v1/schema.proto\" was not found or had errors.\ngoogle/pubsub/v1/pubsub.proto:159:3: \"Encoding\" is not defined.\ngoogle/pubsub/v1/pubsub.proto:230:3: \"google.protobuf.Timestamp\" is not defined.\ngoogle/pubsub/v1/pubsub.proto:261:3: \"google.protobuf.FieldMask\" is not defined.\ngoogle/pubsub/v1/pubsub.proto:692:3: \"google.protobuf.Duration\" is not defined.\ngoogle/pubsub/v1/pubsub.proto:760:3: \"google.protobuf.Duration\" is not defined.\ngoogle/pubsub/v1/pubsub.proto:764:3: \"google.protobuf.Duration\" is not defined.\ngoogle/pubsub/v1/pubsub.proto:809:3: \"google.protobuf.Duration\" is not defined.\ngoogle/pubsub/v1/pubsub.proto:919:3: \"google.protobuf.FieldMask\" is not defined.\ngoogle/pubsub/v1/pubsub.proto:1192:3: \"google.protobuf.FieldMask\" is not defined.\ngoogle/pubsub/v1/pubsub.proto:1225:3: \"google.protobuf.Timestamp\" is not defined.\ngoogle/pubsub/v1/pubsub.proto:1304:5: \"google.protobuf.Timestamp\" is not defined.\ngoogle/pubsub/v1/pubsub.proto:118:48: \"google.protobuf.Empty\" is not defined.\ngoogle/pubsub/v1/pubsub.proto:463:16: \"google.protobuf.Empty\" is not defined.\ngoogle/pubsub/v1/pubsub.proto:476:16: \"google.protobuf.Empty\" is not defined.\ngoogle/pubsub/v1/pubsub.proto:492:48: \"google.protobuf.Empty\" is not defined.\ngoogle/pubsub/v1/pubsub.proto:529:16: \"google.protobuf.Empty\" is not defined.\ngoogle/pubsub/v1/pubsub.proto:607:54: \"google.protobuf.Empty\" is not defined.\n" }', examples/build.rs:33:10
```
If I remove the following lines from `examples/build.rs` it works again
```rust
tonic_build::configure()
.build_server(false)
.compile(
&["proto/googleapis/google/pubsub/v1/pubsub.proto"],
&["proto/googleapis"],
)
.unwrap();
```
Contributor guide
Assessment
This issue has not been assessed yet.