Skip to content
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

Current "uds" example does not compile #1732

Closed
Ruddickmg opened this issue Jun 16, 2024 · 3 comments
Closed

Current "uds" example does not compile #1732

Ruddickmg opened this issue Jun 16, 2024 · 3 comments

Comments

@Ruddickmg
Copy link

Bug Report

The current "uds" example does not compile

Version

All my dependencies

[dependencies]
base64 = "0.22.1"
tonic = "0.11.0"
bytes = "1.6.0"
prost-derive = "0.12.6"
prost = "0.12.6"
tokio = { version = "1.38.0", features = ["macros", "rt-multi-thread"] }
hyper-util = {  version = "0.1.5", features = ["tokio"] }
tower = "0.4.13"
vaultrs = "0.7.1"
tokio-stream = { version = "0.1.15", features = ["net"]}

[build-dependencies]
tonic-build = "0.11.0"

Platform

64-bit Ubuntu 22.04.4 LTS

Description

When copy pasting the example found here the code does not compile, resulting in the following error:

error[E0277]: the trait bound `tokio::net::UnixStream: hyper::rt::io::Read` is not satisfied
  --> src/utilities/socket.rs:23:6
   |
23 |     .connect_with_connector(service_fn(|_| async {
   |      ^^^^^^^^^^^^^^^^^^^^^^ the trait `hyper::rt::io::Read` is not implemented for `tokio::net::UnixStream`, which is required by `ServiceFn<{closure@src/utilities/socket.rs:23:40: 23:43}>: MakeConnection<Uri>`
   |
   = help: the following other types implement trait `hyper::rt::io::Read`:
             TokioIo<T>
             Box<T>
             hyper::upgrade::Upgraded
             Pin<P>
             &mut T
   = note: required for `TokioIo<tokio::net::UnixStream>` to implement `AsyncRead`
   = note: required for `ServiceFn<{closure@src/utilities/socket.rs:23:40: 23:43}>` to implement `MakeConnection<Uri>`
@ikrivosheev
Copy link
Contributor

@Ruddickmg hello! tonic = "0.11" doesn't support hyper = "1". Can you check current master branch? Well, we are waiting for 0.12 release.

Issue: #1734

@str4d
Copy link

str4d commented Jun 19, 2024

The example code link above is from recent master branch, after the hyper 1 migration. That it doesn't work with tokio 0.11 is intentional: the current state of the master branch reflects the current development state.

You should instead look at the "uds" example state as of the 0.11.0 tag, which should work with tokio 0.11: https://github.com/hyperium/tonic/blob/v0.11.0/examples/src/uds/client.rs

@ikrivosheev
Copy link
Contributor

I think, we can close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants