OS/Platform name and version: OpenSUSE Tumbleweed Linux
Rust version (if building from source): rustc --version: 1.74.0
Notify version (or commit hash if building from git): notify v6.1.1, notify-debouncer-full v0.3.1
What you did (as detailed as you can)
Create a new project.
Add notify without default features. crossbeam-channel is not installed (as expected).
Add notify-debouncer-full without default features.
What you expected
crossbeam-channel still not being installed, as default features are disabled for both notify and notify-debouncer-full.
What happened
crossbeam-channel is now installed despite the crossbeam default feature being disabled.
The reason is that notify-debouncer-full does not set default-features = false on its notify dependency.
Steps to reproduce
cargo init repro
cd repro
cargo add notify --no-default-features
cargo tree
# crossbeam-channel is not installed. Good.
cargo add notify-debouncer-full --no-default-features
cargo tree
# Unexpectedly, crossbeam-channel is now installed as dependency of `notify`.
Proposed fix
notify-debouncer-full/Cargo.toml:
[features]
-default = ["crossbeam"]
+default = ["crossbeam","notify/macos_fsevent"]
# can't use dep:crossbeam-channel and feature name crossbeam-channel below rust 1.60
crossbeam = ["crossbeam-channel","notify/crossbeam-channel"]
[dependencies]
-notify = { version = "6.1.1", path = "../notify" }
+notify = { version = "6.1.1", path = "../notify", default-features = false }
System details
rustc --version
: 1.74.0What you did (as detailed as you can)
notify
without default features.crossbeam-channel
is not installed (as expected).notify-debouncer-full
without default features.What you expected
crossbeam-channel
still not being installed, as default features are disabled for bothnotify
andnotify-debouncer-full
.What happened
crossbeam-channel
is now installed despite thecrossbeam
default feature being disabled.The reason is that
notify-debouncer-full
does not setdefault-features = false
on itsnotify
dependency.Steps to reproduce
Proposed fix
notify-debouncer-full/Cargo.toml
:Note: The same applies to
notify-debouncer-mini
.