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

util: bump tokio dependency to 1.6 to satisfy minimal versions #4490

Merged
merged 1 commit into from
Feb 12, 2022

Conversation

djc
Copy link
Contributor

@djc djc commented Feb 11, 2022

This failed in h2 CI:

https://github.com/hyperium/h2/runs/5153518790?check_suite_focus=true

It looks like minimal versions support does not the right thing in the face of path dependencies.

Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

It's really a shame we can't easily test this...

@djc
Copy link
Contributor Author

djc commented Feb 11, 2022

Don't we remove the path deps in release prep PRs? Maybe we could somehow make sure it gets checked at that time?

@taiki-e
Copy link
Member

taiki-e commented Feb 11, 2022

Don't we remove the path deps in release prep PRs? Maybe we could somehow make sure it gets checked at that time?

I implemented a flag for this in cargo-minimal-versions (taiki-e/cargo-minimal-versions#4), but other workspace members have higher version requirements, so it seems that implementation of taiki-e/cargo-minimal-versions#1 is also needed to catch problems like the one this PR fixes.

@taiki-e
Copy link
Member

taiki-e commented Feb 12, 2022

I (partially) implemented taiki-e/cargo-minimal-versions#1 in taiki-e/cargo-minimal-versions#4.
And it can catch the problem that this PR fixes, within tokio workspace!

$ cargo minimal-versions check --workspace --ignore-private --detach-path-deps --all-features

...
info: running `cargo check --all-features` on tokio-util (1/1)
   Compiling libc v0.2.86
    Checking cfg-if v0.1.6
   Compiling syn v1.0.0
    Checking log v0.4.8
    Checking mio v0.7.8
    Checking tokio v1.0.1
   Compiling futures-macro v0.3.11
    Checking futures-util v0.3.11
    Checking tokio-util v0.7.0 (/Users/taiki/projects/forks/tokio-rs/tokio/tokio-util)
error[E0432]: unresolved import `tokio::sync::mpsc::OwnedPermit`
 --> src/sync/mpsc.rs:5:5
  |
5 | use tokio::sync::mpsc::OwnedPermit;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `OwnedPermit` in `sync::mpsc`

...

It also found other minimal versions problems.

1. mio requirement in tokio (macos specific):

info: running `cargo check --all-features` on tokio-stream (1/1)
   Compiling libc v0.2.69
   Compiling log v0.4.8
   Compiling autocfg v1.0.0
   Compiling memchr v2.2.0
    Checking cfg-if v0.1.2
    Checking arc-swap v0.4.0
    Checking pin-project-lite v0.2.5
    Checking once_cell v1.5.2
    Checking bytes v1.0.0
    Checking futures-core v0.3.0
    Checking futures-sink v0.3.0
   Compiling tokio v1.8.0
    Checking signal-hook-registry v1.1.1
    Checking mio v0.7.6
error[E0425]: cannot find value `TCP_KEEPINTVL` in crate `libc`
    --> /Users/taiki/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.7.6/src/sys/unix/tcp.rs:334:15
     |
334  |         libc::TCP_KEEPINTVL,
     |               ^^^^^^^^^^^^^ help: a constant with a similar name exists: `TCP_KEEPALIVE`
     |
    ::: /Users/taiki/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.69/src/unix/bsd/apple/mod.rs:2259:1
     |
2259 | pub const TCP_KEEPALIVE: ::c_int = 0x10;
     | ---------------------------------------- similarly named constant `TCP_KEEPALIVE` defined here

UPD: filed #4492 to fix this.

2. proc-macro2 requirement in async-stream-impl:

info: running `cargo check --all-features` on tokio-test (1/1)
   Compiling proc-macro2 v1.0.0
   Compiling unicode-xid v0.2.0
   Compiling autocfg v1.0.0
   Compiling syn v1.0.0
    Checking futures-core v0.3.0
    Checking pin-project-lite v0.2.5
    Checking bytes v1.0.0
   Compiling tokio v1.2.0
   Compiling quote v1.0.0
    Checking tokio-stream v0.1.1
   Compiling async-stream-impl v0.3.0
error[E0277]: the trait bound `TokenStream2: From<proc_macro2::TokenTree>` is not satisfied
  --> /Users/taiki/.cargo/registry/src/github.com-1ecc6299db9ec823/async-stream-impl-0.3.0/src/lib.rs:17:17
   |
17 |     let input = TokenStream2::from(TokenTree::Group(Group::new(Delimiter::Brace, input)));
   |                 ^^^^^^^^^^^^^^^^^^ the trait `From<proc_macro2::TokenTree>` is not implemented for `TokenStream2`
   |
   = help: the following implementations were found:
             <TokenStream2 as From<proc_macro::TokenStream>>

The implementation is still incomplete and there are a few bugs, but (hopefully) I can probably release it by end of this week or next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio-util Area: The tokio-util crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants