quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.76k stars 380 forks source link

[quinn v0.8.2/quinn-udp v0.1.1] mio v0.7.14 seem to break solana client+yew+tokio build #1355

Closed katopz closed 2 years ago

katopz commented 2 years ago

Not sure mio v0.8.3 can be use or fix the problem?

I get a lot of incompatible there for mio v0.7.14.

error[E0599]: no method named `deregister` found for struct `IoSource<std::net::UdpSocket>` in the current scope
   --> /Users/katopz/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.7.14/src/net/udp.rs:550:20
    |
550 |         self.inner.deregister(registry)
    |                    ^^^^^^^^^^ method not found in `IoSource<std::net::UdpSocket>`
    |
   ::: /Users/katopz/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.7.14/src/io_source.rs:62:1
    |
62  | pub struct IoSource<T> {
    | ---------------------- method `deregister` not found for this
    |
    = help: items from traits can only be used if the trait is implemented and in scope
note: `Source` defines an item `deregister`, perhaps you need to implement it
   --> /Users/katopz/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.7.14/src/event/source.rs:75:1
    |
75  | pub trait Source {
djc commented 2 years ago

What version of tokio are you using? Does this still work if you downgrade to mio 0.7.13?

djc commented 2 years ago

I suppose we could backport https://github.com/quinn-rs/quinn/pull/1344, but would probably be good to understand what's going on here, since you're the first one report this issue (and mio 0.7.14 is pretty old at this point).

katopz commented 2 years ago

What version of tokio are you using? Does this still work if you downgrade to mio 0.7.13?

The main restriction come from solana here 👉 https://github.com/solana-labs/solana/blob/master/client/Cargo.toml#L54 which is

tokio = { version = "~1.14.1", features = ["full"] }
tokio-stream = "0.1.8"
tokio-tungstenite = { version = "0.17.1", features = ["rustls-tls-webpki-roots"] }
tungstenite = { version = "0.17.2", features = ["rustls-tls-webpki-roots"] }

And it's just break (it's work before previous week) because of this pr 👉 https://github.com/solana-labs/solana/commit/c4aa082efc2415a901c76f68ea1a530ff6713e3d

I try cargo tree to figure out the problem and its lead me to here. I didn't try to downgrade everything to 0.7.13 just yet because i'm sure which one i should stick with and where to blame. 😵

djc commented 2 years ago

It feels unlikely this is a problem with Quinn itself -- but would be good if you want to investigate. If not, maybe you can switch to our main branch temporarily, which doesn't depend on mio at all.

Ralith commented 2 years ago

I agree it's not clear how this would be related to quinn, especially if that's the full error, as there's no quinn code involved.

Maybe it's something to do with enabled features on mio? See e.g. https://github.com/quinn-rs/quinn/issues/1303.

katopz commented 2 years ago

FYI it's look like this atm.

├── solana-client v1.11.0
│   ├── mio v0.8.3 👈 🙂
│   ├── quinn v0.8.2
│   │   ├── quinn-udp v0.1.1
│   │   │   ├── mio v0.7.14 👈 😵
│   │   │   ├── tokio v1.18.2
│   │   │   │   ├── mio v0.8.3 (*) 👈 🙂

as you can see quinn-udp v0.1.1 use mio v0.7.14 (am i right?) so that's why i'm here asking question before do the fork. anyway i found myself fork/patch this and that for many hours w/ randomly version and hope it work 😅.

Ralith commented 2 years ago

Yes, that dependency edge exists, but it should not in and of itself be an issue.

katopz commented 2 years ago

It feels unlikely this is a problem with Quinn itself -- but would be good if you want to investigate. If not, maybe you can switch to our main branch temporarily, which doesn't depend on mio at all.

I got this error for main, and i think it's version 0.8.0 isn't it? which mean next release i will hit this wall again? judge from 0.8.2 will depend on mio anyway?

error[E0616]: field `transport` of struct `quinn::ClientConfig` is private
   --> solana/client/src/quic_client.rs:172:57
    |
172 |         let transport_config = Arc::get_mut(&mut config.transport).unwrap();
    |                                                         ^^^^^^^^^ private field
Ralith commented 2 years ago

I got this error for main

That API has changed since 0.8; refer to the docs/examples for the new pattern.

judge from 0.8.2 will depend on mio anyway?

0.8.2 is not git HEAD. See for yourself:

See for yourself: https://github.com/quinn-rs/quinn/blob/eab6af580c546f103c1cdede120ff9b2d9b9d20a/quinn-udp/Cargo.toml#L18-L23

katopz commented 2 years ago

Not sure mio v0.8.3 can be use or fix the problem?

I get a lot of incompatible there for mio v0.7.14.

error[E0599]: no method named `deregister` found for struct `IoSource<std::net::UdpSocket>` in the current scope
   --> /Users/katopz/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.7.14/src/net/udp.rs:550:20
    |
550 |         self.inner.deregister(registry)
    |                    ^^^^^^^^^^ method not found in `IoSource<std::net::UdpSocket>`
    |
   ::: /Users/katopz/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.7.14/src/io_source.rs:62:1
    |
62  | pub struct IoSource<T> {
    | ---------------------- method `deregister` not found for this
    |
    = help: items from traits can only be used if the trait is implemented and in scope
note: `Source` defines an item `deregister`, perhaps you need to implement it
   --> /Users/katopz/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.7.14/src/event/source.rs:75:1
    |
75  | pub trait Source {

Me from the next 5 hours later, "No" it's break a lot more. Don't try! Here's some of them...

error[E0599]: no method named `deregister` found for struct `IoSource<std::net::UdpSocket>` in the current scope
   --> /Users/katopz/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.8.3/src/net/udp.rs:635:20
    |
635 |         self.inner.deregister(registry)
    |                    ^^^^^^^^^^ method not found in `IoSource<std::net::UdpSocket>`

I give up for now. Thanks for assist anyway. 👍

ColonelThirtyTwo commented 2 years ago

A fresh install of quinn 0.8.2 actually has two incompatible mio dependencies: 0.7.14 from quinn-udp and 0.8.3 from tokio. That might be related to the weirdness you are seeing. #1344 will likely fix it.

Ralith commented 2 years ago

To reiterate, the presence of two mio versions in the dependency graph of 0.8 is not a bug.