From 2a180188c62ba13667cb6952ad65fffa72876266 Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Sat, 27 May 2023 14:43:04 +0200 Subject: [PATCH 1/6] ci: fix CI for 1.18.x branch (#5728) Some of these changes will be progressively reverted as we merge this into newer branches. --- .cirrus.yml | 10 ++++++---- .github/workflows/ci.yml | 6 +++--- Cargo.lock | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 Cargo.lock diff --git a/.cirrus.yml b/.cirrus.yml index 6dcd8b19226..39d8431e337 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,5 +1,7 @@ +only_if: $CIRRUS_TAG == '' && ($CIRRUS_PR != '' || $CIRRUS_BRANCH == 'master' || $CIRRUS_BRANCH =~ 'tokio-.*') +auto_cancellation: $CIRRUS_BRANCH != 'master' && $CIRRUS_BRANCH !=~ 'tokio-.*' freebsd_instance: - image: freebsd-12-3-release-amd64 + image_family: freebsd-13-1 env: RUST_STABLE: 1.60.0 RUST_NIGHTLY: nightly-2022-03-21 @@ -12,7 +14,7 @@ env: task: name: FreeBSD 64-bit setup_script: - - pkg install -y bash curl + - pkg install -y bash - curl https://sh.rustup.rs -sSf --output rustup.sh - sh rustup.sh -y --profile minimal --default-toolchain $RUST_STABLE - . $HOME/.cargo/env @@ -29,7 +31,7 @@ task: RUSTFLAGS: --cfg docsrs --cfg tokio_unstable RUSTDOCFLAGS: --cfg docsrs --cfg tokio_unstable -Dwarnings setup_script: - - pkg install -y bash curl + - pkg install -y bash - curl https://sh.rustup.rs -sSf --output rustup.sh - sh rustup.sh -y --profile minimal --default-toolchain $RUST_NIGHTLY - . $HOME/.cargo/env @@ -43,7 +45,7 @@ task: task: name: FreeBSD 32-bit setup_script: - - pkg install -y bash curl + - pkg install -y bash - curl https://sh.rustup.rs -sSf --output rustup.sh - sh rustup.sh -y --profile minimal --default-toolchain $RUST_STABLE - . $HOME/.cargo/env diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae99b17b7e0..e38f7768223 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: run: rustup update stable - uses: Swatinem/rust-cache@v1 - name: Install cargo-hack - run: cargo install cargo-hack + run: cargo install cargo-hack --version 0.5.26 # Run `tokio` with `full` features. This excludes testing utilities which # can alter the runtime behavior of Tokio. @@ -263,7 +263,7 @@ jobs: override: true - uses: Swatinem/rust-cache@v1 - name: Install cargo-hack - run: cargo install cargo-hack + run: cargo install cargo-hack --version 0.5.26 - name: check --each-feature run: cargo hack check --all --each-feature -Z avoid-dev-deps # Try with unstable feature flags @@ -299,7 +299,7 @@ jobs: override: true - uses: Swatinem/rust-cache@v1 - name: Install cargo-hack - run: cargo install cargo-hack + run: cargo install cargo-hack --version 0.5.26 - name: "check --all-features -Z minimal-versions" run: | # Remove dev-dependencies from Cargo.toml to prevent the next `cargo update` diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000000..85d35ddc504 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,32 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "predicates" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49cfaf7fdaa3bfacc6fa3e7054e65148878354a5cfddcf661df4c851f8021df" +dependencies = [ + "difference", + "float-cmp", + "normalize-line-endings", + "predicates-core", + "regex", +] + +[[package]] +name = "predicates-core" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f883590242d3c6fc5bf50299011695fa6590c2c70eac95ee1bdb9a733ad1a2" + +[[package]] +name = "predicates-tree" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54ff541861505aabf6ea722d2131ee980b8276e10a1297b94e896dd8b621850d" +dependencies = [ + "predicates-core", + "termtree", +] From d6a9ef533348c787376b1a64f3cf1103d60a3785 Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Sat, 27 May 2023 14:29:08 +0200 Subject: [PATCH 2/6] tokio: disable default features for mio (#5728) --- tokio/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokio/Cargo.toml b/tokio/Cargo.toml index 3e6b95784b6..a60f348fb3c 100644 --- a/tokio/Cargo.toml +++ b/tokio/Cargo.toml @@ -94,7 +94,7 @@ pin-project-lite = "0.2.0" # Everything else is optional... bytes = { version = "1.0.0", optional = true } memchr = { version = "2.2", optional = true } -mio = { version = "0.8.1", optional = true } +mio = { version = "0.8.1", optional = true, default-features = false } socket2 = { version = "0.4.4", optional = true, features = [ "all" ] } num_cpus = { version = "1.8.0", optional = true } parking_lot = { version = "0.12.0", optional = true } From 0f898a3148c41dffe3f5cd8d5c391ea603d1b22b Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Sat, 27 May 2023 15:23:38 +0200 Subject: [PATCH 3/6] chore: prepare Tokio v1.18.6 (#5729) --- README.md | 2 +- tokio/CHANGELOG.md | 8 ++++++++ tokio/Cargo.toml | 2 +- tokio/README.md | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 46b1e089cfd..39acc200e47 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml: ```toml [dependencies] -tokio = { version = "1.18.5", features = ["full"] } +tokio = { version = "1.18.6", features = ["full"] } ``` Then, on your main.rs: diff --git a/tokio/CHANGELOG.md b/tokio/CHANGELOG.md index 05f4d8152e0..d1c02f39f72 100644 --- a/tokio/CHANGELOG.md +++ b/tokio/CHANGELOG.md @@ -1,3 +1,11 @@ +# 1.18.6 (May 28, 2023) + +### Fixed + +- deps: disable default features for mio ([#5728]) + +[#5728]: https://github.com/tokio-rs/tokio/pull/5728 + # 1.18.5 (January 17, 2023) ### Fixed diff --git a/tokio/Cargo.toml b/tokio/Cargo.toml index a60f348fb3c..30f78191cda 100644 --- a/tokio/Cargo.toml +++ b/tokio/Cargo.toml @@ -6,7 +6,7 @@ name = "tokio" # - README.md # - Update CHANGELOG.md. # - Create "v1.0.x" git tag. -version = "1.18.5" +version = "1.18.6" edition = "2018" rust-version = "1.49" authors = ["Tokio Contributors "] diff --git a/tokio/README.md b/tokio/README.md index 46b1e089cfd..39acc200e47 100644 --- a/tokio/README.md +++ b/tokio/README.md @@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml: ```toml [dependencies] -tokio = { version = "1.18.5", features = ["full"] } +tokio = { version = "1.18.6", features = ["full"] } ``` Then, on your main.rs: From edd172cd3257e36cdfb2925716cdfddb91c4c038 Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Sat, 27 May 2023 15:41:02 +0200 Subject: [PATCH 4/6] chore: prepare Tokio v1.20.5 (#5731) --- README.md | 2 +- tokio/CHANGELOG.md | 10 ++++++++++ tokio/Cargo.toml | 2 +- tokio/README.md | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 288662716ef..2f7126a770b 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml: ```toml [dependencies] -tokio = { version = "1.20.4", features = ["full"] } +tokio = { version = "1.20.5", features = ["full"] } ``` Then, on your main.rs: diff --git a/tokio/CHANGELOG.md b/tokio/CHANGELOG.md index b81de10951f..d01d91bab24 100644 --- a/tokio/CHANGELOG.md +++ b/tokio/CHANGELOG.md @@ -1,3 +1,13 @@ +# 1.20.5 (May 28, 2023) + +Forward ports 1.18.6 changes. + +### Fixed + +- deps: disable default features for mio ([#5728]) + +[#5728]: https://github.com/tokio-rs/tokio/pull/5728 + # 1.20.4 (January 17, 2023) Forward ports 1.18.5 changes. diff --git a/tokio/Cargo.toml b/tokio/Cargo.toml index e60e5a9a7cd..e63c09f854d 100644 --- a/tokio/Cargo.toml +++ b/tokio/Cargo.toml @@ -6,7 +6,7 @@ name = "tokio" # - README.md # - Update CHANGELOG.md. # - Create "v1.0.x" git tag. -version = "1.20.4" +version = "1.20.5" edition = "2018" rust-version = "1.49" authors = ["Tokio Contributors "] diff --git a/tokio/README.md b/tokio/README.md index 288662716ef..2f7126a770b 100644 --- a/tokio/README.md +++ b/tokio/README.md @@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml: ```toml [dependencies] -tokio = { version = "1.20.4", features = ["full"] } +tokio = { version = "1.20.5", features = ["full"] } ``` Then, on your main.rs: From 4b032a25a4032da8d34223149e916e2f3e3ab549 Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Sat, 27 May 2023 15:51:08 +0200 Subject: [PATCH 5/6] ci: use a fixed stable on 1.25.x (#5732) This cherry-picks: * chore: remove ntapi dev-dependency * time: fix repeatedly_reset_entry_inserted_as_expired test --- .circleci/config.yml | 2 +- .cirrus.yml | 15 +- .github/workflows/ci.yml | 15 +- Cargo.lock | 291 +++++++++++++++++++++++++++ tokio-util/tests/time_delay_queue.rs | 8 + tokio/Cargo.toml | 3 - tokio/tests/net_named_pipe.rs | 56 +----- 7 files changed, 309 insertions(+), 81 deletions(-) create mode 100644 Cargo.lock diff --git a/.circleci/config.yml b/.circleci/config.yml index 6f901a95e93..604ff46861d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ jobs: resource_class: arm.medium environment: # Change to pin rust version - RUST_STABLE: stable + RUST_STABLE: 1.67.1 steps: - checkout - run: diff --git a/.cirrus.yml b/.cirrus.yml index bdc44e0c93c..135c9dd18fc 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,7 +1,9 @@ +only_if: $CIRRUS_TAG == '' && ($CIRRUS_PR != '' || $CIRRUS_BRANCH == 'master' || $CIRRUS_BRANCH =~ 'tokio-.*') +auto_cancellation: $CIRRUS_BRANCH != 'master' && $CIRRUS_BRANCH !=~ 'tokio-.*' freebsd_instance: - image: freebsd-12-4-release-amd64 + image_family: freebsd-13-1 env: - RUST_STABLE: stable + RUST_STABLE: 1.67.1 RUST_NIGHTLY: nightly-2022-10-25 RUSTFLAGS: -D warnings @@ -11,9 +13,8 @@ env: # the system's binaries, so the environment shouldn't matter. task: name: FreeBSD 64-bit - auto_cancellation: $CIRRUS_BRANCH != 'master' && $CIRRUS_BRANCH !=~ 'tokio-.*' setup_script: - - pkg install -y bash curl + - pkg install -y bash - curl https://sh.rustup.rs -sSf --output rustup.sh - sh rustup.sh -y --profile minimal --default-toolchain $RUST_STABLE - . $HOME/.cargo/env @@ -26,12 +27,11 @@ task: task: name: FreeBSD docs - auto_cancellation: $CIRRUS_BRANCH != 'master' && $CIRRUS_BRANCH !=~ 'tokio-.*' env: RUSTFLAGS: --cfg docsrs --cfg tokio_unstable RUSTDOCFLAGS: --cfg docsrs --cfg tokio_unstable -Dwarnings setup_script: - - pkg install -y bash curl + - pkg install -y bash - curl https://sh.rustup.rs -sSf --output rustup.sh - sh rustup.sh -y --profile minimal --default-toolchain $RUST_NIGHTLY - . $HOME/.cargo/env @@ -44,9 +44,8 @@ task: task: name: FreeBSD 32-bit - auto_cancellation: $CIRRUS_BRANCH != 'master' && $CIRRUS_BRANCH !=~ 'tokio-.*' setup_script: - - pkg install -y bash curl + - pkg install -y bash - curl https://sh.rustup.rs -sSf --output rustup.sh - sh rustup.sh -y --profile minimal --default-toolchain $RUST_STABLE - . $HOME/.cargo/env diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2813ede8a86..1bdfb7320a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ env: RUSTFLAGS: -Dwarnings RUST_BACKTRACE: 1 # Change to specific Rust release to pin - rust_stable: stable + rust_stable: 1.67.1 rust_nightly: nightly-2022-11-03 rust_clippy: 1.65.0 # When updating this, also update: @@ -349,19 +349,6 @@ jobs: with: toolchain: ${{ env.rust_min }} - uses: Swatinem/rust-cache@v2 - # First compile just the main tokio crate with minrust and newest version - # of all dependencies, then pin once_cell and compile the rest of the - # crates with the pinned once_cell version. - # - # This is necessary because tokio-util transitively depends on once_cell, - # which is not compatible with the current minrust after the 1.15.0 - # release. - - name: "check -p tokio --all-features" - run: cargo check -p tokio --all-features - env: - RUSTFLAGS: "" # remove -Dwarnings - - name: "pin once_cell version" - run: cargo update -p once_cell --precise 1.14.0 - name: "check --workspace --all-features" run: cargo check --workspace --all-features env: diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000000..ae78f634e71 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,291 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. + +# This file was manually edited to only fix the versions that are necessary +# to compile with minrust. +version = 3 + +[[package]] +name = "async-stream" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad445822218ce64be7a341abfb0b1ea43b5c23aa83902542a4542e78309d8e5e" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "futures" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "531ac96c6ff5fd7c62263c5e3c67a603af4fcaee2e1a0ae5565ba3a11e69e549" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" + +[[package]] +name = "futures-executor" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1997dd9df74cdac935c76252744c1ed5794fac083242ea4fe77ef3ed60ba0f83" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", + "num_cpus", +] + +[[package]] +name = "futures-io" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" + +[[package]] +name = "futures-macro" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "futures-sink" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" + +[[package]] +name = "futures-task" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" + +[[package]] +name = "futures-test" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb6a770d3eb0d13372658eec78213b849e0530cf58b4fbc7bf0320e5e4632716" +dependencies = [ + "futures-core", + "futures-executor", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "futures-util", + "pin-project", + "pin-utils", +] + +[[package]] +name = "futures-util" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "predicates" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc3d91237f5de3bcd9d927e24d03b495adb6135097b001cea7403e2d573d00a9" +dependencies = [ + "difflib", + "float-cmp", + "itertools", + "normalize-line-endings", + "predicates-core", + "regex", +] + +[[package]] +name = "predicates-core" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" + +[[package]] +name = "predicates-tree" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +dependencies = [ + "predicates-core", + "termtree", +] + +[[package]] +name = "regex" +version = "1.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "serde" +version = "1.0.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71f2b4817415c6d4210bfe1c7bfcf4801b2d904cb4d0e1a8fdb651013c9e86b8" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "once_cell" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" + +[[package]] +name = "tokio" +version = "1.25.0" +dependencies = [ + "async-stream", + "autocfg", + "bytes", + "futures", + "libc", + "loom", + "memchr", + "mio", + "mio-aio", + "mockall", + "nix 0.26.2", + "ntapi", + "num_cpus", + "parking_lot", + "pin-project-lite", + "proptest", + "rand", + "signal-hook-registry", + "socket2", + "tempfile", + "tokio-macros", + "tokio-stream", + "tokio-test", + "tracing", + "wasm-bindgen-test", + "windows-sys 0.42.0", +] + +[[package]] +name = "tokio-macros" +version = "1.8.2" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.11" +dependencies = [ + "async-stream", + "futures", + "futures-core", + "parking_lot", + "pin-project-lite", + "proptest", + "tokio", + "tokio-test", + "tokio-util", +] + +[[package]] +name = "tokio-test" +version = "0.4.2" +dependencies = [ + "async-stream", + "bytes", + "futures-core", + "futures-util", + "tokio", + "tokio-stream", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +dependencies = [ + "async-stream", + "bytes", + "futures", + "futures-core", + "futures-io", + "futures-sink", + "futures-test", + "futures-util", + "hashbrown", + "parking_lot", + "pin-project-lite", + "slab", + "tokio", + "tokio-stream", + "tokio-test", + "tracing", +] diff --git a/tokio-util/tests/time_delay_queue.rs b/tokio-util/tests/time_delay_queue.rs index 9ceae34365c..c8b74d1ecd3 100644 --- a/tokio-util/tests/time_delay_queue.rs +++ b/tokio-util/tests/time_delay_queue.rs @@ -257,6 +257,10 @@ async fn reset_twice() { #[tokio::test] async fn repeatedly_reset_entry_inserted_as_expired() { time::pause(); + + // Instants before the start of the test seem to break in wasm. + time::sleep(ms(1000)).await; + let mut queue = task::spawn(DelayQueue::new()); let now = Instant::now(); @@ -556,6 +560,10 @@ async fn reset_later_after_slot_starts() { #[tokio::test] async fn reset_inserted_expired() { time::pause(); + + // Instants before the start of the test seem to break in wasm. + time::sleep(ms(1000)).await; + let mut queue = task::spawn(DelayQueue::new()); let now = Instant::now(); diff --git a/tokio/Cargo.toml b/tokio/Cargo.toml index 0f6d30a687d..dfbef149884 100644 --- a/tokio/Cargo.toml +++ b/tokio/Cargo.toml @@ -135,9 +135,6 @@ features = [ "Win32_Security_Authorization", ] -[target.'cfg(windows)'.dev-dependencies.ntapi] -version = "0.3.6" - [dev-dependencies] tokio-test = { version = "0.4.0", path = "../tokio-test" } tokio-stream = { version = "0.1", path = "../tokio-stream" } diff --git a/tokio/tests/net_named_pipe.rs b/tokio/tests/net_named_pipe.rs index c42122465c0..22037361c6c 100644 --- a/tokio/tests/net_named_pipe.rs +++ b/tokio/tests/net_named_pipe.rs @@ -2,13 +2,11 @@ #![cfg(all(windows))] use std::io; -use std::mem; -use std::os::windows::io::AsRawHandle; use std::time::Duration; use tokio::io::AsyncWriteExt; use tokio::net::windows::named_pipe::{ClientOptions, PipeMode, ServerOptions}; use tokio::time; -use windows_sys::Win32::Foundation::{ERROR_NO_DATA, ERROR_PIPE_BUSY, NO_ERROR, UNICODE_STRING}; +use windows_sys::Win32::Foundation::{ERROR_NO_DATA, ERROR_PIPE_BUSY}; #[tokio::test] async fn test_named_pipe_client_drop() -> io::Result<()> { @@ -16,8 +14,6 @@ async fn test_named_pipe_client_drop() -> io::Result<()> { let mut server = ServerOptions::new().create(PIPE_NAME)?; - assert_eq!(num_instances("test-named-pipe-client-drop")?, 1); - let client = ClientOptions::new().open(PIPE_NAME)?; server.connect().await?; @@ -367,53 +363,3 @@ async fn test_named_pipe_access() -> io::Result<()> { } Ok(()) } - -fn num_instances(pipe_name: impl AsRef) -> io::Result { - use ntapi::ntioapi; - - let mut name = pipe_name.as_ref().encode_utf16().collect::>(); - let mut name = UNICODE_STRING { - Length: (name.len() * mem::size_of::()) as u16, - MaximumLength: (name.len() * mem::size_of::()) as u16, - Buffer: name.as_mut_ptr(), - }; - let root = std::fs::File::open(r"\\.\Pipe\")?; - let mut io_status_block = unsafe { mem::zeroed() }; - let mut file_directory_information = [0_u8; 1024]; - - let status = unsafe { - ntioapi::NtQueryDirectoryFile( - root.as_raw_handle(), - std::ptr::null_mut(), - None, - std::ptr::null_mut(), - &mut io_status_block, - &mut file_directory_information as *mut _ as *mut _, - 1024, - ntioapi::FileDirectoryInformation, - 0, - &mut name as *mut _ as _, - 0, - ) - }; - - if status as u32 != NO_ERROR { - return Err(io::Error::last_os_error()); - } - - let info = unsafe { - mem::transmute::<_, &ntioapi::FILE_DIRECTORY_INFORMATION>(&file_directory_information) - }; - let raw_name = unsafe { - std::slice::from_raw_parts( - info.FileName.as_ptr(), - info.FileNameLength as usize / mem::size_of::(), - ) - }; - let name = String::from_utf16(raw_name).unwrap(); - let num_instances = unsafe { *info.EndOfFile.QuadPart() }; - - assert_eq!(name, pipe_name.as_ref()); - - Ok(num_instances as u32) -} From 25258d572abe2075931762bdb111b195157c1bba Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Sat, 27 May 2023 17:48:01 +0200 Subject: [PATCH 6/6] chore: prepare Tokio v1.25.1 (#5734) --- README.md | 2 +- tokio/CHANGELOG.md | 10 ++++++++++ tokio/Cargo.toml | 2 +- tokio/README.md | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 462e6e8b0b7..659a69c8afc 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml: ```toml [dependencies] -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.1", features = ["full"] } ``` Then, on your main.rs: diff --git a/tokio/CHANGELOG.md b/tokio/CHANGELOG.md index 28b30670277..c6e69e1a6d6 100644 --- a/tokio/CHANGELOG.md +++ b/tokio/CHANGELOG.md @@ -1,3 +1,13 @@ +# 1.25.1 (May 28, 2023) + +Forward ports 1.18.6 changes. + +### Fixed + +- deps: disable default features for mio ([#5728]) + +[#5728]: https://github.com/tokio-rs/tokio/pull/5728 + # 1.25.0 (January 28, 2023) ### Fixed diff --git a/tokio/Cargo.toml b/tokio/Cargo.toml index 0151c8d1d22..99c780be3f9 100644 --- a/tokio/Cargo.toml +++ b/tokio/Cargo.toml @@ -6,7 +6,7 @@ name = "tokio" # - README.md # - Update CHANGELOG.md. # - Create "v1.x.y" git tag. -version = "1.25.0" +version = "1.25.1" edition = "2018" rust-version = "1.49" authors = ["Tokio Contributors "] diff --git a/tokio/README.md b/tokio/README.md index 462e6e8b0b7..659a69c8afc 100644 --- a/tokio/README.md +++ b/tokio/README.md @@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml: ```toml [dependencies] -tokio = { version = "1.25.0", features = ["full"] } +tokio = { version = "1.25.1", features = ["full"] } ``` Then, on your main.rs: