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

termination feature infects the entire workspace #74

Closed
nagisa opened this issue Nov 11, 2020 · 4 comments
Closed

termination feature infects the entire workspace #74

nagisa opened this issue Nov 11, 2020 · 4 comments

Comments

@nagisa
Copy link

nagisa commented Nov 11, 2020

Cargo will unify the features across crates, so if you have in your workspace two different crates that depend on ctrlc, one with termination feature enabled and other without, then the binary without it enabled will implicitly get the termination feature enabled for it as well, potentially leading to unintended behaviour.

@Detegr
Copy link
Owner

Detegr commented Jan 8, 2021

This is unfortunate. I don't know how to avoid this other than changing the handling of SIGTERM out from a feature and use a separate handler instead. Any ideas?

@nagisa
Copy link
Author

nagisa commented Jan 8, 2021

Yeah, I don't believe you can get away by using a cargo feature here and will have to make users of this crate to indicate their preference through API in some shape or form.

Detegr added a commit that referenced this issue Jun 21, 2021
Remove SignalType::Termination as it is a bit problematic because a
simple one-to-one signal map for it is usually not what the user wants.
Also as it was behind a feature flag it caused workspace infection, see
issue #74.

Fixes #74
Detegr added a commit that referenced this issue Jun 22, 2021
Remove SignalType::Termination as it is a bit problematic because a
simple one-to-one signal map for it is usually not what the user wants.
Also as it was behind a feature flag it caused workspace infection, see
issue #74.

Fixes #74
Detegr added a commit that referenced this issue Jul 2, 2021
Remove SignalType::Termination as it is a bit problematic because a
simple one-to-one signal map for it is usually not what the user wants.
Also as it was behind a feature flag it caused workspace infection, see
issue #74.

Fixes #74
Detegr added a commit that referenced this issue Jul 23, 2021
Remove SignalType::Termination as it is a bit problematic because a
simple one-to-one signal map for it is usually not what the user wants.
Also as it was behind a feature flag it caused workspace infection, see
issue #74.

Fixes #74
Detegr added a commit that referenced this issue Jul 23, 2021
Remove SignalType::Termination as it is a bit problematic because a
simple one-to-one signal map for it is usually not what the user wants.
Also as it was behind a feature flag it caused workspace infection, see
issue #74.

Fixes #74
@Detegr
Copy link
Owner

Detegr commented May 20, 2023

I think resolver = "2" in Cargo.toml fixes this issue nowadays.

@Detegr Detegr closed this as completed May 20, 2023
@jbg
Copy link

jbg commented Apr 18, 2024

I think resolver = "2" in Cargo.toml fixes this issue nowadays.

I don't think that's the case. The new feature resolver avoids unifying features between dev-/build- deps and normal deps, but features are still unified within each type of dep. That is to say, if two crates in the normal dependency tree both depend on ctrlc (with compatible versions), and one sets termination, the same instance of ctrlc with termination enabled will be used by both.

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

No branches or pull requests

3 participants