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

v0.14.21 broken build #3038

Closed
mskrzypkows opened this issue Oct 31, 2022 · 16 comments
Closed

v0.14.21 broken build #3038

mskrzypkows opened this issue Oct 31, 2022 · 16 comments
Labels
C-bug Category: bug. Something is wrong. This is bad!

Comments

@mskrzypkows
Copy link

Version
v0.14.21

Platform
MacOS and Linux

Description

Cannot build the newest hyper:

[2022-10-31T14:18:27.529Z] error[E0599]: no method named `with_interval` found for struct `TcpKeepalive` in the current scope
[2022-10-31T14:18:27.529Z]   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.21/src/server/tcp.rs:49:12
[2022-10-31T14:18:27.529Z]    |
[2022-10-31T14:18:27.529Z] 49 |         ka.with_interval(interval)
[2022-10-31T14:18:27.529Z]    |            ^^^^^^^^^^^^^ method not found in `TcpKeepalive`
[2022-10-31T14:18:27.529Z] 
[2022-10-31T14:18:27.529Z] error[E0599]: no method named `with_retries` found for struct `TcpKeepalive` in the current scope
[2022-10-31T14:18:27.529Z]   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.21/src/server/tcp.rs:60:12
[2022-10-31T14:18:27.529Z]    |
[2022-10-31T14:18:27.529Z] 60 |         ka.with_retries(retries)
[2022-10-31T14:18:27.529Z]    |            ^^^^^^^^^^^^ help: there is an associated function with a similar name: `with_time`
[2022-10-31T14:18:27.529Z] 
@mskrzypkows mskrzypkows added the C-bug Category: bug. Something is wrong. This is bad! label Oct 31, 2022
@Arctic26
Copy link

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

@mskrzypkows
Copy link
Author

hyper = { version = "=0.14.20", features = ["full"] }

@sfackler
Copy link
Contributor

Looks like it needs a more complex blob of cfgs:

#[cfg(all(
        feature = "all",
        any(
            target_os = "android",
            target_os = "dragonfly",
            target_os = "freebsd",
            target_os = "fuchsia",
            target_os = "illumos",
            target_os = "linux",
            target_os = "netbsd",
            target_vendor = "apple",
            windows,
        )
    ))]

@seanmonstar
Copy link
Member

PR to fix this, if any wants to confirm it works on their platform: #3039

@seanmonstar
Copy link
Member

Published v0.14.22 with the fix.

@Arctic26
Copy link

Arctic26 commented Oct 31, 2022

I am still getting this error with v0.14.22 on Windows 10 Server


  --> C:\Users\Admin\.cargo\registry\src\github.com-1ecc6299db9ec823\hyper-0.14.22\src\server\tcp.rs:59:12
   |
59 |         ka.with_interval(interval)
   |            ^^^^^^^^^^^^^ method not found in 'TcpKeepalive'

@ccbrown
Copy link

ccbrown commented Nov 1, 2022

Also still seeing the issue on macOS with 0.14.22:

   Compiling hyper v0.14.22
error[E0599]: no method named `with_interval` found for struct `TcpKeepalive` in the current scope
  --> /Users/chris/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.22/src/server/tcp.rs:59:12
   |
59 |         ka.with_interval(interval)
   |            ^^^^^^^^^^^^^ method not found in `TcpKeepalive`

error[E0599]: no method named `with_retries` found for struct `TcpKeepalive` in the current scope
  --> /Users/chris/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.22/src/server/tcp.rs:89:12
   |
89 |         ka.with_retries(retries)
   |            ^^^^^^^^^^^^ help: there is an associated function with a similar name: `with_time`

@seanmonstar seanmonstar reopened this Nov 1, 2022
@seanmonstar
Copy link
Member

Can you check what version of socket2 is listed in your Cargo.lock? Maybe we need to force a newer one?

@ccbrown
Copy link

ccbrown commented Nov 1, 2022

It was 0.4.1 for me. Adding this to my Cargo.toml does seem to resolve the issue:

socket2 = { version = "0.4.7", features = ["all"] }

@seanmonstar
Copy link
Member

Ok, so for most people that run into this, I imagine this should fix you: cargo update -p socket2.

@ccbrown
Copy link

ccbrown commented Nov 1, 2022

It doesn't. The version isn't the problem. Hyper is trying to use APIs that are only available when the "all" feature of socket2 is enabled.

This also fixes the issue:

socket2 = { version = "=0.4.1", features = ["all"] }

However, just updating to the latest socket2 does not help:

socket2 = "=0.4.7"

It appears to me that Hyper should have a features = ["all"] added to its socket2 dependency.

@seanmonstar
Copy link
Member

Ah, interesting. I saw Tokio's Cargo.toml already sets that feature. (Doesn't mean hyper shouldn't). I suspect maybe just newer versions of Tokio have it set.

@xoac
Copy link

xoac commented Nov 7, 2022

I got the same error and I didn't depend directly on hyper. I got error when I was running cargo clippy --tests --workspace

cargo clippy --tests --workspace
    Checking hyper v0.14.22
error[E0599]: no method named `with_interval` found for struct `TcpKeepalive` in the current scope
  --> /home/sr/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.22/src/server/tcp.rs:59:12
   |
59 |         ka.with_interval(interval)
   |            ^^^^^^^^^^^^^ method not found in `TcpKeepalive`

error[E0599]: no method named `with_retries` found for struct `TcpKeepalive` in the current scope
  --> /home/sr/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-0.14.22/src/server/tcp.rs:89:12
   |
89 |         ka.with_retries(retries)
   |            ^^^^^^^^^^^^ help: there is a method with a similar name: `with_time`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `hyper` due to 2 previous errors

adding to Cargo.toml get rid of the error

socket2 = { version = "0.4", features = ["all"] }

@davepacheco
Copy link

v0.14.22 fails for us (dropshot) with a similar error. Is the problem what @ccbrown said, that hyper is missing a dependency on a socket2 feature?

@seanmonstar
Copy link
Member

It looks like starting with Tokio v1.17, the features = ["all"] was added to its socket2 dependency. Are folks experiencing this issue even with Tokio newer than that?

I'll make sure the next 0.14.x release includes it explicitly.

@xoac
Copy link

xoac commented Nov 7, 2022

@seanmonstar true I am using tokio with "~1.14.1" that is forced by dependency that I use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug. Something is wrong. This is bad!
Projects
None yet
Development

No branches or pull requests

7 participants