Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upUse job objects on windows for ctrl-c to work #2370
Conversation
rust-highfive
assigned
wycats
Feb 8, 2016
This comment has been minimized.
This comment has been minimized.
rust-highfive
commented
Feb 8, 2016
|
r? @wycats (rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
|
r? @brson |
rust-highfive
assigned
brson
and unassigned
wycats
Feb 8, 2016
alexcrichton
force-pushed the
alexcrichton:windows-jobs
branch
4 times, most recently
from
6ce639c
to
302bbba
Feb 8, 2016
This comment has been minimized.
This comment has been minimized.
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Feb 11, 2016
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Well, at least I can rest easy at night knowing that the test is indeed working? Looks like our bots are running Window Server 2008 R2, which does not have support for nested jobs. We also run everything inside of
I... am not entirely sure what to do here. Maybe we can detect the Windows version and disable the test if Windows is too old? Maybe we can try adding ourself to two job objects and see if it works? It looks like AppVeyor at least is running a newer version of Windows where the test can be run, so at least we have some coverage of it. |
alexcrichton
closed this
Feb 11, 2016
alexcrichton
deleted the
alexcrichton:windows-jobs
branch
Feb 11, 2016
alexcrichton
restored the
alexcrichton:windows-jobs
branch
Feb 11, 2016
alexcrichton
reopened this
Feb 11, 2016
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Feb 11, 2016
This comment has been minimized.
This comment has been minimized.
|
@bors: r- |
alexcrichton
force-pushed the
alexcrichton:windows-jobs
branch
from
302bbba
to
5ccc842
Feb 11, 2016
This comment has been minimized.
This comment has been minimized.
|
Ok, I've added a check to only enable these tests if the tests are either (a) not in a job or (b) can add themselves to a nested job. I believe this means that buildbot tests will never run these tests (as the builders are already in a job and don't support nested jobs), but appveyor will run these tests (as will runs locally). |
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Feb 11, 2016
This comment has been minimized.
This comment has been minimized.
|
|
bors
merged commit 5ccc842
into
rust-lang:master
Feb 11, 2016
bors
referenced this pull request
Feb 11, 2016
Merged
Implement cfg-based target-specific dependencies #2328
alexcrichton
deleted the
alexcrichton:windows-jobs
branch
Feb 11, 2016
jonas-schievink
referenced this pull request
Feb 16, 2016
Closed
executable doesn't ever close. #29679
This comment has been minimized.
This comment has been minimized.
bruno-medeiros
commented
Apr 20, 2016
|
Cool! I was developing some IDE features that really heavily on this (invoking and killing I trust this will still work if the Cargo process is killed directly (programmatically), and not just when doing a Ctrl-C on the console? In other words, Cargo isn't trying to handle SIGINT or something? |
This comment has been minimized.
This comment has been minimized.
|
Indeed! Although on Unix you'll have to be sure to kill the process group rather than just the Cargo process. Other than that it should work just fine on Unix/Windows both programmatically and via ctrl-c |
This comment has been minimized.
This comment has been minimized.
bruno-medeiros
commented
Apr 20, 2016
|
Hum, I'm just using the Java API that spawns processes... I guess I will have to test how it actually works on Linux, see if it kills the whole process group. But from what I can see from a quick look, the only thing the Java API does on Linux is send a SIGTERM to the spawned process. I dunno if that is enough to kill the child processes of Cargo. |
This comment has been minimized.
This comment has been minimized.
|
Ah yeah unfortunately killing just Cargo isn't enough to kill child process on Unix, you'll have to kill the whole process group. |
This comment has been minimized.
This comment has been minimized.
bruno-medeiros
commented
Apr 21, 2016
|
Ok, that's good to know then. Although, it would be nicer if this functionality were built into Cargo itself. Maybe something for a PR.. |
alexcrichton commentedFeb 8, 2016
Currently it's somewhat surprising if you're using cargo and it's then ctrl-c'd.
The child processes that Cargo spawned are likely to still be running around in
the background as they're not killed as well, and this could cause output spew
or future build failures.
This situation is handled by default on Unix because ctrl-c will end up sending
a signal to the entire process group, which kills everything, but on Windows
we're not as lucky (just Cargo itself is killed). By using job objects on
Windows we can ensure that the entire tree dies instead of just the top Cargo
process.
cc #2343