Gankra / cargo-mommy

Mommy's here to support you when running cargo~
https://faultlore.com/cargo-mommy/
Apache License 2.0
726 stars 49 forks source link

How should we behave on Ctrl+C? #36

Open 5225225 opened 9 months ago

5225225 commented 9 months ago

I was thinking about #28 and checked out how cargo mommy fuzz works at the moment. A fuzzing failure works, since it exits with nonzero status, but fuzzers typically run indefinitely (or until you get bored, rather. Unless you set a timeout), so you ^C them, which leads mommy to have no output.

Not outputting anything for a normal command seems fine (unless you wanted to make a quip about how impatient the user is, which would be a third response type I think), but at least for a fuzzer which generally always will be exit with ^C, not doing anything doesn't seem great. Treating it as a success would be fine?

Making this issue mainly to get feedback on how we should act here, I have no firm opinions.

Gankra commented 9 months ago

this is a good question and i'm not sure the answer...

BLucky-gh commented 9 months ago

This could probably be done by only saying something if the command has been running for longer than a configurable amount of time, and then write the comment about being impatient or smth in the SIGINT handler

workingjubilee commented 9 months ago

Preferably the decision is made before entering the signal handler, so that there is no accidental use of async-signal-unsafe functions, though I suppose they're unlikely to cause problems.