benashford / redis-async-rs

A Rust client for Redis, using Tokio
Apache License 2.0
253 stars 30 forks source link

v0.17.0 broken build #93

Closed jizizr closed 8 months ago

jizizr commented 8 months ago

Version v0.17.0

Platform MacOS

Description

Cannot build the newest redis-async:

error[E0599]: no method named `with_retries` found for struct `TcpKeepalive` in the current scope
   --> /Users/allen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/redis-async-0.17.0/src/client/connect.rs:253:14
    |
250 |           let keep_alive = socket2::TcpKeepalive::new()
    |  __________________________-
251 | |             .with_time(interval)
252 | |             .with_interval(interval)
253 | |             .with_retries(1);
    | |             -^^^^^^^^^^^^ help: there is a method with a similar name: `with_time`
    | |_____________|
    | 

I am also getting this error, had to downgrade it to v0.16.1 since my project would not build with v0.17.0

jizizr commented 8 months ago

There is a similar issue that has already been closed for reference. https://github.com/hyperium/hyper/issues/3038

benashford commented 8 months ago

Thanks for this.

Yes, it does look like a similar issue to the one found in Hyper. Specifically that it sounds like it was working by accident because of a required feature of socket2 being enabled by a different dependency (probably Tokio). I will update the Cargo.toml to specify the required features of socket2, which it definitely should as it shouldn't be relying on side-effects which may change underneath us.

benashford commented 8 months ago

I've published v0.17.1 which sets the feature flags correctly, so hopefully that'll resolve this and prevent other people tripping over it in future.