-
Notifications
You must be signed in to change notification settings - Fork 24
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
Deprecate withProcess/withProcess_ (fixes #25) #26
Conversation
withProcessWait_ config f = bracket | ||
(startProcess config) | ||
stopProcess | ||
(\p -> f p <* checkExitCode p) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why on this case (and in withProcessWait
), you have chosen <*
as compared to finally
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. If there was an exception in the inner block, we want that exception to propagate. Checking the exit code of the process is irrelevant when we're already about to throw a runtime exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a minor question.
But strangely the test case you have added are failing in CI: https://travis-ci.org/fpco/typed-process/jobs/550165307 (Although it does pass for me locally). |
I'm guessing that's a timing issue, I'll try extending the sleep and seeing what happens. |
Nope, that didn't fix it at all, something else is going on. |
@snoyberg I think it might have got to do something with GHC. I changed the resolver to |
You're awesome @psibi! |
OK, looks like the issue is that |
Last test failure, funnily enough, is the Stack bug that initially encouraged the creation of this PR. |
@psibi would you mind taking a look at this?