Skip to content

Commit

Permalink
Merge branch 'master' into io_async_fd_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tiif authored Nov 15, 2024
2 parents 7ada9c8 + 772e0ca commit 78fd183
Show file tree
Hide file tree
Showing 26 changed files with 174 additions and 92 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,12 @@ permissions:
contents: read

jobs:
security-audit:
cargo-deny:
permissions:
checks: write # for rustsec/audit-check to create check
contents: read # for actions/checkout to fetch code
issues: write # for rustsec/audit-check to create issues
checks: write
contents: read
issues: write
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"
steps:
- uses: actions/checkout@v4

- name: Audit Check
# https://github.com/rustsec/audit-check/issues/2
uses: rustsec/audit-check@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
26 changes: 17 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ jobs:
run: |
set -euxo pipefail
RUSTFLAGS="$RUSTFLAGS -C panic=abort -Zpanic-abort-tests" cargo nextest run --workspace --exclude tokio-macros --exclude tests-build --all-features --tests
test-integration-tests-per-feature:
needs: basics
name: Run integration tests for each feature
Expand Down Expand Up @@ -768,7 +768,15 @@ jobs:

docs:
name: docs
runs-on: ubuntu-latest
runs-on: ${{ matrix.run.os }}
strategy:
matrix:
run:
- os: windows-latest
- os: ubuntu-latest
RUSTFLAGS: --cfg tokio_taskdump
RUSTDOCFLAGS: --cfg tokio_taskdump

steps:
- uses: actions/checkout@v4
- name: Install Rust ${{ env.rust_nightly }}
Expand All @@ -780,8 +788,8 @@ jobs:
run: |
cargo doc --lib --no-deps --all-features --document-private-items
env:
RUSTFLAGS: --cfg docsrs --cfg tokio_unstable --cfg tokio_taskdump
RUSTDOCFLAGS: --cfg docsrs --cfg tokio_unstable --cfg tokio_taskdump -Dwarnings
RUSTFLAGS: --cfg docsrs --cfg tokio_unstable ${{ matrix.run.RUSTFLAGS }}
RUSTDOCFLAGS: --cfg docsrs --cfg tokio_unstable -Dwarnings ${{ matrix.run.RUSTDOCFLAGS }}

loom-compile:
name: build loom tests
Expand Down Expand Up @@ -1035,7 +1043,7 @@ jobs:
rust:
# `check-external-types` requires a specific Rust nightly version. See
# the README for details: https://github.com/awslabs/cargo-check-external-types
- nightly-2023-10-21
- nightly-2024-06-30
steps:
- uses: actions/checkout@v4
- name: Install Rust ${{ matrix.rust }}
Expand All @@ -1046,7 +1054,7 @@ jobs:
- name: Install cargo-check-external-types
uses: taiki-e/cache-cargo-install-action@v1
with:
tool: [email protected].10
tool: [email protected].13
- name: check-external-types
run: cargo check-external-types --all-features
working-directory: tokio
Expand Down Expand Up @@ -1106,11 +1114,11 @@ jobs:
- name: Make sure dictionary words are sorted and unique
run: |
# `sed` removes the first line (number of words) and
# the last line (new line).
#
# the last line (new line).
#
# `sort` makes sure everything in between is sorted
# and contains no duplicates.
#
#
# Since `sort` is sensitive to locale, we set it
# using LC_ALL to en_US.UTF8 to be consistent in different
# environments.
Expand Down
15 changes: 3 additions & 12 deletions .github/workflows/pr-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,8 @@ permissions:
contents: read

jobs:
security-audit:
cargo-deny:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"
steps:
- uses: actions/checkout@v4

- name: Install cargo-audit
run: cargo install cargo-audit

- name: Generate lockfile
run: cargo generate-lockfile

