-
-
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
default all feature flags to off #1811
Conversation
Changes the set of `default` feature flags to `[]`. By default, only core traits are included without specifying feature flags. This makes it easier for users to pick the components they need. For convenience, a `full` feature flag is included that includes all components. Tests are configured to require the `full` feature. Testing individual feature flags will need to be moved to a separate crate. Closes #1791
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.
If we've determined that this is the right thing to do, LGTM. I think including a "full" feature and making sure that all the documentation prominently states that it is the recommended way to get started is important, to avoid confusing new users.
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.
+1
README.md structure: ### Tokio for Applications
`tokio = { version = "0.2, features = ["full"] }`
### Tokio for Libraries
`tokio = { version = "0.2, features = ["features"] }` Each of the features should be pretty-well documented. |
Co-Authored-By: Taiki Endo <[email protected]>
azure-pipelines.yml
Outdated
@@ -3,6 +3,7 @@ pr: ["master"] | |||
|
|||
variables: | |||
RUSTFLAGS: -Dwarnings | |||
nightly: 2019-11-16 |
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.
Why?
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.
why what?
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.
Why are we now pinning the nightly?
@@ -1,5 +1,6 @@ | |||
#![cfg(unix)] | |||
#![cfg(feature = "full")] |
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 line should be moved down by one to be consistent with all the others.
@@ -0,0 +1,19 @@ | |||
macro_rules! cfg_codec { |
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.
Why does tokio-util
need these helpers when none of the other crates (afaict) do?
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.
tokio
needs the helpers too?
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.
TBH, tokio-util is kind of under developed ATM. We may want it to be tokio-codec 🤷
Hi! I'd like to ask you to revise this decision. It looks like it brings more problems for newcomers than benefits for powerusers (#1833). Cargo already has a tool for disabling default features: |
Having frequented both the user's forum and this issue tracker, this is not something people ask about often. Adding it to the Libraries depending on too many features of other libraries is incredibly common for projects with several default features. |
Thank you for the clarification! I don't like the idea of fixing other libraries by putting obstacles for a quick start, but good documentation will really help to resolve this problem. Everyone would learn about feature flags at some point in time. It won't hurt if Tokio is the crate that requires this knowledge. |
Changes the set of
default
feature flags to[]
. By default, onlycore traits are included without specifying feature flags. This makes it
easier for users to pick the components they need.
For convenience, a
full
feature flag is included that includes allcomponents.
Tests are configured to require the
full
feature. Testing individualfeature flags will need to be moved to a separate crate.
Closes #1791