-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
tokio: use cargo feature for taskdump support instead of cfg #7655
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
Merged
ADD-SP
merged 8 commits into
tokio-rs:master
from
ADD-SP:add_sp/runtime-taskdump-cargo-feature
Oct 10, 2025
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e4ba090
runtime: use cargo feature for taskdump instead of cfg
ADD-SP 7a0a6a6
revert un-relevant changes
ADD-SP 4803c0b
merge: sync changes from the base branch
ADD-SP 86c0a2d
merge: sync changes from the base branch
ADD-SP 58eb94a
merge: sync changes from the base branch
ADD-SP ef49f87
merge: sync changes from the base branch
ADD-SP 5c86912
merge: sync changes from the base branch
ADD-SP 5fe6b37
Merge branch 'master' into add_sp/runtime-taskdump-cargo-feature
Darksonn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -309,17 +309,14 @@ jobs: | |
- name: test tokio full --cfg unstable --cfg taskdump | ||
run: | | ||
set -euxo pipefail | ||
# taskdump is an unstable feature, but it can only be enabled | ||
# by --cfg tokio_taskdump, not by a feature flag, so we can | ||
# use $TOKIO_STABLE_FEATURES here. | ||
cargo nextest run --features $TOKIO_STABLE_FEATURES | ||
cargo nextest run --features $TOKIO_STABLE_FEATURES,taskdump | ||
cargo test --doc --features $TOKIO_STABLE_FEATURES | ||
working-directory: tokio | ||
env: | ||
RUSTFLAGS: --cfg tokio_unstable --cfg tokio_taskdump -Dwarnings | ||
RUSTFLAGS: --cfg tokio_unstable -Dwarnings | ||
# in order to run doctests for unstable features, we must also pass | ||
# the unstable cfg to RustDoc | ||
RUSTDOCFLAGS: --cfg tokio_unstable --cfg tokio_taskdump | ||
RUSTDOCFLAGS: --cfg tokio_unstable | ||
|
||
check-unstable-mt-counters: | ||
name: check tokio full --internal-mt-counters | ||
|
@@ -484,7 +481,7 @@ jobs: | |
|
||
- uses: Swatinem/rust-cache@v2 | ||
# We don't use --all-features since io-uring will be enabled and is not supported on those targets. | ||
- run: cargo check --workspace --features full,test-util --target ${{ matrix.target }} | ||
- run: cargo check --workspace --features $TOKIO_STABLE_FEATURES --target ${{ matrix.target }} | ||
env: | ||
RUSTFLAGS: --cfg tokio_unstable -Dwarnings | ||
|
||
|
@@ -496,8 +493,9 @@ jobs: | |
matrix: | ||
target: | ||
- name: x86_64-unknown-haiku | ||
exclude_features: "taskdump" # taskdump is only available on Linux | ||
- name: armv7-sony-vita-newlibeabihf | ||
exclude_features: "process,signal,rt-process-signal,full" | ||
exclude_features: "process,signal,rt-process-signal,full,taskdump" | ||
steps: | ||
- uses: actions/checkout@v5 | ||
- name: Install Rust ${{ env.rust_nightly }} | ||
|
@@ -522,14 +520,14 @@ jobs: | |
include: | ||
- target: i686-unknown-linux-gnu | ||
os: ubuntu-latest | ||
rustflags: --cfg tokio_taskdump | ||
extra_features: "taskdump" | ||
- target: armv5te-unknown-linux-gnueabi | ||
os: ubuntu-latest | ||
- target: armv7-unknown-linux-gnueabihf | ||
os: ubuntu-24.04-arm | ||
- target: aarch64-unknown-linux-gnu | ||
os: ubuntu-24.04-arm | ||
rustflags: --cfg tokio_taskdump | ||
extra_features: "io-uring,taskdump" | ||
- target: aarch64-pc-windows-msvc | ||
os: windows-11-arm | ||
steps: | ||
|
@@ -554,13 +552,15 @@ jobs: | |
- name: Tests run with all features (including parking_lot) | ||
run: | | ||
set -euxo pipefail | ||
# We use `--features "full,test-util"` instead of `--all-features` since | ||
# `--all-features` includes `io_uring`, which is not available on all targets. | ||
cargo nextest run -p tokio --features full,test-util --target ${{ matrix.target }} | ||
cargo test --doc -p tokio --features full,test-util --target ${{ matrix.target }} | ||
# We use `--features "$TOKIO_STABLE_FEATURES"` instead of `--all-features` since | ||
# `--all-features` includes `io_uring` and `taskdump`, | ||
# which is not available on all targets. | ||
cargo nextest run -p tokio --features $TOKIO_STABLE_FEATURES,${{ matrix.extra_features }} --target ${{ matrix.target }} | ||
cargo test --doc -p tokio --features $TOKIO_STABLE_FEATURES,${{ matrix.extra_features }} --target ${{ matrix.target }} | ||
env: | ||
RUST_TEST_THREADS: 1 | ||
RUSTFLAGS: --cfg tokio_unstable -Dwarnings --cfg tokio_no_tuning_tests ${{ matrix.rustflags }} | ||
RUSTFLAGS: --cfg tokio_unstable -Dwarnings --cfg tokio_no_tuning_tests | ||
RUSTDOCFLAGS: --cfg tokio_unstable -Dwarnings | ||
|
||
cross-test-without-parking_lot: | ||
needs: basics | ||
|
@@ -570,14 +570,14 @@ jobs: | |
include: | ||
- target: i686-unknown-linux-gnu | ||
os: ubuntu-latest | ||
rustflags: --cfg tokio_taskdump | ||
extra_features: "taskdump" | ||
- target: armv5te-unknown-linux-gnueabi | ||
os: ubuntu-latest | ||
- target: armv7-unknown-linux-gnueabihf | ||
os: ubuntu-24.04-arm | ||
- target: aarch64-unknown-linux-gnu | ||
os: ubuntu-24.04-arm | ||
rustflags: --cfg tokio_taskdump | ||
extra_features: "io-uring,taskdump" | ||
- target: aarch64-pc-windows-msvc | ||
os: windows-11-arm | ||
steps: | ||
|
@@ -606,13 +606,15 @@ jobs: | |
- name: Tests run with all features (without parking_lot) | ||
run: | | ||
set -euxo pipefail | ||
# We use `--features "full,test-util"` instead of `--all-features` since | ||
# `--all-features` includes `io_uring`, which is not available on all targets. | ||
cargo nextest run -p tokio --features full,test-util --target ${{ matrix.target }} | ||
cargo test --doc -p tokio --features full,test-util --target ${{ matrix.target }} | ||
# We use `--features "$TOKIO_STABLE_FEATURES"` instead of `--all-features` since | ||
# `--all-features` includes `io_uring` and `taskdump`, | ||
# which is not available on all targets. | ||
cargo nextest run -p tokio --features $TOKIO_STABLE_FEATURES,${{ matrix.extra_features }} --target ${{ matrix.target }} | ||
cargo test --doc -p tokio --features $TOKIO_STABLE_FEATURES,${{ matrix.extra_features }} --target ${{ matrix.target }} | ||
env: | ||
RUST_TEST_THREADS: 1 | ||
RUSTFLAGS: --cfg tokio_unstable -Dwarnings --cfg tokio_no_parking_lot --cfg tokio_no_tuning_tests ${{ matrix.rustflags }} | ||
RUSTDOCFLAGS: --cfg tokio_unstable -Dwarnings | ||
|
||
# See https://github.com/tokio-rs/tokio/issues/5187 | ||
no-atomic-u64-test: | ||
|
@@ -640,13 +642,11 @@ jobs: | |
- uses: Swatinem/rust-cache@v2 | ||
- name: test tokio --all-features | ||
run: | | ||
# We use `--features "full,test-util"` instead of `--all-features` since | ||
# `--all-features` includes `io_uring`, which is not available on all targets. | ||
cargo nextest run -Zbuild-std --target target-specs/i686-unknown-linux-gnu.json -p tokio --features full,test-util | ||
cargo test --doc -Zbuild-std --target target-specs/i686-unknown-linux-gnu.json -p tokio --features full,test-util | ||
cargo nextest run -Zbuild-std --target target-specs/i686-unknown-linux-gnu.json -p tokio --features $TOKIO_STABLE_FEATURES,taskdump | ||
cargo test --doc -Zbuild-std --target target-specs/i686-unknown-linux-gnu.json -p tokio --features $TOKIO_STABLE_FEATURES,taskdump | ||
env: | ||
RUST_TEST_THREADS: 1 | ||
RUSTFLAGS: --cfg tokio_unstable --cfg tokio_taskdump -Dwarnings --cfg tokio_no_tuning_tests | ||
RUSTFLAGS: --cfg tokio_unstable -Dwarnings --cfg tokio_no_tuning_tests | ||
|
||
no-atomic-u64-check: | ||
name: Check tokio --feature-powerset --depth 2 on i686-unknown-linux-gnu without AtomicU64 | ||
|
@@ -672,18 +672,24 @@ jobs: | |
# We use `--skip io-uring` since io-uring crate doesn't provide a binding for the i686 target. | ||
run: cargo hack check -Zbuild-std --target target-specs/i686-unknown-linux-gnu.json -p tokio --feature-powerset --skip io-uring --depth 2 --keep-going | ||
env: | ||
RUSTFLAGS: --cfg tokio_unstable --cfg tokio_taskdump -Dwarnings | ||
RUSTFLAGS: --cfg tokio_unstable -Dwarnings | ||
|
||
features: | ||
name: features ${{ matrix.name }} | ||
name: features exclude ${{ matrix.name }} | ||
needs: basics | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- { name: "", rustflags: "", exclude_features: "io-uring" } | ||
- { name: "--unstable", rustflags: "--cfg tokio_unstable -Dwarnings", exclude_features: "" } | ||
- { name: "--unstable --taskdump", rustflags: "--cfg tokio_unstable -Dwarnings --cfg tokio_taskdump", exclude_features: "" } | ||
- name: "" | ||
rustflags: "" | ||
exclude_features: "io-uring,taskdump" | ||
- name: "--unstable" | ||
rustflags: "--cfg tokio_unstable -Dwarnings" | ||
exclude_features: "io-uring,taskdump" | ||
- name: "--unstable io-uring,taskdump" | ||
rustflags: "--cfg tokio_unstable -Dwarnings" | ||
exclude_features: "" | ||
steps: | ||
- uses: actions/checkout@v5 | ||
- name: Install Rust ${{ env.rust_nightly }} | ||
|
@@ -749,7 +755,7 @@ jobs: | |
cargo hack check -p tokio-macros -p tokio-stream -p tokio-util -p tokio-test --all-features --ignore-private | ||
- name: "check --all-features --unstable -Z minimal-versions" | ||
env: | ||
RUSTFLAGS: --cfg tokio_unstable --cfg tokio_taskdump -Dwarnings | ||
RUSTFLAGS: --cfg tokio_unstable -Dwarnings | ||
run: | | ||
# Remove dev-dependencies from Cargo.toml to prevent the next `cargo update` | ||
# from determining minimal versions based on dev-dependencies. | ||
|
@@ -795,7 +801,7 @@ jobs: | |
- name: "clippy --all --all-features --unstable" | ||
run: cargo clippy --all --tests --no-deps --all-features | ||
env: | ||
RUSTFLAGS: --cfg tokio_unstable --cfg tokio_taskdump -Dwarnings | ||
RUSTFLAGS: --cfg tokio_unstable -Dwarnings | ||
|
||
docs: | ||
name: docs | ||
|
@@ -804,9 +810,9 @@ jobs: | |
matrix: | ||
run: | ||
- os: windows-latest | ||
extra_features: "tracing" | ||
- os: ubuntu-latest | ||
RUSTFLAGS: --cfg tokio_taskdump | ||
RUSTDOCFLAGS: --cfg tokio_taskdump | ||
extra_features: "tracing,io-uring,taskdump" | ||
|
||
steps: | ||
- uses: actions/checkout@v5 | ||
|
@@ -816,11 +822,10 @@ jobs: | |
toolchain: ${{ env.rust_nightly }} | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "doc --lib --all-features" | ||
run: | | ||
cargo doc --lib --no-deps --all-features --document-private-items | ||
run: cargo doc --lib --no-deps --document-private-items --features $TOKIO_STABLE_FEATURES,${{ matrix.run.extra_features }} | ||
env: | ||
RUSTFLAGS: --cfg docsrs --cfg tokio_unstable ${{ matrix.run.RUSTFLAGS }} | ||
RUSTDOCFLAGS: --cfg docsrs --cfg tokio_unstable -Dwarnings ${{ matrix.run.RUSTDOCFLAGS }} | ||
RUSTFLAGS: --cfg docsrs --cfg tokio_unstable | ||
RUSTDOCFLAGS: --cfg docsrs --cfg tokio_unstable -Dwarnings | ||
|
||
loom-compile: | ||
name: build loom tests | ||
|
@@ -1083,26 +1088,31 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- windows-latest | ||
- ubuntu-latest | ||
rust: | ||
# `check-external-types` requires a specific Rust nightly version. See | ||
# the README for details: https://github.com/awslabs/cargo-check-external-types | ||
- nightly-2024-06-30 | ||
include: | ||
- os: windows-latest | ||
# Windows neither supports io-uring nor taskdump. | ||
extra_features: "tracing" | ||
- os: ubuntu-latest | ||
# includes all unstable features. | ||
extra_features: "tracing,io-uring,taskdump" | ||
steps: | ||
- uses: actions/checkout@v5 | ||
- name: Install Rust ${{ matrix.rust }} | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
# `check-external-types` requires a specific Rust nightly version. See | ||
# the README for details: https://github.com/awslabs/cargo-check-external-types | ||
toolchain: nightly-2025-08-06 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We bump the toolchain due to the MSRV of
|
||
- uses: Swatinem/rust-cache@v2 | ||
- name: Install cargo-check-external-types | ||
uses: taiki-e/cache-cargo-install-action@v1 | ||
with: | ||
tool: cargo-check-external-types@0.1.13 | ||
tool: cargo-check-external-types@0.3.0 | ||
- name: check-external-types | ||
run: cargo check-external-types --features $TOKIO_STABLE_FEATURES | ||
env: | ||
RUSTFLAGS: --cfg tokio_unstable -Dwarnings | ||
RUSTDOCFLAGS: --cfg tokio_unstable | ||
run: cargo check-external-types --features $TOKIO_STABLE_FEATURES,${{ matrix.extra_features }} | ||
working-directory: tokio | ||
|
||
check-fuzzing: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changed the name of this job, we need to update the repo setting to unblock the CI.