ITADN

cargo: disable zbus default features for better usage with Tokio

#61Openlucab 创建于 2025-12-26
L
lucabcommented
Currently `zbus` (as of 5.12) provides two Cargo features that are enabled by default: - `async-io` - `blocking-api` This poses some friction to the vast majority of `zbus_systemd` users (myself included), which are using this crate within the Tokio ecosystem. For some background discussion, see https://github.com/lucab/zbus_systemd/pull/54. Additionally, we don't want the `blocking-api` part in `zbus_systemd` anyway. Going forward, I would like to change the way we depend on `zbus`. First, we will start depending on `zbus` with `default-features = false`. In many cases this will be enough to let consumers use whatever async backend they want, via [feature unification](https://doc.rust-lang.org/cargo/reference/features.html#feature-unification). If they are already pulling `zbus` somewhere else in their dependency tree, we will just follow their choice wrt smol-vs-tokio. Second, we will introduce two optional non-default features: `zbus-async-smol` and `zbus-async-tokio`. In the few cases where consumers aren't already pulling `zbus` in their dependency tree, then they will need to enable one of these two features in `zbus_systemd` itself.
2 条评论