-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
ci: use --feature-powerset --depth 2 in features check #5007
Conversation
``` info: running `cargo check -Z avoid-dev-deps --no-default-features --features net,rt` on tokio (38/225) Compiling tokio v1.21.1 (/home/runner/work/tokio/tokio/tokio) error: associated function `shutdown` is never used --> tokio/src/runtime/driver.rs:65:23 | 65 | pub(crate) fn shutdown(&mut self) { | ^^^^^^^^ | = note: `-D dead-code` implied by `-D warnings` ```
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.
LGTM
This reverts commit 33fc193.
This warning happened in the following cases. ``` failed commands: tokio: `/home/runner/.rustup/toolchains/nightly-2022-07-26-x86_64-unknown-linux-gnu/bin/cargo check -Z avoid-dev-deps --manifest-path tokio/Cargo.toml --no-default-features --features net,rt` `/home/runner/.rustup/toolchains/nightly-2022-07-26-x86_64-unknown-linux-gnu/bin/cargo check -Z avoid-dev-deps --manifest-path tokio/Cargo.toml --no-default-features --features process,rt` `/home/runner/.rustup/toolchains/nightly-2022-07-26-x86_64-unknown-linux-gnu/bin/cargo check -Z avoid-dev-deps --manifest-path tokio/Cargo.toml --no-default-features --features rt,signal` `/home/runner/.rustup/toolchains/nightly-2022-07-26-x86_64-unknown-linux-gnu/bin/cargo check -Z avoid-dev-deps --manifest-path tokio/Cargo.toml --no-default-features --features rt-multi-thread,signal` `/home/runner/.rustup/toolchains/nightly-2022-07-26-x86_64-unknown-linux-gnu/bin/cargo check -Z avoid-dev-deps --manifest-path tokio/Cargo.toml --no-default-features --features signal,test-util` tokio-util: `/home/runner/.rustup/toolchains/nightly-2022-07-26-x86_64-unknown-linux-gnu/bin/cargo check -Z avoid-dev-deps --manifest-path tokio-util/Cargo.toml --no-default-features --features io-util,net` `/home/runner/.rustup/toolchains/nightly-2022-07-26-x86_64-unknown-linux-gnu/bin/cargo check -Z avoid-dev-deps --manifest-path tokio-util/Cargo.toml --no-default-features --features net,rt` ```
hmm...
|
The problem seems to be that the type returned by the tokio/tokio/src/runtime/driver.rs Lines 125 to 143 in 0fddb76
However, diff --git a/tokio/src/runtime/driver.rs b/tokio/src/runtime/driver.rs
index 2a0deb80..6ef98825 100644
--- a/tokio/src/runtime/driver.rs
+++ b/tokio/src/runtime/driver.rs
@@ -17,7 +17,7 @@ pub(crate) enum IoStack {
}
pub(crate) enum IoUnpark {
- Enabled(crate::runtime::io::Handle),
+ Enabled(ProcessHandle),
Disabled(UnparkThread),
}
@@ -127,6 +127,7 @@ fn create_signal_driver(io_driver: IoDriver) -> io::Result<(SignalDriver, Signal
cfg_process_driver! {
type ProcessDriver = crate::process::unix::driver::Driver;
+ type ProcessHandle = crate::runtime::io::Handle;
fn create_process_driver(signal_driver: SignalDriver) -> ProcessDriver {
crate::process::unix::driver::Driver::new(signal_driver)
@@ -136,6 +137,7 @@ fn create_process_driver(signal_driver: SignalDriver) -> ProcessDriver {
cfg_not_process_driver! {
cfg_io_driver! {
type ProcessDriver = SignalDriver;
+ type ProcessHandle = crate::signal::unix::driver::Handle;
fn create_process_driver(signal_driver: SignalDriver) -> ProcessDriver {
signal_driver
|
cc @ipetkov |
Seems like we do need this! |
@taiki-e I can work on fixing this build error since it is from my work. |
This build error happened because I incorrectly combined "handle" and "unpark" when I got rid of the |
Thanks for this! |
Motivation
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.