-
Notifications
You must be signed in to change notification settings - Fork 696
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
Use process jobs when spawning subprocesses #6529
Conversation
ab70010
to
b6b1ffc
Compare
|
8085f6a
to
db1153e
Compare
Many toolchain tools written for POSIX systems rely on the exec system call. Unfortunately, it is not possible to implement `exec` in a POSIX-compliant manner on Windows. In particular, the semantics of the `exec` implementation provided by the widely-used `msvcrt` C runtime will cause process's waiting on the `exec`'ing process to incorrectly conclude that the process has successfully terminated when in fact it is still running in another process. For this reason, the `process` library exposes the `use_process_jobs` flag to use a more strict (although still not POSIX-compliant) mechanism for tracking process completion. This is explained in this comment [2]. Unfortunately, job support in the `process` library is currently quite broken and was only recently fixed [1]. Consequently, we only enable job object support for process releases >= 1.6.8. [1] haskell/process#168 [2] https://github.com/haskell/process/blob/master/System/Process.hs#L399
ad5984c
to
e4db2dc
Compare
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.
Patch looks a lot nicer now.
@bgamari do you need this for Cabal-3.2 / GHC-8.10, i.e. should this patch be backported?
There's small failure in Distribution/Simple/Utils.hs:711:56:
`Process.delegate_ctlc' is not a (visible) constructor field name but I can take care of it, if the (restarted) OSX job turns out happy. |
I won't merge this until |
Also, is there a way to see difference between |
What action is required here? I believe the
You could spawn a process which |
Merged as part of #6536 |
Many toolchain tools written for POSIX systems rely on the exec system
call. Unfortunately, it is not possible to implement
exec
in aPOSIX-compliant manner on Windows. In particular, the semantics of the
exec
implementation provided by the widely-usedmsvcrt
C runtimewill cause process's waiting on the
exec
'ing process to incorrectlyconclude that the process has successfully terminated when in fact it is
still running in another process.
For this reason, the
process
library exposes theuse_process_jobs
flag to use a more strict (although still not POSIX-compliant) mechanism
for tracking process completion. This is explained in this comment [2].
Unfortunately, job support in the
process
library is currently quitebroken and was only recently fixed [1]. Consequently, we only enable job
object support for process releases >= 1.6.8.
[1] haskell/process#168
[2] https://github.com/haskell/process/blob/master/System/Process.hs#L399