-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Dependency segmentation #54
Conversation
Excellent and thank you! |
Sorry, I did not push a formatting commit. I will open another PR to fix the formatting errors ASAP. It will also include some documentation updates and clippy checks. |
Adds documentation for the switch to the `client` and `server` features now being opt-in, rather than enabled by default (see softprops#54). I experimented with also enabling the nightly-only `doc_cfg` / `doc_auto_cfg` features (see rust-lang/rust/issues/43781, which can be used on `docs.rs` since it builds docs with nightly), however: - the features don't currently work well with the re-exports in the crate root, so require every struct/trait to be manually annotated. - the rendering isn't great - the crate landing page wrapping ended up broken So for now it seems best to not use that. I did adjust the `docs.rs` config in `Cargo.toml` to ensure docs are actually generated for all features, since previously the docs were almost empty. I also fixed a few typos / markdown syntax errors.
Adds documentation for the switch to the `client` and `server` features now being opt-in, rather than enabled by default (see softprops#54). I experimented with also enabling the nightly-only `doc_cfg` / `doc_auto_cfg` features (see rust-lang/rust/issues/43781, which can be used on `docs.rs` since it builds docs with nightly), however: - the features don't currently work well with the re-exports in the crate root, so require every struct/trait to be manually annotated. - the rendering isn't great - the crate landing page wrapping ended up broken So for now it seems best to not use that. I did adjust the `docs.rs` config in `Cargo.toml` to ensure docs are actually generated for all features, since previously the docs were almost empty. I also fixed a few typos / markdown syntax errors.
This is another small step towards reducing the size of bollard's dependency tree :-) `tokio` and `hyper` have both switched from `pin-project` crate to the lighter-weight `pin-project-lite`: tokio-rs/tokio#1778 hyperium/hyper#2566 This does the same for bollard. For the differences between the two crates, see: https://docs.rs/pin-project-lite/0.2.8/pin_project_lite/#pin-project-vs-pin-project-lite Note: The full advantage of this won't be seen until a new `hyperlocal` release exists that contains: softprops/hyperlocal#54 ...and bollard updates to that release, so that `pin-project` can be fully dropped from the dependency tree.
@softprops Hi! I don't suppose you know when you might have a spare moment to look at #58 / #57 so a new version of |
Tokio offers the following features: https://docs.rs/tokio/latest/tokio/#feature-flags This removes the following unused Tokio features from `dependencies`: - `fs`: Since it's only used by examples/tests/doctests: https://github.com/fussybeaver/bollard/search?q=%22tokio%3A%3Afs%22 - `rt` / `rt-multi-thread`: Since it's not used by bollard itself, and should be specified by end-users in their application. By activating `rt-multi-thread` by default, it means anyone not using the multi-thread runtime has to pay the dependency/compile time price for it regardless. And the following from `dev-dependencies`: - `time` / `net`: Since they are already specified in `dependencies`, and it's not necessary to duplicate them in `dev-dependencies` as Cargo will perform feature unification. - `rt`: Since `rt-multi-thread` includes `rt` already. - `io-std`: Since it's not used by any examples/tests and isn't even one of the official top-level features anyway: https://docs.rs/tokio/latest/tokio/#feature-flags Note: The full benefits of this change won't be realised until this `hyperlocal` change is picked up in the next `hyperlocal` release: softprops/hyperlocal#54
Tokio offers the following features: https://docs.rs/tokio/latest/tokio/#feature-flags This removes the following unused Tokio features from `dependencies`: - `fs`: Since it's only used by examples/tests/doctests: https://github.com/fussybeaver/bollard/search?q=%22tokio%3A%3Afs%22 - `rt` / `rt-multi-thread`: Since it's not used by bollard itself, and should be specified by end-users in their application. By activating `rt-multi-thread` by default, it means anyone not using the multi-thread runtime has to pay the dependency/compile time price for it regardless. And the following from `dev-dependencies`: - `time` / `net`: Since they are already specified in `dependencies`, and it's not necessary to duplicate them in `dev-dependencies` as Cargo will perform feature unification. - `rt`: Since `rt-multi-thread` includes `rt` already. - `io-std`: Since it's not used by any examples/tests and isn't even one of the official top-level features anyway: https://docs.rs/tokio/latest/tokio/#feature-flags Note: The full benefits of this change won't be realised until this `hyperlocal` change is picked up in the next `hyperlocal` release: softprops/hyperlocal#54
This PR is technically comprised of three changes. Since the changes are small individually, they are bundled together here. I can split the changes into separate PRs if that is preferred.
The main motivation of this PR is to segment
hyper
's server and client features intohyperlocal
's server and client features.This helps reduce compile times for dependents only needing one of the features. To further reduce compile times, this PR also exchanges
pin-project
forpin-project-lite
and removes thefutures-util
dependency:pin-project-lite
is used overpin-project
intokio
, and Ruststd::future
is now standard enough to accomplish what is included fromfutures-util
.Some basic timings (
cargo clean
before each run):cargo build --no-default-features --features=client
cargo build --no-default-features --features=server
cargo build --all-features