mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-13 00:00:24 +02:00
ci: use --feature-powerset --depth 2 in features check (#5007)
As has been pointed out a few times in the past (e.g., #4036 (comment)), each-feature is not sufficient for features check. Ideally, we'd like to check all combinations of features, but there are too many combinations. So limit the max number of simultaneous feature flags to 2 by --depth option. I think this should be sufficient in most cases as @carllerche said in taiki-e/cargo-hack#58.
This commit is contained in:
@@ -76,7 +76,7 @@ jobs:
|
||||
run: rustup update stable
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
- name: Install cargo-hack
|
||||
run: cargo install cargo-hack
|
||||
uses: taiki-e/install-action@cargo-hack
|
||||
|
||||
# Run `tokio` with `full` features. This excludes testing utilities which
|
||||
# can alter the runtime behavior of Tokio.
|
||||
@@ -279,14 +279,12 @@ jobs:
|
||||
override: true
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
- name: Install cargo-hack
|
||||
run: cargo install cargo-hack
|
||||
- name: check --each-feature
|
||||
run: cargo hack check --all --each-feature -Z avoid-dev-deps
|
||||
- name: check net,time
|
||||
run: cargo check -p tokio --no-default-features --features net,time -Z avoid-dev-deps
|
||||
uses: taiki-e/install-action@cargo-hack
|
||||
- name: check --feature-powerset
|
||||
run: cargo hack check --all --feature-powerset --depth 2 -Z avoid-dev-deps --keep-going
|
||||
# Try with unstable feature flags
|
||||
- name: check --each-feature --unstable
|
||||
run: cargo hack check --all --each-feature -Z avoid-dev-deps
|
||||
- name: check --feature-powerset --unstable
|
||||
run: cargo hack check --all --feature-powerset --depth 2 -Z avoid-dev-deps --keep-going
|
||||
env:
|
||||
RUSTFLAGS: --cfg tokio_unstable -Dwarnings
|
||||
|
||||
@@ -316,7 +314,7 @@ jobs:
|
||||
override: true
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
- name: Install cargo-hack
|
||||
run: cargo install cargo-hack
|
||||
uses: taiki-e/install-action@cargo-hack
|
||||
- name: "check --all-features -Z minimal-versions"
|
||||
run: |
|
||||
# Remove dev-dependencies from Cargo.toml to prevent the next `cargo update`
|
||||
@@ -501,13 +499,13 @@ jobs:
|
||||
|
||||
# Install dependencies
|
||||
- name: Install cargo-hack
|
||||
run: cargo install cargo-hack
|
||||
uses: taiki-e/install-action@cargo-hack
|
||||
|
||||
- name: Install wasm32-wasi target
|
||||
run: rustup target add wasm32-wasi
|
||||
|
||||
- name: Install wasmtime
|
||||
run: cargo install wasmtime-cli
|
||||
uses: taiki-e/install-action@wasmtime
|
||||
|
||||
- name: Install cargo-wasi
|
||||
run: cargo install cargo-wasi
|
||||
@@ -557,4 +555,3 @@ jobs:
|
||||
cargo install cargo-check-external-types --locked --version 0.1.3
|
||||
cargo check-external-types --all-features --config external-types.toml
|
||||
working-directory: tokio
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@ impl Driver {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn handle(&self) -> Handle {
|
||||
self.park.io_handle()
|
||||
pub(crate) fn unpark(&self) -> Handle {
|
||||
self.park.unpark()
|
||||
}
|
||||
|
||||
pub(crate) fn park(&mut self) {
|
||||
|
||||
@@ -43,7 +43,7 @@ cfg_io_driver! {
|
||||
impl IoStack {
|
||||
pub(crate) fn unpark(&self) -> IoUnpark {
|
||||
match self {
|
||||
IoStack::Enabled(v) => IoUnpark::Enabled(v.handle()),
|
||||
IoStack::Enabled(v) => IoUnpark::Enabled(v.unpark()),
|
||||
IoStack::Disabled(v) => IoUnpark::Disabled(v.unpark()),
|
||||
}
|
||||
}
|
||||
@@ -62,6 +62,7 @@ cfg_io_driver! {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(not(feature = "rt-multi-thread"), allow(dead_code))] // some features use this
|
||||
pub(crate) fn shutdown(&mut self) {
|
||||
match self {
|
||||
IoStack::Enabled(v) => v.shutdown(),
|
||||
|
||||
@@ -145,12 +145,8 @@ impl Driver {
|
||||
}
|
||||
|
||||
// TODO: remove this in a later refactor
|
||||
cfg_not_rt! {
|
||||
cfg_time! {
|
||||
pub(crate) fn unpark(&self) -> Handle {
|
||||
self.handle()
|
||||
}
|
||||
}
|
||||
pub(crate) fn unpark(&self) -> Handle {
|
||||
self.handle()
|
||||
}
|
||||
|
||||
pub(crate) fn park(&mut self) {
|
||||
|
||||
@@ -92,8 +92,8 @@ impl Driver {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn io_handle(&self) -> io::Handle {
|
||||
self.park.handle()
|
||||
pub(crate) fn unpark(&self) -> io::Handle {
|
||||
self.park.unpark()
|
||||
}
|
||||
|
||||
pub(crate) fn park(&mut self) {
|
||||
|
||||
Reference in New Issue
Block a user