- name: Audit dependencies
run: cargo audit
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ To list the available fuzzing harnesses you can run;
$ cd tokio
$ cargo fuzz list
fuzz_linked_list
````
```

Running a fuzz test is as simple as;

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml:

```toml
[dependencies]
tokio = { version = "1.41.0", features = ["full"] }
tokio = { version = "1.41.1", features = ["full"] }
```
Then, on your main.rs:

Expand Down
3 changes: 2 additions & 1 deletion benches/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "benches"
version = "0.0.0"
publish = false
edition = "2021"
license = "MIT"

[features]
test-util = ["tokio/test-util"]
Expand All @@ -15,7 +16,7 @@ rand_chacha = "0.3"

[dev-dependencies]
tokio-util = { version = "0.7.0", path = "../tokio-util", features = ["full"] }
tokio-stream = { path = "../tokio-stream" }
tokio-stream = { version = "0.1", path = "../tokio-stream" }

[target.'cfg(unix)'.dependencies]
libc = "0.2.42"
Expand Down
21 changes: 21 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# https://embarkstudios.github.io/cargo-deny/cli/init.html

[graph]
all-features = true

[licenses]
allow = [
"MIT",
"Apache-2.0",
]
exceptions = [
{ allow = ["Unicode-DFS-2016"], crate = "unicode-ident" },
]

[bans]
multiple-versions = "allow"
wildcards = "deny"

[sources]
unknown-registry = "deny"
unknown-git = "deny"
1 change: 1 addition & 0 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "examples"
version = "0.0.0"
publish = false
edition = "2021"
license = "MIT"

# If you copy one of the examples into a new project, you should be using
# [dependencies] instead, and delete the **path**.
Expand Down
3 changes: 2 additions & 1 deletion stress-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ name = "stress-test"
version = "0.1.0"
authors = ["Tokio Contributors <[email protected]>"]
edition = "2021"
license = "MIT"
publish = false

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tokio = { path = "../tokio/", features = ["full"] }
tokio = { version = "1.0.0", path = "../tokio/", features = ["full"] }

[dev-dependencies]
rand = "0.8"
3 changes: 2 additions & 1 deletion tests-build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ name = "tests-build"
version = "0.1.0"
authors = ["Tokio Contributors <[email protected]>"]
edition = "2021"
license = "MIT"
publish = false

[features]
full = ["tokio/full"]
rt = ["tokio/rt", "tokio/macros"]

[dependencies]
tokio = { path = "../tokio", optional = true }
tokio = { version = "1.0.0", path = "../tokio", optional = true }

[dev-dependencies]
trybuild = "1.0"
5 changes: 3 additions & 2 deletions tests-integration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "tests-integration"
version = "0.1.0"
authors = ["Tokio Contributors <[email protected]>"]
edition = "2021"
license = "MIT"
publish = false

[[bin]]
Expand Down Expand Up @@ -55,8 +56,8 @@ rt = ["tokio/rt"]
rt-multi-thread = ["rt", "tokio/rt-multi-thread"]

[dependencies]
tokio = { path = "../tokio" }
tokio-test = { path = "../tokio-test", optional = true }
tokio = { version = "1.0.0", path = "../tokio" }
tokio-test = { version = "0.4", path = "../tokio-test", optional = true }
doc-comment = "0.3.1"
futures = { version = "0.3.0", features = ["async-await"] }
bytes = "1.0.0"
2 changes: 1 addition & 1 deletion tokio-stream/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ tokio-util = { version = "0.7.0", path = "../tokio-util", optional = true }
tokio = { version = "1.2.0", path = "../tokio", features = ["full", "test-util"] }
async-stream = "0.3"
parking_lot = "0.12.0"
tokio-test = { path = "../tokio-test" }
tokio-test = { version = "0.4", path = "../tokio-test" }
futures = { version = "0.3", default-features = false }

[package.metadata.docs.rs]
Expand Down
12 changes: 12 additions & 0 deletions tokio/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# 1.41.1 (Nov 7th, 2024)

### Fixed

- metrics: fix bug with wrong number of buckets for the histogram ([#6957])
- net: display `net` requirement for `net::UdpSocket` in docs ([#6938])
- net: fix typo in `TcpStream` internal comment ([#6944])

[#6957]: https://github.com/tokio-rs/tokio/pull/6957
[#6938]: https://github.com/tokio-rs/tokio/pull/6938
[#6944]: https://github.com/tokio-rs/tokio/pull/6944

# 1.41.0 (Oct 22th, 2024)

### Added
Expand Down
2 changes: 1 addition & 1 deletion tokio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name = "tokio"
# - README.md
# - Update CHANGELOG.md.
# - Create "v1.x.y" git tag.
version = "1.41.0"
version = "1.41.1"
edition = "2021"
rust-version = "1.70"
authors = ["Tokio Contributors <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion tokio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml:

```toml
[dependencies]
tokio = { version = "1.41.0", features = ["full"] }
tokio = { version = "1.41.1", features = ["full"] }
```
Then, on your main.rs:

Expand Down
3 changes: 3 additions & 0 deletions tokio/src/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ cfg_io_driver_impl! {
pub(crate) use poll_evented::PollEvented;
}

// The bsd module can't be build on Windows, so we completely ignore it, even
// when building documentation.
#[cfg(unix)]
cfg_aio! {
/// BSD-specific I/O types.
pub mod bsd {
Expand Down
7 changes: 4 additions & 3 deletions tokio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, allow(unused_attributes))]
#![cfg_attr(loom, allow(dead_code, unreachable_pub))]
#![cfg_attr(windows, allow(rustdoc::broken_intra_doc_links))]

//! A runtime for writing reliable network applications without compromising speed.
//!
Expand Down Expand Up @@ -633,15 +634,15 @@ pub mod stream {}
// local re-exports of platform specific things, allowing for decent
// documentation to be shimmed in on docs.rs

#[cfg(docsrs)]
#[cfg(all(docsrs, unix))]
pub mod doc;

#[cfg(any(feature = "net", feature = "fs"))]
#[cfg(docsrs)]
#[cfg(all(docsrs, unix))]
#[allow(unused)]
pub(crate) use self::doc::os;

#[cfg(not(docsrs))]
#[cfg(not(all(docsrs, unix)))]
#[allow(unused)]
pub(crate) use std::os;

Expand Down
1 change: 1 addition & 0 deletions tokio/src/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ cfg_net! {
pub use tcp::socket::TcpSocket;

mod udp;
#[doc(inline)]
pub use udp::UdpSocket;
}
}
Expand Down
3 changes: 3 additions & 0 deletions tokio/src/net/tcp/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,9 @@ impl fmt::Debug for TcpSocket {
}
}

// These trait implementations can't be build on Windows, so we completely
// ignore them, even when building documentation.
#[cfg(unix)]
cfg_unix! {
impl AsRawFd for TcpSocket {
fn as_raw_fd(&self) -> RawFd {
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/net/tcp/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@ impl TcpStream {

// == Poll IO functions that takes `&self` ==
//
// To read or write without mutable access to the `UnixStream`, combine the
// To read or write without mutable access to the `TcpStream`, combine the
// `poll_read_ready` or `poll_write_ready` methods with the `try_read` or
// `try_write` methods.

Expand Down
6 changes: 3 additions & 3 deletions tokio/src/net/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ pub use ucred::UCred;

pub mod pipe;

/// A type representing process and process group IDs.
/// A type representing user ID.
#[allow(non_camel_case_types)]
pub type uid_t = u32;

/// A type representing user ID.
/// A type representing group ID.
#[allow(non_camel_case_types)]
pub type gid_t = u32;

/// A type representing group ID.
/// A type representing process and process group IDs.
#[allow(non_camel_case_types)]
pub type pid_t = i32;
4 changes: 2 additions & 2 deletions tokio/src/net/windows/named_pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cfg_io_util! {
}

// Hide imports which are not used when generating documentation.
#[cfg(not(docsrs))]
#[cfg(windows)]
mod doc {
pub(super) use crate::os::windows::ffi::OsStrExt;
pub(super) mod windows_sys {
Expand All @@ -30,7 +30,7 @@ mod doc {
}

// NB: none of these shows up in public API, so don't document them.
#[cfg(docsrs)]
#[cfg(not(windows))]
mod doc {
pub(super) mod mio_windows {
pub type NamedPipe = crate::doc::NotDefinedHere;
Expand Down
Loading

0 comments on commit 78fd183

Please sign in to comment.