-
Notifications
You must be signed in to change notification settings - Fork 79
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
Migrate Unix implementation to signal-hook-registry #98
Conversation
@Detegr Poke, any chance you can merge this? CI is failing because of spurious networks failures in AppVeyor. |
I still don't know how I feel about this. But I feel the crate does too much and using it would defeat the purpose of this crate. I get that it's not ideal that having the both crates in a dependency chain just breaks things, that's something I'd like to fix and proposed a fix for that earlier. However, I'd like to see a concrete example of such dependency chain. From a brief look, uses of |
This is probably the best way of doing it, as this is what
Signals in Windows CRT are practically just a wrapper around console control handlers, so it doesn't have to be this way.
Ideally, the best way of doing this is to avoid stepping on others' toes is to just use this strategy.
It's less of "this does break something right now" and more of "this could cause things to break in an extremely hard-to-debug and potentially unsound way in the future". I'm not aware of any cases where ctrlc and signal hook are used in the same dependency graph, but if it does happen you could end up with a very messy situation. |
I'm with @notgull on this one. In my opinion there's little harm in following the structure of a largely accepted, solid implementation like |
I decided against using a multi-hundred line dependency for fixing a hyphotetical bug, and implemented a simple "see if we have signal handler installed, and error out if we do" strategy instead. If |
This change is breaking a lot of other people's stuff and I'm regretting implementing it. I moved the checking implementation to |
Good deal. Seems like that should do the trick for now. Too bad there isn't another, robust implementation hanging around. |
Closes #97 by migrating the Unix backend to signal-hook-registry.
To avoid a breaking change the
signal-hook-registry
errors are translated toEINVAL
, since that's what they usually are anyways.