File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -64,9 +64,20 @@ pub unsafe fn setup() {
6464 mem:: size_of_val ( & info) as DWORD ) ;
6565 assert ! ( r != 0 , "{}" , io:: Error :: last_os_error( ) ) ;
6666
67- // Assign our process to this job object
67+ // Assign our process to this job object. Note that if this fails, one very
68+ // likely reason is that we are ourselves already in a job object! This can
69+ // happen on the build bots that we've got for Windows, or if just anyone
70+ // else is instrumenting the build. In this case we just bail out
71+ // immediately and assume that they take care of it.
72+ //
73+ // Also note that nested jobs (why this might fail) are supported in recent
74+ // versions of Windows, but the version of Windows that our bots are running
75+ // at least don't support nested job objects.
6876 let r = AssignProcessToJobObject ( job, GetCurrentProcess ( ) ) ;
69- assert ! ( r != 0 , "{}" , io:: Error :: last_os_error( ) ) ;
77+ if r == 0 {
78+ CloseHandle ( job) ;
79+ return
80+ }
7081
7182 // If we've got a parent process (e.g. the python script that called us)
7283 // then move ownership of this job object up to them. That way if the python
You can’t perform that action at this time.
0 commit comments