grpc / grpc/grpc-rust

Cannot compile dependency

Open
#1,639 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
12.5k
Forks
1.3k
Avg merge
4d 7h
Merged PRs (30d)
24

Description

## Bug Report
### Version

└── tonic v0.11.0
└── tonic-build v0.7.2

### Platform

Windows 11 64-bit build: 22631.2715

### Description

Every time I try to compile tonic, with no features, I am constantly getting build errors
Ive tried to fix them by editing the codegen file, which worked but ofcourse every time I reopen vs code the errors re-appear.

I tried to compile the hello world example, but it didnt work. Ive been having this issue since january 7th, there i was using tonic "0.7" and when I added the feature "compression" these problems would appear.

```
error[E0599]: no method named send_gzip found for struct tonic::client::Grpc in the current scope
--> C:\Users\marci\Desktop\FileHosting\target\debug\build\FileHosting-878bc6a1594928c5\out/file_hosting.rs:69:37
|
69 | self.inner = self.inner.send_gzip();
| ^^^^^^^^^ method not found in Grpc

error[E0599]: no method named accept_gzip found for struct tonic::client::Grpc in the current scope
--> C:\Users\marci\Desktop\FileHosting\target\debug\build\FileHosting-878bc6a1594928c5\out/file_hosting.rs:75:37
|
75 | self.inner = self.inner.accept_gzip();
| ^^^^^^^^^^^ method not found in Grpc

error[E0308]: arguments to this method are incorrect
--> C:\Users\marci\Desktop\FileHosting\target\debug\build\FileHosting-878bc6a1594928c5\out/file_hosting.rs:189:30
|
189 | ... .apply_compression_config(
| ^^^^^^^^^^^^^^^^^^^^^^^^
190 | ... accept_compression_encodings,
| ---------------------------- expected EnabledCompressionEncodings, found ()
191 | ... send_compression_encodings,
| -------------------------- expected EnabledCompressionEncodings, found ()
|
note: method defined here
--> C:\Users\marci\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tonic-0.11.0\src\server\grpc.rs:183:12
|
183 | pub fn apply_compression_config(
| ^^^^^^^^^^^^^^^^^^^^^^^^
```
But with the latest version (v0.11.0) I cannot remove this feature I guess.

I edited:
```
/// The greeting service definition.
#[derive(Debug)]
pub struct GreeterServer {
inner: _Inner,
accept_compression_encodings: (),
send_compression_encodings: (),
}
```
to:
```
/// The greeting service definition.
#[derive(Debug)]
pub struct GreeterServer {
inner: _Inner,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
}
```

And also had to bring use tonic::server::NamedService; into scope, but that was in the changleog that I had to do that.

This is my very first issue opened, so Im happy to provide more info if I missed something

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.