Skip to content
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

notify-debouncer-full / -mini always enable notify default features #549

Closed
LeoniePhiline opened this issue Nov 22, 2023 · 0 comments · Fixed by #550
Closed

notify-debouncer-full / -mini always enable notify default features #549

LeoniePhiline opened this issue Nov 22, 2023 · 0 comments · Fixed by #550
Labels

Comments

@LeoniePhiline
Copy link
Contributor

LeoniePhiline commented Nov 22, 2023

System details

  • 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)

  1. Create a new project.
  2. Add notify without default features. crossbeam-channel is not installed (as expected).
  3. 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 }

Note: The same applies to notify-debouncer-mini.

@LeoniePhiline LeoniePhiline changed the title notify-debouncer-full always enables notify default features notify-debouncer-full / -mini always enable notify default features Nov 22, 2023
LeoniePhiline added a commit to LeoniePhiline/notify that referenced this issue Nov 22, 2023
Debouncers used to install `crossbeam-channel`,
due to keeping `notify`'s default features enabled
even if their own default features were disabled.

With this change, `crossbeam-channel` will
no longer be installed if `notify-debouncer-*`
as well as `notify` are installed with
`default-features = false`

Fixes notify-rs#549
LeoniePhiline added a commit to LeoniePhiline/notify that referenced this issue Nov 23, 2023
Debouncers used to install `crossbeam-channel`,
due to keeping `notify`'s default features enabled
even if their own default features were disabled.

With this change, `crossbeam-channel` will
no longer be installed if `notify-debouncer-*`
as well as `notify` are installed with
`default-features = false`

Fixes notify-rs#549
LeoniePhiline added a commit to LeoniePhiline/notify that referenced this issue Nov 23, 2023
Debouncers used to install `crossbeam-channel`,
due to keeping `notify`'s default features enabled
even if their own default features were disabled.

With this change, `crossbeam-channel` will
no longer be installed if `notify-debouncer-*`
as well as `notify` are installed with
`default-features = false`

Fixes notify-rs#549
@0xpr03 0xpr03 added the A-bug label Nov 28, 2023
0xpr03 pushed a commit that referenced this issue Jan 4, 2024
Debouncers used to install `crossbeam-channel`,
due to keeping `notify`'s default features enabled
even if their own default features were disabled.

With this change, `crossbeam-channel` will
no longer be installed if `notify-debouncer-*`
as well as `notify` are installed with
`default-features = false`

Fixes #549
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants